1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
#![allow(dead_code)]
//! This file contains the definitions of public_erros.h and public_erros_rare.h

use ::std::fmt;

#[repr(u32)]
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub enum Error {
	/// General
	Ok                                          = 0x0000,
	Undefined                                   = 0x0001,
	NotImplemented                              = 0x0002,
	OkNoUpdate                                  = 0x0003,
	DontNotify                                  = 0x0004,
	LibTimeLimitReached                         = 0x0005,
	OutOfMemory                                 = 0x0006,
	Canceled                                    = 0x0007,

	/// Dunno
	CommandNotFount                             = 0x0100,
	UnableToBindNetworkPort                     = 0x0101,
	NoNetworkPortAvailable                      = 0x0102,
	PortAlreadyInUse                            = 0x103,

	/// Client
	ClientInvalidId                             = 0x0200,
	ClientNicknameInuse                         = 0x0201,
	ClientProtocolLimitReached                  = 0x0203,
	ClientInvalidType                           = 0x0204,
	ClientAlreadySubscribed                     = 0x0205,
	ClientNotLoggedIn                           = 0x0206,
	ClientCouldNotValidateIdentity              = 0x0207,
	ClientInvalidPassword                       = 0x0208,
	ClientTooManyClonesConnected                = 0x0209,
	ClientVersionOutdated                       = 0x020a,
	ClientIsOnline                              = 0x020b,
	ClientIsFlooding                            = 0x020c,
	ClientHacked                                = 0x020d,
	ClientCannotVerifyNow                       = 0x020e,
	ClientLoginNotPermitted                     = 0x020f,
	ClientNotSubscripted                        = 0x0210,

	/// Channel
	ChannelInvalidId                            = 0x0300,
	ChannelProtocolLimitReached                 = 0x0301,
	ChannelAlreadyIn                            = 0x0302,
	ChannelnameInuse                            = 0x0303,
	ChannelNotEmpty                             = 0x0304,
	ChannelCannotDeleteDefault                  = 0x0305,
	ChannelDefaultRequirePermanent              = 0x0306,
	ChannelInvalidFlags                         = 0x0307,
	ChannelParentNotPermanent                   = 0x0308,
	ChannelMaxclientsReached                    = 0x0309,
	ChannelMaxfamilyReached                     = 0x030a,
	ChannelInvalidOrder                         = 0x030b,
	ChannelNoFiletransferSupported              = 0x030c,
	ChannelInvalidPassword                      = 0x030d,
	ChannelIsPrivateChannel                     = 0x030e,
	ChannelInvalidSecurityHash                  = 0x030f,

	/// Server
	ServerInvalidId                             = 0x0400,
	ServerRunning                               = 0x0401,
	ServerIsShuttingDown                        = 0x0402,
	ServerMaxclientsReached                     = 0x0403,
	ServerInvalidPassword                       = 0x0404,
	ServerDeploymentActive                      = 0x0405,
	ServerUnableToStopOwnServer                 = 0x0406,
	ServerIsVirtual                             = 0x0407,
	ServerWrongMachineid                        = 0x0408,
	ServerIsNotRunning                          = 0x0409,
	ServerIsBooting                             = 0x040a,
	ServerStatusInvalid                         = 0x040b,
	ServerModalQuit                             = 0x040c,
	ServerVersionOutdated                       = 0x040d,
	ServerDuplicatedRunning                     = 0x040e,
	ServerTimeDifferenceTooLarge                = 0x040f,
	ServerBlacklisted                           = 0x0410,

	/// Database
	Database                                    = 0x0500,
	DatabaseEmptyResult                         = 0x0501,
	DatabaseDuplicateEntry                      = 0x0502,
	DatabaseNoModifications                     = 0x0503,
	DatabaseConstraint                          = 0x0504,
	DatabaseReinvoke                            = 0x0505,

	/// Parameter
	ParameterQuote                              = 0x0600,
	ParameterInvalidCount                       = 0x0601,
	ParameterInvalid                            = 0x0602,
	ParameterNotFount                           = 0x0603,
	ParameterConvert                            = 0x0604,
	ParameterInvalidSize                        = 0x0605,
	ParameterMissing                            = 0x0606,
	ParameterChecksum                           = 0x0607,

	/// Unsorted, needs further investigation
	VsCritical                                  = 0x0700,
	ConnectionLost                              = 0x0701,
	NotConnected                                = 0x0702,
	NoCachedConnectionInfo                      = 0x0703,
	CurrentlyNotPossible                        = 0x0704,
	FailedConnectionInitialisation              = 0x0705,
	CouldNotResolveHostname                     = 0x0706,
	InvalidServerConnectionoHandlerId           = 0x0707,
	CouldNotInitialiseInputManager              = 0x0708,
	ClientlibraryNotInitialised                 = 0x0709,
	ServerlibraryNotInitialised                 = 0x070a,
	WhisperTooManyTargets                       = 0x070b,
	WhisperNoTargets                            = 0x070c,
	ConnectionIpProtocolMissing                 = 0x070d,
	// 0x070e is reserved
	IllegalServerLicense                        = 0x070f,

	/// File transfer
	FileInvalidName                             = 0x0800,
	FileInvalidPermissions                      = 0x0801,
	FileAlreadyExists                           = 0x0802,
	FileNotFound                                = 0x0803,
	FileIoError                                 = 0x0804,
	FileInvalidTransferId                       = 0x0805,
	FileInvalidPath                             = 0x0806,
	FileNoFilesAvailable                        = 0x0807,
	FileOverwriteExcludesResume                 = 0x0808,
	FileInvalidSize                             = 0x0809,
	FileAlreadyInUse                            = 0x080a,
	FileCouldNotOpenConnection                  = 0x080b,
	FileNoSpaceLeftOnDevice                     = 0x080c,
	FileExceedsFileSystemMaximumSize            = 0x080d,
	FileTransferConnectionTimeout               = 0x080e,
	FileConnectionLost                          = 0x080f,
	FileExceedsSuppliedSize                     = 0x0810,
	FileTransferComplete                        = 0x0811,
	FileTransferCanceled                        = 0x0812,
	FileTransferInterrupted                     = 0x0813,
	FileTransferServerQuotaExceeded             = 0x0814,
	FileTransferClientQuotaExceeded             = 0x0815,
	FileTransferReset                           = 0x0816,
	FileTransferLimitReached                    = 0x0817,

	/// Sound
	SoundPreprocessorDisabled                   = 0x09_00,
	SoundInternalPreprocessor                   = 0x09_01,
	SoundInternalEncoder                        = 0x09_02,
	SoundInternalPlayback                       = 0x09_03,
	SoundNoCaptureDeviceAvailable               = 0x09_04,
	SoundNoPlaybackDeviceAvailable              = 0x09_05,
	SoundCouldNotOpenCaptureDevice              = 0x09_06,
	SoundCouldNotOpenPlaybackDevice             = 0x09_07,
	SoundHandlerHasDevice                       = 0x09_08,
	SoundInvalidCaptureDevice                   = 0x09_09,
	SoundInvalidPlaybackDevice                  = 0x09_0a,
	SoundInvalidWave                            = 0x09_0b,
	SoundUnsupportedWave                        = 0x09_0c,
	SoundOpenWave                               = 0x09_0d,
	SoundInternalCapture                        = 0x09_0e,
	SoundDeviceInUse                            = 0x09_0f,
	SoundDeviceAlreadyRegisterred               = 0x09_10,
	SoundUnknownDevice                          = 0x09_11,
	SoundUnsupportedFrequency                   = 0x09_12,
	SoundInvalidChannelCount                    = 0x09_13,
	SoundReadWave                               = 0x09_14,
	/// For internal purposes only
	SoundNeedMoreData                           = 0x09_15,
	/// For internal purposes only
	SoundDeviceBusy                             = 0x09_16,
	SoundNoData                                 = 0x09_17,
	SoundChannelMaskMismatch                    = 0x09_18,

	/// Permissions
	PermissionsInvalidGroupId                   = 0x0a_00,
	PermissionsDuplicateEntry                   = 0x0a_01,
	PermissionsInvalidPermId                    = 0x0a_02,
	PermissionsEmptyResult                      = 0x0a_03,
	PermissionsDefaultGroupForbidden            = 0x0a_04,
	PermissionsInvalidSize                      = 0x0a_05,
	PermissionsInvalidValue                     = 0x0a_06,
	PermissionsGroupNotEmpty                    = 0x0a_07,
	PermissionsClientInsufficient               = 0x0a_08,
	PermissionsInsufficientGroupPower           = 0x0a_09,
	PermissionsInsufficientPermissionPower      = 0x0a_0a,
	PermissionsTemplateGroupIsUsed              = 0x0a_0b,
	Permissions                                 = 0x0a_0c,
	PermissionUsedByIntegration                 = 0x0a_0d,

	/// Accounting
	AccountingVirtualserverLimitReached         = 0x0b_00,
	AccountingSlotLimitReached                  = 0x0b_01,
	AccountingLicenseFileNotFound               = 0x0b_02,
	AccountingLicenseDateNotOk                  = 0x0b_03,
	AccountingUnableToConnectToServer           = 0x0b_04,
	AccountingUnknownError                      = 0x0b_05,
	AcountingServerError                        = 0x0b_06,
	AccountingInstanceLimitReached              = 0x0b_07,
	AccountingInstanceCheckError                = 0x0b_08,
	AccountingLicenseFileInvalid                = 0x0b_09,
	AccountingRunningElsewhere                  = 0x0b_0a,
	AccountingInstanceDuplicated                = 0x0b_0b,
	AccountingAlreadyStarted                    = 0x0b_0c,
	AccountingNotStarted                        = 0x0b_0d,
	AccountingToManyStarts                      = 0x0b_0e,

	/// Messages
	MessageInvalidId                            = 0x0c_00,

	/// Ban
	BanInvalidId                                = 0x0d_00,
	ConnectFailedBanned                         = 0x0d_01,
	RenameFailedBanned                          = 0x0d_02,
	BanFlooding                                 = 0x0d_03,

	/// Text to speech
	TtsUnableToInitialize                       = 0x0e_00,

	/// Privilege key
	PrivilegeKeyInvalid                         = 0x0f_00,

	/// Voip
	VoipPjsua                                   = 0x10_00,
	VoipAlreadyInitialized                      = 0x10_01,
	VoipTooManyAccounts                         = 0x10_02,
	VoipInvalidAccount                          = 0x10_03,
	VoipInternalError                           = 0x10_04,
	VoipInvalidConnectionId                     = 0x10_05,
	VoipCannotAnswerInitiatedCall               = 0x10_06,
	VoipNotInitialized                          = 0x10_07,

	/// Provisioning server
	ProvisioningInvalidPassword                 = 0x11_00,
	ProvisioningInvalidRequest                  = 0x11_01,
	ProvisioningNoSlotsAvailable                = 0x11_02,
	ProvisioningPoolMissing                     = 0x11_03,
	ProvisioningPoolUnkown                      = 0x11_04,
	ProvisioningUnknownIpLocation               = 0x11_05,
	ProvisioningInternalTriedExceeded           = 0x11_06,
	ProvisioningTooManySlotsRequested           = 0x11_07,
	ProvisioningTooManyReserved                 = 0x11_08,
	ProvisioningCouldNotConnect                 = 0x11_09,
	ProvisioningAuthServerNotConnected          = 0x11_10,
	ProvisioningAuthDataTooLarge                = 0x11_11,
	ProvisioningAlreadyInitialized              = 0x11_12,
	ProvisioningNotInitialized                  = 0x11_13,
	ProvisioningConnecting                      = 0x11_14,
	ProvisioningAlreadyConnected                = 0x11_15,
	ProvisioningNotConnected                    = 0x11_16,
	ProvisioningIoError                         = 0x11_17,
	ProvisioningInvalidTimeout                  = 0x11_18,
	ProvisioningTs3severNotFound                = 0x11_19,
	ProvisioningNoPermission                    = 0x11_1A,

	/// Mytsid - client
	InvalidMytsidData                           = 0x12_00,
	InvalidIntegration                          = 0x12_01,

	/// Ed25519
	Ed25519RngFail                              = 0x13_00,
	Ed25519SignatureInvalid                     = 0x13_01,
	Ed25519InvalidKey                           = 0x13_02,
	Ed25519UnableToCreateValidKey               = 0x13_03,
	Ed25519OutOfMemory                          = 0x13_04,
	Ed25519Exists                               = 0x13_05,
	Ed25519ReadBeyondEof                        = 0x13_06,
	Ed25519WriteBeyondEof                       = 0x13_07,
	Ed25519Version                              = 0x13_08,
	Ed25519Invalid                              = 0x13_09,
	Ed25519InvalidDate                          = 0x13_0a,
	Ed25519Unauthorized                         = 0x13_0b,
	Ed25519InvalidType                          = 0x13_0c,
	Ed25519AddressNomatch                       = 0x13_0d,
	Ed25519NotValidYet                          = 0x13_0e,
	Ed25519Expired                              = 0x13_0f,
	Ed25519IndexOutOfRange                      = 0x13_10,
	Ed25519InvalidSize                          = 0x13_11,
}

impl fmt::Display for Error {
	fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
		fmt::Debug::fmt(self, f)
	}
}

impl ::std::error::Error for Error {
	fn description(&self) -> &str {
		"TeamSpeak error"
	}
}