├── .clang-format ├── .gitignore ├── Makefile ├── README.md ├── include ├── plugin_definitions.h ├── teamlog │ └── logtypes.h ├── teamspeak │ ├── public_definitions.h │ ├── public_errors.h │ ├── public_errors_rare.h │ └── public_rare_definitions.h └── ts3_functions.h └── src ├── icons ├── 1.png ├── 2.png ├── 3.png └── t.png ├── plugin.c └── plugin.h /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | Language: Cpp 3 | AlignAfterOpenBracket: Align 4 | AlignConsecutiveAssignments: 'true' 5 | AlignConsecutiveDeclarations: 'true' 6 | AlignEscapedNewlinesLeft: 'false' 7 | AlignOperands: 'true' 8 | AlignTrailingComments: 'true' 9 | AllowAllParametersOfDeclarationOnNextLine: 'false' 10 | AllowShortBlocksOnASingleLine: 'true' 11 | AllowShortCaseLabelsOnASingleLine: 'false' 12 | AllowShortFunctionsOnASingleLine: Empty 13 | AllowShortIfStatementsOnASingleLine: 'false' 14 | AllowShortLoopsOnASingleLine: 'false' 15 | BinPackArguments: 'true' 16 | BinPackParameters: 'true' 17 | BreakBeforeBinaryOperators: NonAssignment 18 | BreakBeforeBraces: Linux 19 | BreakBeforeTernaryOperators: 'true' 20 | BreakConstructorInitializersBeforeComma: 'true' 21 | Cpp11BracedListStyle: 'true' 22 | DerivePointerAlignment: 'true' 23 | ExperimentalAutoDetectBinPacking: 'false' 24 | IndentCaseLabels: 'true' 25 | IndentWidth: '4' 26 | ColumnLimit: 256 27 | ReflowComments: 'false' 28 | NamespaceIndentation: Inner 29 | PointerAlignment: Left 30 | SortIncludes: 'true' 31 | SpaceAfterCStyleCast: 'false' 32 | SpaceBeforeAssignmentOperators: 'true' 33 | SpaceBeforeParens: ControlStatements 34 | SpaceInEmptyParentheses: 'false' 35 | SpacesInAngles: 'false' 36 | SpacesInCStyleCastParentheses: 'false' 37 | SpacesInContainerLiterals: 'false' 38 | SpacesInParentheses: 'false' 39 | SpacesInSquareBrackets: 'false' 40 | Standard: Cpp11 41 | TabWidth: '4' 42 | UseTab: Never 43 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .idea 3 | .vscode 4 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile to build TeamSpeak 3 Client Test Plugin 3 | # 4 | 5 | CFLAGS = -c -O2 -Wall -fPIC 6 | 7 | all: test_plugin 8 | 9 | test_plugin: plugin.o 10 | gcc -o test_plugin.so -shared plugin.o 11 | 12 | plugin.o: ./src/plugin.c 13 | gcc -Iinclude src/plugin.c $(CFLAGS) 14 | 15 | clean: 16 | rm -rf *.o test_plugin.so 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TeamSpeak 3 Client Plugin SDK 2 | 3 | Welcome to the official helper repository for creating native plugins for the TeamSpeak 3 Client. This repository includes example code and SDK header files to assist in the development of your plugin. 4 | 5 | ## Quick Start Guide 6 | 7 | To get started, it's highly recommended that you base your plugin on the provided test plugin (`src/plugin.c`). This test plugin includes the necessary special functions that your plugin must export. If certain optional functions are not needed for your project, feel free to remove them. For more details, please refer to the code comments. 8 | 9 | ## Additional Resources 10 | 11 | To expand your knowledge and get support, we recommend visiting the following resources: 12 | 13 | - [TeamSpeak Community Forums](https://community.teamspeak.com): Connect with other developers and TeamSpeak users. 14 | - [TeamSpeak SDK Downloads](https://www.teamspeak.com/downloads#sdk): Access the latest version of our SDK and other development resources. 15 | 16 | ## Copyright Information 17 | 18 | This repository is protected under copyright law. Copyright © TeamSpeak Systems GmbH. All rights reserved. 19 | -------------------------------------------------------------------------------- /include/plugin_definitions.h: -------------------------------------------------------------------------------- 1 | #ifndef PLUGIN_DEFINITIONS 2 | #define PLUGIN_DEFINITIONS 3 | 4 | /* Return values for ts3plugin_offersConfigure */ 5 | enum PluginConfigureOffer { 6 | PLUGIN_OFFERS_NO_CONFIGURE = 0, /* Plugin does not implement ts3plugin_configure */ 7 | PLUGIN_OFFERS_CONFIGURE_NEW_THREAD, /* Plugin does implement ts3plugin_configure and requests to run this function in an own thread */ 8 | PLUGIN_OFFERS_CONFIGURE_QT_THREAD /* Plugin does implement ts3plugin_configure and requests to run this function in the Qt GUI thread */ 9 | }; 10 | 11 | enum PluginMessageTarget { PLUGIN_MESSAGE_TARGET_SERVER = 0, PLUGIN_MESSAGE_TARGET_CHANNEL }; 12 | 13 | enum PluginItemType { PLUGIN_SERVER = 0, PLUGIN_CHANNEL, PLUGIN_CLIENT }; 14 | 15 | enum PluginMenuType { PLUGIN_MENU_TYPE_GLOBAL = 0, PLUGIN_MENU_TYPE_CHANNEL, PLUGIN_MENU_TYPE_CLIENT }; 16 | 17 | #define PLUGIN_MENU_BUFSZ 128 18 | 19 | struct PluginMenuItem { 20 | enum PluginMenuType type; 21 | int id; 22 | char text[PLUGIN_MENU_BUFSZ]; 23 | char icon[PLUGIN_MENU_BUFSZ]; 24 | }; 25 | 26 | #define PLUGIN_HOTKEY_BUFSZ 128 27 | 28 | struct PluginHotkey { 29 | char keyword[PLUGIN_HOTKEY_BUFSZ]; 30 | char description[PLUGIN_HOTKEY_BUFSZ]; 31 | }; 32 | 33 | struct PluginBookmarkList; 34 | struct PluginBookmarkItem { 35 | char* name; 36 | unsigned char isFolder; 37 | unsigned char reserved[3]; 38 | union { 39 | char* uuid; 40 | struct PluginBookmarkList* folder; 41 | }; 42 | }; 43 | 44 | struct PluginBookmarkList { 45 | int itemcount; 46 | struct PluginBookmarkItem items[1]; //should be 0 but compiler complains 47 | }; 48 | 49 | enum PluginGuiProfile { PLUGIN_GUI_SOUND_CAPTURE = 0, PLUGIN_GUI_SOUND_PLAYBACK, PLUGIN_GUI_HOTKEY, PLUGIN_GUI_SOUNDPACK, PLUGIN_GUI_IDENTITY }; 50 | 51 | enum PluginConnectTab { PLUGIN_CONNECT_TAB_NEW = 0, PLUGIN_CONNECT_TAB_CURRENT, PLUGIN_CONNECT_TAB_NEW_IF_CURRENT_CONNECTED }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /include/teamlog/logtypes.h: -------------------------------------------------------------------------------- 1 | #ifndef TEAMLOG_LOGTYPES_H 2 | #define TEAMLOG_LOGTYPES_H 3 | 4 | enum LogTypes { 5 | LogType_NONE = 0x0000, ///< Logging is disabled 6 | LogType_FILE = 0x0001, ///< Log to regular log file 7 | LogType_CONSOLE = 0x0002, ///< Log to standard output / error 8 | LogType_USERLOGGING = 0x0004, ///< User defined logging. Will call the \ref ServerLibFunctions.onUserLoggingMessageEvent callback for every message to be logged 9 | LogType_NO_NETLOGGING = 0x0008, ///< Not used 10 | LogType_DATABASE = 0x0010, ///< Log to database (deprecated, server only, no effect in SDK) 11 | LogType_SYSLOG = 0x0020, ///< Log to syslog (only available on Linux) 12 | }; 13 | 14 | enum LogLevel { 15 | LogLevel_CRITICAL = 0, ///< these messages stop the program 16 | LogLevel_ERROR, ///< everything that is really bad, but not so bad we need to shut down 17 | LogLevel_WARNING, ///< everything that *might* be bad 18 | LogLevel_DEBUG, ///< output that might help find a problem 19 | LogLevel_INFO, ///< informational output, like "starting database version x.y.z" 20 | LogLevel_DEVEL ///< developer only output (will not be displayed in release mode) 21 | }; 22 | 23 | #endif //TEAMLOG_LOGTYPES_H 24 | -------------------------------------------------------------------------------- /include/teamspeak/public_definitions.h: -------------------------------------------------------------------------------- 1 | #ifndef PUBLIC_DEFINITIONS_H 2 | #define PUBLIC_DEFINITIONS_H 3 | 4 | #include "teamlog/logtypes.h" 5 | 6 | #define TS3_MAX_SIZE_CHANNEL_NAME 40 // channel name maximum length in characters 7 | #define TS3_MAX_SIZE_VIRTUALSERVER_NAME 64 // virtual server name maximum length in characters 8 | #define TS3_MAX_SIZE_CLIENT_NICKNAME 64 // client display name length limit in characters 9 | #define TS3_MIN_SIZE_CLIENT_NICKNAME 3 // client display name minimum length in characters 10 | #define TS3_MAX_SIZE_REASON_MESSAGE 80 // length limit in characters for kick, move, etc reasons 11 | 12 | #define TS3_MAX_SIZE_TEXTMESSAGE 8192 // text message length limit, measured in bytes (utf8 encoded) 13 | #define TS3_MAX_SIZE_CHANNEL_TOPIC 255 // channel topic lengt limith, measured in bytes (utf8 encoded) 14 | #define TS3_MAX_SIZE_CHANNEL_DESCRIPTION 8192 // channel description length limit, measured in bytes (utf8 encoded) 15 | // server welcome message length limit measured in bytes (utf8 encoded) 16 | #define TS3_MAX_SIZE_VIRTUALSERVER_WELCOMEMESSAGE 1024 17 | #define TS3_SIZE_MYTSID 44 18 | // minimum amount of seconds before a clientID that was in use can be assigned to a new client 19 | #define TS3_MIN_SECONDS_CLIENTID_REUSE 300 20 | 21 | #if defined(WIN32) || defined(__WIN32__) || defined(_WIN32) 22 | typedef unsigned __int16 anyID; 23 | typedef unsigned __int64 uint64; 24 | #ifndef EXPORTDLL 25 | #ifdef BUILDING_DLL 26 | #define EXPORTDLL __declspec(dllexport) 27 | #else 28 | #define EXPORTDLL 29 | #endif 30 | #endif 31 | #else 32 | #include 33 | typedef uint16_t anyID; 34 | typedef uint64_t uint64; 35 | #ifndef EXPORTDLL 36 | #ifdef BUILDING_DLL 37 | #define EXPORTDLL __attribute__((visibility("default"))) 38 | #else 39 | #define EXPORTDLL 40 | #endif 41 | #endif 42 | #endif 43 | 44 | enum Visibility { 45 | ENTER_VISIBILITY = 0, ///< Client joined from an unsubscribed channel, or joined the server. 46 | RETAIN_VISIBILITY, ///< Client switched from one subscribed channel to a different subscribed channel. 47 | LEAVE_VISIBILITY ///< Client switches to an unsubscribed channel, or disconnected from server. 48 | }; 49 | 50 | enum ConnectStatus { 51 | STATUS_DISCONNECTED = 0, ///< There is no activity to the server, this is the default value 52 | STATUS_CONNECTING, ///< We are trying to connect, we haven't got a client id yet, we haven't been accepted by the server 53 | STATUS_CONNECTED, ///< The server has accepted us, we can talk and hear and we have a client id, but we don't 54 | ///< have the channels and clients yet, we can get server infos (welcome msg etc.) 55 | STATUS_CONNECTION_ESTABLISHING, ///< we are connected and we are visible 56 | STATUS_CONNECTION_ESTABLISHED, ///< we are connected and we have the client and channels available 57 | }; 58 | 59 | enum LocalTestMode { TEST_MODE_OFF = 0, TEST_MODE_VOICE_LOCAL_ONLY, TEST_MODE_VOICE_LOCAL_AND_REMOTE, TEST_MODE_TALK_STATUS_CHANGES_ONLY }; 60 | 61 | enum TalkStatus { 62 | STATUS_NOT_TALKING = 0, ///< client is not talking 63 | STATUS_TALKING = 1, ///< client is talking 64 | STATUS_TALKING_WHILE_DISABLED = 2, ///< client is talking while the microphone is muted (only valid for own client) 65 | }; 66 | 67 | enum CodecType { 68 | CODEC_SPEEX_NARROWBAND = 0, ///< (deprecated) mono, 16bit, 8kHz, bitrate dependent on the quality setting 69 | CODEC_SPEEX_WIDEBAND, ///< (deprecated) mono, 16bit, 16kHz, bitrate dependent on the quality setting 70 | CODEC_SPEEX_ULTRAWIDEBAND, ///< (deprecated) mono, 16bit, 32kHz, bitrate dependent on the quality setting 71 | CODEC_CELT_MONO, ///< (deprecated) mono, 16bit, 48kHz, bitrate dependent on the quality setting 72 | CODEC_OPUS_VOICE, ///< mono, 16bit, 48khz, bitrate dependent on the quality setting, optimized for voice 73 | CODEC_OPUS_MUSIC, ///< stereo, 16bit, 48khz, bitrate dependent on the quality setting, optimized for music 74 | }; 75 | 76 | enum CodecEncryptionMode { 77 | CODEC_ENCRYPTION_PER_CHANNEL = 0, ///< voice data encryption decided per channel 78 | CODEC_ENCRYPTION_FORCED_OFF, ///< voice data encryption disabled 79 | CODEC_ENCRYPTION_FORCED_ON, ///< voice data encryption enabled 80 | }; 81 | 82 | enum TextMessageTargetMode { 83 | TextMessageTarget_CLIENT = 1, ///< Message is a private message to another client 84 | TextMessageTarget_CHANNEL, ///< Message is sent to a channel, received by all clients in that channel at the time 85 | TextMessageTarget_SERVER, ///< Message is sent to every client on the server 86 | TextMessageTarget_MAX 87 | }; 88 | 89 | enum MuteInputStatus { 90 | MUTEINPUT_NONE = 0, ///< Microphone is not muted, audio is sent to the server 91 | MUTEINPUT_MUTED, ///< Microphone is muted, no audio is transmitted to the server 92 | }; 93 | 94 | enum MuteOutputStatus { 95 | MUTEOUTPUT_NONE = 0, ///< Speaker is active, server is sending us audio 96 | MUTEOUTPUT_MUTED, ///< Speaker is muted, server is not sending audio to us 97 | }; 98 | 99 | enum HardwareInputStatus { 100 | HARDWAREINPUT_DISABLED = 0, ///< no capture device opened 101 | HARDWAREINPUT_ENABLED, ///< capture device open 102 | }; 103 | 104 | enum HardwareOutputStatus { 105 | HARDWAREOUTPUT_DISABLED = 0, ///< no playback device opened 106 | HARDWAREOUTPUT_ENABLED, ///< playback device open 107 | }; 108 | 109 | enum InputDeactivationStatus { 110 | INPUT_ACTIVE = 0, ///< Audio is captured from the capture device. 111 | INPUT_DEACTIVATED = 1, ///< No audio is captured from the capture device. 112 | }; 113 | 114 | enum ReasonIdentifier { 115 | REASON_NONE = 0, ///< no reason data 116 | REASON_MOVED = 1, ///< client was moved 117 | REASON_SUBSCRIPTION = 2, // no reason data 118 | REASON_LOST_CONNECTION = 3, // reasonmsg=reason 119 | REASON_KICK_CHANNEL = 4, //{SectionInvoker} reasonmsg=reason //{SectionInvoker} is only added server->client 120 | REASON_KICK_SERVER = 5, //{SectionInvoker} reasonmsg=reason //{SectionInvoker} is only added server->client 121 | REASON_KICK_SERVER_BAN = 6, //{SectionInvoker} reasonmsg=reason bantime=time //{SectionInvoker} is only added server->client 122 | REASON_SERVERSTOP = 7, // reasonmsg=reason 123 | REASON_CLIENTDISCONNECT = 8, // reasonmsg=reason 124 | REASON_CHANNELUPDATE = 9, // no reason data 125 | REASON_CHANNELEDIT = 10, //{SectionInvoker} 126 | REASON_CLIENTDISCONNECT_SERVER_SHUTDOWN = 11, // reasonmsg=reason 127 | }; 128 | 129 | enum Protocol_Encryption_Cipher { AES_128 = 0, AES_256, PROTOCOL_ENCRYPTION_CIPHER_END_MARKER }; 130 | 131 | enum ChannelProperties { 132 | CHANNEL_NAME = 0, ///< String. Read/Write. Name of the channel. Always available. 133 | CHANNEL_TOPIC, ///< String. Read/Write. Short single line text describing what the channel is about. Always available. 134 | CHANNEL_DESCRIPTION, ///< String. Read/Write. Arbitrary text (up to 8k bytes) with information about the channel. 135 | ///< Must be requested (\ref ts3client_requestChannelDescription) 136 | CHANNEL_PASSWORD, ///< String. Read/Write. Password of the channel. Read access is limited to the server. Clients 137 | ///< will only ever see the last password they attempted to use when joining the channel. Always available. 138 | CHANNEL_CODEC, ///< Integer. Read/Write. The codec this channel is using. One of the values from the \ref CodecType 139 | ///< enum. Always available. 140 | CHANNEL_CODEC_QUALITY, ///< Integer. Read/Write. The quality setting of the channel. Valid values are 0 to 10 inclusive. 141 | ///< Higher value means better voice quality but also more bandwidth usage. Always available. 142 | CHANNEL_MAXCLIENTS, ///< Integer. Read/Write. The number of clients that can be in the channel simultaneously. 143 | ///< Always available. 144 | CHANNEL_MAXFAMILYCLIENTS, ///< Integer. Read/Write. The total number of clients that can be in this channel and all 145 | ///< sub channels of this channel. Always available. 146 | CHANNEL_ORDER, ///< UInt64. Read/Write. The ID of the channel below which this channel should be displayed. If 0 147 | ///< the channel is sorted at the top of the current level. Always available. 148 | CHANNEL_FLAG_PERMANENT, ///< Integer. Read/Write. Boolean (1/0) indicating whether the channel remains when empty. 149 | ///< Permanent channels are stored to the database and available after server restart. SDK 150 | ///< users will need to take care of restoring channel at server start on their own. 151 | ///< Mutually exclusive with \ref CHANNEL_FLAG_SEMI_PERMANENT. Always available. 152 | CHANNEL_FLAG_SEMI_PERMANENT, ///< Integer. Read/Write. Boolean (1/0) indicating whether the channel remains when 153 | ///< empty. Semi permanent channels are not stored to disk and gone after server 154 | ///< restart but remain while empty. Mutually exclusive with \ref 155 | ///< CHANNEL_FLAG_PERMANENT. Always available. 156 | CHANNEL_FLAG_DEFAULT, ///< Integer. Read/Write. Boolean (1/0). The default channel is the channel that all clients 157 | ///< are located in when they join the server, unless the client explicitly specified a 158 | ///< different channel when connecting and is allowed to join their preferred channel. Only 159 | ///< one channel on the server can have this flag set. The default channel must have \ref 160 | ///< CHANNEL_FLAG_PERMANENT set. Always available. 161 | CHANNEL_FLAG_PASSWORD, ///< Integer. Read/Write. Boolean (1/0) indicating whether this channel is password protected. 162 | ///< When removing or setting \ref CHANNEL_PASSWORD you also need to adjust this flag. 163 | CHANNEL_CODEC_LATENCY_FACTOR, ///< (deprecated) Integer. Read/Write. Allows to increase packet size, reducing 164 | ///< bandwith at the cost of higher latency of voice transmission. Valid values are 165 | ///< 1-10 inclusive. 1 is the default and offers the lowest latency. Always available. 166 | CHANNEL_CODEC_IS_UNENCRYPTED, ///< Integer. Read/Write. Boolean (1/0). If 0 voice data is encrypted, if 1 the voice 167 | ///< data is not encrypted. Only used if the server \ref 168 | ///< VIRTUALSERVER_CODEC_ENCRYPTION_MODE is set to \ref CODEC_ENCRYPTION_PER_CHANNEL. 169 | ///< Always available. 170 | CHANNEL_SECURITY_SALT, ///< String. Read/Write. SDK Only, not used by TeamSpeak. This channels security hash. When 171 | ///< a client joins their \ref CLIENT_SECURITY_HASH is compared to this value, to allow or 172 | ///< deny the client access to the channel. Used to enforce clients joining the server with 173 | ///< specific identity and \ref CLIENT_META_DATA. See SDK Documentation about this feature 174 | ///< for further details. Always available. 175 | CHANNEL_DELETE_DELAY, ///< UInt64. Read/Write. Number of seconds deletion of temporary channels is delayed after 176 | ///< the last client leaves the channel. Channel is only deleted if empty when the delete 177 | ///< delay expired. Always available. 178 | CHANNEL_UNIQUE_IDENTIFIER, ///< String. Read only. An identifier that uniquely identifies a channel. Available in 179 | ///< Server >= 3.10.0 180 | CHANNEL_ENDMARKER, 181 | }; 182 | 183 | enum ClientProperties { 184 | CLIENT_UNIQUE_IDENTIFIER = 0, ///< String. Read only. Public Identity, can be used to identify a client 185 | ///< installation. Remains identical as long as the client keeps using the same 186 | ///< identity. Available for visible clients. 187 | CLIENT_NICKNAME, ///< String. Read/Write. Display name of the client. Available for visible clients. 188 | CLIENT_VERSION, ///< String. Read only. Version String of the client used. For clients other than ourself this 189 | ///< needs to be requested (\ref ts3client_requestClientVariables). 190 | CLIENT_PLATFORM, ///< String. Read only. Operating system used by the client. For other clients other than ourself 191 | ///< this needs to be requested (\ref ts3client_requestClientVariables). 192 | CLIENT_FLAG_TALKING, ///< Integer. Read only. Whether the client is talking. Available on clients that are either 193 | ///< whispering to us, or in our channel. 194 | CLIENT_INPUT_MUTED, ///< Integer. Read/Write. Microphone mute status. Available for visible clients. One of the 195 | ///< values from the \ref MuteInputStatus enum. 196 | CLIENT_OUTPUT_MUTED, ///< Integer. Read only. Speaker mute status. Speaker mute implies microphone mute. Available 197 | ///< for visible clients. One of the values from the \ref MuteOutputStatus enum. 198 | CLIENT_OUTPUTONLY_MUTED, ///< Integer. Read only. Speaker mute status. Microphone may be active. Available for 199 | ///< visible clients. One of the values from the \ref MuteOutputStatus enum. 200 | CLIENT_INPUT_HARDWARE, ///< Integer. Read only. Indicates whether a capture device is open. Available for visible 201 | ///< clients. One of the values from the \ref HardwareInputStatus enum. 202 | CLIENT_OUTPUT_HARDWARE, ///< Integer. Read only. Indicates whether a playback device is open. Available for visible 203 | ///< clients. One of the values from the \ref HardwareOutputStatus enum. 204 | CLIENT_INPUT_DEACTIVATED, ///< Integer. Read/Write. Not available server side. Local microphone mute status. 205 | ///< Available only for own client. Used to implement Push To Talk. One of the values from 206 | ///< the \ref InputDeactivationStatus enum. 207 | CLIENT_IDLE_TIME, ///< UInt64. Read only. Seconds since last activity. Available only for own client. 208 | CLIENT_DEFAULT_CHANNEL, ///< String. Read only. User specified channel they joined when connecting to the server. 209 | ///< Available only for own client. 210 | CLIENT_DEFAULT_CHANNEL_PASSWORD, ///< String. Read only. User specified channel password for the channel they 211 | ///< attempted to join when connecting to the server. Available only for own 212 | ///< client. 213 | CLIENT_SERVER_PASSWORD, ///< String. Read only. User specified server password. Available only for own client. 214 | CLIENT_META_DATA, ///< String. Read/Write. Can be used to store up to 4096 bytes of information on clients. Not 215 | ///< used by TeamSpeak. Available for visible clients. 216 | CLIENT_IS_MUTED, ///< Integer. Read only. Not available server side. Indicates whether we have muted the client 217 | ///< using \ref ts3client_requestMuteClients. Available for visible clients other than ourselves. 218 | CLIENT_IS_RECORDING, ///< Integer. Read only. Indicates whether the client is recording incoming audio. Available 219 | ///< for visible clients. 220 | CLIENT_VOLUME_MODIFICATOR, ///< Integer. Read only. Volume adjustment for this client as set by \ref 221 | ///< ts3client_setClientVolumeModifier. Available for visible clients. 222 | CLIENT_VERSION_SIGN, ///< String. Read only. TeamSpeak internal signature. 223 | CLIENT_SECURITY_HASH, ///< String. Read/Write. This clients security hash. Not used by TeamSpeak, SDK only. Hash is 224 | ///< provided by an outside source. A channel will use the security salt + other client data 225 | ///< to calculate a hash, which must be the same as the one provided here. See SDK 226 | ///< documentation about Client / Channel Security Hashes for more details. 227 | CLIENT_ENCRYPTION_CIPHERS, ///< String. Read only. SDK only. List of available ciphers this client can use. 228 | CLIENT_ENDMARKER, 229 | }; 230 | 231 | enum VirtualServerProperties { 232 | VIRTUALSERVER_UNIQUE_IDENTIFIER = 0, ///< String. Read only. Unique identifier for a virtual server, does not 233 | ///< change on server restart. Available if \ref ts3client_getConnectionStatus 234 | ///< is >= \ref STATUS_CONNECTED. 235 | VIRTUALSERVER_NAME, ///< String. Read/Write. The virtual server display name. Available if \ref 236 | ///< ts3client_getConnectionStatus is >= \ref STATUS_CONNECTED. 237 | VIRTUALSERVER_WELCOMEMESSAGE, ///< String. Read/Write. The welcome message displayed to clients on connect. 238 | ///< Available if \ref ts3client_getConnectionStatus is >= \ref STATUS_CONNECTED. Not 239 | ///< updated automatically when changed, updates need to be requested (\ref 240 | ///< ts3client_requestServerVariables). 241 | VIRTUALSERVER_PLATFORM, ///< String. Read only. The operating system the server is running on. Available if \ref 242 | ///< ts3client_getConnectionStatus is >= \ref STATUS_CONNECTED. 243 | VIRTUALSERVER_VERSION, ///< String. Read only. The server software version string. Available if \ref 244 | ///< ts3client_getConnectionStatus is >= \ref STATUS_CONNECTED. 245 | VIRTUALSERVER_MAXCLIENTS, ///< UInt64. Read/Write. The maximum number of clients that can be connected 246 | ///< simultaneously. Only available on request (\ref ts3client_requestServerVariables). 247 | VIRTUALSERVER_PASSWORD, ///< String. Read/Write. The server password. Read access is limited to the server. Clients 248 | ///< will only get the password they supplied when connecting. Available if \ref 249 | ///< ts3client_getConnectionStatus is >= \ref STATUS_CONNECTED. 250 | VIRTUALSERVER_CLIENTS_ONLINE, ///< UInt64. Read only. The current number of clients connected to the server, 251 | ///< including query connections. Only available on request (\ref 252 | ///< ts3client_requestServerVariables). 253 | VIRTUALSERVER_CHANNELS_ONLINE, ///< UInt64. Read only. The current number of channels on the server. Only 254 | ///< available on request (\ref ts3client_requestServerVariables). 255 | VIRTUALSERVER_CREATED, ///< Integer. Read only. The time this virtual server was created as unix timestamp. 256 | ///< Available if \ref ts3client_getConnectionStatus is >= \ref STATUS_CONNECTED. 257 | VIRTUALSERVER_UPTIME, ///< UInt64. Read only. Number of seconds that have passed since the virtual server was 258 | ///< started. Only available on request (\ref ts3client_requestServerVariables). 259 | VIRTUALSERVER_CODEC_ENCRYPTION_MODE, ///< Integer. Read/Write. Boolean (1/0) that specifies if voice data is encrypted 260 | ///< during transfer. One of the values from the \ref CodecEncryptionMode enum. 261 | ///< Available if \ref ts3client_getConnectionStatus is >= \ref STATUS_CONNECTED. 262 | VIRTUALSERVER_ENCRYPTION_CIPHERS, ///< String. Read/Write. Comma separated list of available ciphers to encrypt the 263 | ///< connection. The server will use the first cipher in the list that is also 264 | ///< listed in the \ref CLIENT_ENCRYPTION_CIPHERS of the connecting client. 265 | ///< Clients will fail to connect if no match is found. Always available. 266 | VIRTUALSERVER_ENDMARKER, 267 | VIRTUALSERVER_FILEBASE = 24, ///< String. Read only. The path to the base directory used to store files 268 | ///< transferred using file transfer. Available only on the server. Is set by \ref 269 | ///< ts3server_enableFileManager 270 | VIRTUALSERVER_MAX_DOWNLOAD_TOTAL_BANDWIDTH = 29, ///< UInt64. Read/Write. Maximum traffic in bytes the server can 271 | ///< use for file transfer downloads. Only available on request 272 | ///< (\ref ts3client_requestServerVariables). 273 | VIRTUALSERVER_MAX_UPLOAD_TOTAL_BANDWIDTH = 30, ///< UInt64. Read/Write. Maximum traffic in bytes the server can use 274 | ///< for file transfer uploads. Only available on request (=> 275 | ///< requestServerVariables) 276 | VIRTUALSERVER_LOG_FILETRANSFER = 64 ///< Integer. Read/Write. Boolean (1/0) indicating whether to include file 277 | ///< transfer activities (uploading or downloading of files) in the server log. 278 | ///< Always available. 279 | }; 280 | 281 | /** 282 | * Various connection properties. 283 | * These are all read only, and except for your own client must be requested using \ref ts3client_requestConnectionInfo 284 | */ 285 | enum ConnectionProperties { 286 | CONNECTION_PING = 0, ///< UInt64. Round trip latency for the connection based on the last 5 seconds. On the server 287 | ///< this is the average across all connected clients for the last 5 seconds. 288 | CONNECTION_PING_DEVIATION, ///< Double. Standard deviation for the round trip latency in \ref CONNECTION_PING 289 | CONNECTION_CONNECTED_TIME, ///< UInt64. Seconds the client has been connected. 290 | CONNECTION_IDLE_TIME, ///< UInt64. Time in seconds since the last activity (voice transmission, switching channels, 291 | ///< changing mic / speaker mute status) of the client. 292 | CONNECTION_CLIENT_IP, ///< String. IP of this client (as seen from the server side) 293 | CONNECTION_CLIENT_PORT, ///< UInt64. Client side port of this client (as seen from the server side) 294 | CONNECTION_SERVER_IP, ///< String. The IP or hostname used to connect to the server. Only available on yourself. 295 | CONNECTION_SERVER_PORT, ///< UInt64. The server port connected to. Only available on yourself. 296 | CONNECTION_PACKETS_SENT_SPEECH, ///< UInt64. The number of voice packets transmitted by the client. 297 | CONNECTION_PACKETS_SENT_KEEPALIVE, ///< UInt64. The number of keep alive packets transmitted by the client. 298 | CONNECTION_PACKETS_SENT_CONTROL, ///< UInt64. The number of command & control packets transmitted by the client. 299 | CONNECTION_PACKETS_SENT_TOTAL, ///< UInt64. Total number of packets transmitted by the client. Equal to the sum of 300 | ///< \ref CONNECTION_PACKETS_SENT_SPEECH, \ref CONNECTION_PACKETS_SENT_KEEPALIVE and 301 | ///< \ref CONNECTION_PACKETS_SENT_CONTROL 302 | CONNECTION_BYTES_SENT_SPEECH, ///< UInt64. Outgoing traffic used for voice data by the client. 303 | CONNECTION_BYTES_SENT_KEEPALIVE, ///< UInt64. Outgoing traffic used for keeping the connection alive by the client. 304 | CONNECTION_BYTES_SENT_CONTROL, ///< UInt64. Outgoing traffic used for command & control data by the client. 305 | CONNECTION_BYTES_SENT_TOTAL, ///< UInt64. Total outgoing traffic to the server by this client. Equal to the sum of 306 | ///< \ref CONNECTION_BYTES_SENT_SPEECH, \ref CONNECTION_BYTES_SENT_KEEPALIVE and \ref 307 | ///< CONNECTION_BYTES_SENT_CONTROL 308 | CONNECTION_PACKETS_RECEIVED_SPEECH, ///< UInt64. Number of voice packets received by the client. 309 | CONNECTION_PACKETS_RECEIVED_KEEPALIVE, ///< UInt64. Number of keep alive packets received by the client. 310 | CONNECTION_PACKETS_RECEIVED_CONTROL, ///< UInt64. Number of command & control packets received by the client. 311 | CONNECTION_PACKETS_RECEIVED_TOTAL, ///< UInt64. Total number of packets received by the client. Equal to the sum of 312 | ///< \ref CONNECTION_PACKETS_RECEIVED_SPEECH, \ref 313 | ///< CONNECTION_PACKETS_RECEIVED_KEEPALIVE and \ref 314 | ///< CONNECTION_PACKETS_RECEIVED_CONTROL 315 | CONNECTION_BYTES_RECEIVED_SPEECH, ///< UInt64. Incoming traffic used by the client for voice data. 316 | CONNECTION_BYTES_RECEIVED_KEEPALIVE, ///< UInt64. Incoming traffic used by the client to keep the connection alive. 317 | CONNECTION_BYTES_RECEIVED_CONTROL, ///< UInt64. Incoming traffic used by the client for command & control data. 318 | CONNECTION_BYTES_RECEIVED_TOTAL, ///< UInt64. Total incoming traffic used by the client. Equal to the sum of \ref 319 | ///< CONNECTION_BYTES_RECEIVED_SPEECH, \ref CONNECTION_BYTES_RECEIVED_KEEPALIVE and 320 | ///< \ref CONNECTION_BYTES_RECEIVED_CONTROL 321 | CONNECTION_PACKETLOSS_SPEECH, ///< Double. Percentage points of voice packets for the client that did not arrive at 322 | ///< the client or server averaged across the last 5 seconds. 323 | CONNECTION_PACKETLOSS_KEEPALIVE, ///< Double. Percentage points of keep alive packets for the client that did not 324 | ///< arrive at the client or server averaged across the last 5 seconds. 325 | CONNECTION_PACKETLOSS_CONTROL, ///< Double. Percentage points of command & control packets for the client that did 326 | ///< not arrive at the client or server averaged across the last 5 seconds. 327 | CONNECTION_PACKETLOSS_TOTAL, ///< Double. Cumulative chance in percentage points with which a packet round trip 328 | ///< failed because a packet was lost 329 | CONNECTION_SERVER2CLIENT_PACKETLOSS_SPEECH, ///< Double. Probability with which a voice packet sent by the server 330 | ///< was not received by the client. 331 | CONNECTION_SERVER2CLIENT_PACKETLOSS_KEEPALIVE, ///< Double. Probability with which a keepalive packet sent by the 332 | ///< server was not received by the client. 333 | CONNECTION_SERVER2CLIENT_PACKETLOSS_CONTROL, ///< Double. Probability with which a control packet sent by the server 334 | ///< was not received by the client. 335 | CONNECTION_SERVER2CLIENT_PACKETLOSS_TOTAL, ///< Double. Probability with which a packet sent by the server was not 336 | ///< received by the client. 337 | CONNECTION_CLIENT2SERVER_PACKETLOSS_SPEECH, ///< Double. Probability with which a speech packet sent by the client 338 | ///< was not received by the server. 339 | CONNECTION_CLIENT2SERVER_PACKETLOSS_KEEPALIVE, ///< Double. Probability with which a keepalive packet sent by the 340 | ///< client was not received by the server. 341 | CONNECTION_CLIENT2SERVER_PACKETLOSS_CONTROL, ///< Double. Probability with which a control packet sent by the client 342 | ///< was not received by the server. 343 | CONNECTION_CLIENT2SERVER_PACKETLOSS_TOTAL, ///< Double. Probability with which a packet sent by the client was not 344 | ///< received by the server. 345 | CONNECTION_BANDWIDTH_SENT_LAST_SECOND_SPEECH, ///< UInt64. Number of bytes sent for speech data in the last second. 346 | CONNECTION_BANDWIDTH_SENT_LAST_SECOND_KEEPALIVE, ///< UInt64. Number of bytes sent for keepalive data in the last second. 347 | CONNECTION_BANDWIDTH_SENT_LAST_SECOND_CONTROL, ///< UInt64. Number of bytes sent for control data in the last second. 348 | CONNECTION_BANDWIDTH_SENT_LAST_SECOND_TOTAL, ///< UInt64. Number of bytes sent in the last second. 349 | CONNECTION_BANDWIDTH_SENT_LAST_MINUTE_SPEECH, ///< UInt64. Bytes per second sent for speech data, averaged over the 350 | ///< last minute. 351 | CONNECTION_BANDWIDTH_SENT_LAST_MINUTE_KEEPALIVE, ///< UInt64. Bytes per second sent for keepalive data, averaged 352 | ///< over the last minute. 353 | CONNECTION_BANDWIDTH_SENT_LAST_MINUTE_CONTROL, ///< UInt64. Bytes per second sent for control data, averaged over 354 | ///< the last minute. 355 | CONNECTION_BANDWIDTH_SENT_LAST_MINUTE_TOTAL, ///< UInt64. Bytes per second sent, averaged over the last minute. 356 | CONNECTION_BANDWIDTH_RECEIVED_LAST_SECOND_SPEECH, ///< UInt64. Number of bytes received for speech data in the last second. 357 | CONNECTION_BANDWIDTH_RECEIVED_LAST_SECOND_KEEPALIVE, ///< UInt64. Number of bytes received for keepalive data in the 358 | ///< last second. 359 | CONNECTION_BANDWIDTH_RECEIVED_LAST_SECOND_CONTROL, ///< UInt64. Number of bytes received for control data in the 360 | ///< last second. 361 | CONNECTION_BANDWIDTH_RECEIVED_LAST_SECOND_TOTAL, ///< UInt64. Number of bytes received in the last second. 362 | CONNECTION_BANDWIDTH_RECEIVED_LAST_MINUTE_SPEECH, ///< UInt64. Bytes per second received for speech data, averaged 363 | ///< over the last minute. 364 | CONNECTION_BANDWIDTH_RECEIVED_LAST_MINUTE_KEEPALIVE, ///< UInt64. Bytes per second received for keepalive data, 365 | ///< averaged over the last minute. 366 | CONNECTION_BANDWIDTH_RECEIVED_LAST_MINUTE_CONTROL, ///< UInt64. Bytes per second received for control data, averaged 367 | ///< over the last minute. 368 | CONNECTION_BANDWIDTH_RECEIVED_LAST_MINUTE_TOTAL, ///< UInt64. Bytes per second received, averaged over the last minute. 369 | CONNECTION_DUMMY_0, 370 | CONNECTION_DUMMY_1, 371 | CONNECTION_DUMMY_2, 372 | CONNECTION_DUMMY_3, 373 | CONNECTION_DUMMY_4, 374 | CONNECTION_DUMMY_5, 375 | CONNECTION_DUMMY_6, 376 | CONNECTION_DUMMY_7, 377 | CONNECTION_DUMMY_8, 378 | CONNECTION_DUMMY_9, 379 | CONNECTION_FILETRANSFER_BANDWIDTH_SENT, ///< UInt64. Current file transfer upstream activity in bytes per second. 380 | ///< Only available on request (\ref ts3client_requestServerConnectionInfo). 381 | CONNECTION_FILETRANSFER_BANDWIDTH_RECEIVED, ///< UInt64. Current file transfer downstream activity in bytes per 382 | ///< second. Only available on request (\ref 383 | ///< ts3client_requestServerConnectionInfo). 384 | CONNECTION_FILETRANSFER_BYTES_RECEIVED_TOTAL, ///< UInt64. Total downstream traffic, in bytes, used for file 385 | ///< transfer since the server was started. Only available on request 386 | ///< (\ref ts3client_requestServerConnectionInfo). 387 | CONNECTION_FILETRANSFER_BYTES_SENT_TOTAL, ///< UInt64. Total upstream traffic, in bytes, used for file transfer 388 | ///< since the server was started. Only available on request (\ref 389 | ///< ts3client_requestServerConnectionInfo). 390 | CONNECTION_ENDMARKER 391 | }; 392 | 393 | /** 394 | * Describes a client position in 3 dimensional space, used for 3D Sound. 395 | */ 396 | typedef struct { 397 | float x; ///< X co-ordinate in 3D space. 398 | float y; ///< Y co-ordinate in 3D space. 399 | float z; ///< Z co-ordinate in 3D space. 400 | } TS3_VECTOR; 401 | 402 | enum GroupWhisperType { 403 | GROUPWHISPERTYPE_SERVERGROUP = 0, ///< Whisper list consists of server groups 404 | GROUPWHISPERTYPE_CHANNELGROUP = 1, ///< Whisper list consists of channel groups 405 | GROUPWHISPERTYPE_CHANNELCOMMANDER = 2, ///< whisper to channel commanders 406 | GROUPWHISPERTYPE_ALLCLIENTS = 3, ///< whisper to all clients 407 | GROUPWHISPERTYPE_ENDMARKER, 408 | }; 409 | 410 | enum GroupWhisperTargetMode { 411 | GROUPWHISPERTARGETMODE_ALL = 0, 412 | GROUPWHISPERTARGETMODE_CURRENTCHANNEL = 1, ///< Whisper the current channel of the client 413 | GROUPWHISPERTARGETMODE_PARENTCHANNEL = 2, ///< Whisper the parent channel of whatever channel the client is currently in 414 | GROUPWHISPERTARGETMODE_ALLPARENTCHANNELS = 3, ///< Whipser to the parent channel and all their parent channels as well 415 | GROUPWHISPERTARGETMODE_CHANNELFAMILY = 4, ///< Whisper to the current channel and all its sub channels 416 | GROUPWHISPERTARGETMODE_ANCESTORCHANNELFAMILY = 5, ///< Whisper to the current channel, all its parent and sub channels. 417 | GROUPWHISPERTARGETMODE_SUBCHANNELS = 6, ///< Whisper to all sub channels of the current channel of the client 418 | GROUPWHISPERTARGETMODE_ENDMARKER, 419 | }; 420 | 421 | enum MonoSoundDestination { 422 | MONO_SOUND_DESTINATION_ALL = 0, ///< Send mono sound to all available speakers 423 | MONO_SOUND_DESTINATION_FRONT_CENTER = 1, ///< Send mono sound to front center speaker if available 424 | MONO_SOUND_DESTINATION_FRONT_LEFT_AND_RIGHT = 2 ///< Send mono sound to front left/right speakers if available 425 | }; 426 | 427 | enum SecuritySaltOptions { 428 | SECURITY_SALT_CHECK_NICKNAME = 1, ///< put nickname into security hash 429 | SECURITY_SALT_CHECK_META_DATA = 2 ///< put meta data into security hash 430 | }; 431 | 432 | /*this enum is used to disable client commands on the server*/ 433 | enum ClientCommand { 434 | CLIENT_COMMAND_requestConnectionInfo = 0, ///< disable client connection info request (client bandwidth usage, ip, 435 | ///< port, ping) 436 | CLIENT_COMMAND_requestClientMove = 1, ///< disable moving clients 437 | CLIENT_COMMAND_requestXXMuteClients = 2, ///< disable muting other clients 438 | CLIENT_COMMAND_requestClientKickFromXXX = 3, ///< disable kicking clients 439 | CLIENT_COMMAND_flushChannelCreation = 4, ///< disable creating channels 440 | CLIENT_COMMAND_flushChannelUpdates = 5, ///< disable editing channels 441 | CLIENT_COMMAND_requestChannelMove = 6, ///< disable moving channels 442 | CLIENT_COMMAND_requestChannelDelete = 7, ///< disable deleting channels 443 | CLIENT_COMMAND_requestChannelDescription = 8, ///< disable channel descriptions 444 | CLIENT_COMMAND_requestChannelXXSubscribeXXX = 9, ///< disable being able to see clients in channels other than the 445 | ///< current channel the client is in 446 | CLIENT_COMMAND_requestServerConnectionInfo = 10, ///< disable server connection info request (server bandwidth 447 | ///< usage, ip, port, ping) 448 | CLIENT_COMMAND_requestSendXXXTextMsg = 11, ///< disable text messaging 449 | CLIENT_COMMAND_filetransfers = 12, ///< disable file transfer 450 | CLIENT_COMMAND_ENDMARKER 451 | }; 452 | 453 | /* Access Control List*/ 454 | enum ACLType { ACL_NONE = 0, ACL_WHITE_LIST = 1, ACL_BLACK_LIST = 2 }; 455 | 456 | /* file transfer actions*/ 457 | enum FTAction { 458 | FT_INIT_SERVER = 0, ///< The virtual server is created. result->channelPath can be changed to create a different 459 | ///< directory than the default 'virtualserver_x' where x is the virtual server. 460 | FT_INIT_CHANNEL = 1, ///< A channel is created. result->channelPath can be changed to create a different directory 461 | ///< then the default 'channel_x' where x is the channel id. 462 | FT_UPLOAD = 2, ///< A file is being uploaded. All values in the result struct can be modified. 463 | FT_DOWNLOAD = 3, ///< A file is being downloaded. All values in the result struct can be modified. 464 | FT_DELETE = 4, ///< A file is being deleted. All values in the result struct can be modified. 465 | FT_CREATEDIR = 5, ///< A directory is being created in a channel. All values in the result struct can be modified. 466 | FT_RENAME = 6, ///< A file or folder is being renamed. The callback will be called twice! Once for the old and then 467 | ///< for the new name. All values in the result struct can be modified. 468 | FT_FILELIST = 7, ///< A directory listing is requested. All values in the result struct can be modified. 469 | FT_FILEINFO = 8 ///< Information of a file is requested. All values in the result struct can be modified. 470 | }; 471 | 472 | /* file transfer status */ 473 | enum FileTransferState { 474 | FILETRANSFER_INITIALISING = 0, ///< File transfer is establishing connection. 475 | FILETRANSFER_ACTIVE, ///< File transfer is in progress 476 | FILETRANSFER_FINISHED, ///< File transfer has finished 477 | }; 478 | 479 | /* file transfer types */ 480 | enum FileTransferType { 481 | FileListType_Directory = 0, ///< The file entry is a directory 482 | FileListType_File, ///< The file entry is a regular file 483 | }; 484 | 485 | /* some structs to handle variables in callbacks */ 486 | #define MAX_VARIABLES_EXPORT_COUNT 64 487 | struct VariablesExportItem { 488 | unsigned char itemIsValid; ///< Whether or not there is any data in this item. Ignore this item if this is 0. 489 | unsigned char proposedIsSet; ///< The value in proposed is set. If 0 ignore proposed 490 | const char* current; ///< current value (stored in memory) 491 | const char* proposed; ///< New value to change to (const, so no updates please) 492 | }; 493 | 494 | struct VariablesExport { 495 | struct VariablesExportItem items[MAX_VARIABLES_EXPORT_COUNT]; 496 | }; 497 | 498 | struct ClientMiniExport { 499 | anyID ID; ///< id of the client 500 | uint64 channel; ///< the channel the client is in 501 | const char* ident; ///< client public identity 502 | const char* nickname; ///< client display name 503 | }; 504 | 505 | /** 506 | * Structure used to describe a file transfer in the \ref ServerLibFunctions.onTransformFilePath callback. 507 | * This describes the original values, and also contains hints for length limitations of the result parameter 508 | * of the callback. 509 | * \verbatim embed:rst 510 | .. important:: 511 | Which values of the struct can be modified is defined by the action value of the original parameter. 512 | \endverbatim 513 | */ 514 | struct TransformFilePathExport { 515 | uint64 channel; ///< The channel id of the file. 0 if action is \ref FT_INIT_SERVER 516 | const char* filename; ///< utf8 encoded c string containing the original file name as intended by the client. 517 | int action; ///< The action to be performed. One of the values from the \ref FTAction enum. Defines which values of 518 | ///< the result struct can be modified. 519 | int transformedFileNameMaxSize; ///< The maximum length the file name can be rewritten to. 520 | int channelPathMaxSize; ///< The maximum length the path can be rewritten to. 521 | }; 522 | 523 | /** 524 | * Structure to rewrite the file transfer file name and path in the \ref ServerLibFunctions.onTransformFilePath callback. 525 | * The lengths are limited as described in the original parameter. 526 | * \verbatim embed:rst 527 | .. important:: 528 | Which values of the struct can be modified is defined by the action value of the original parameter. 529 | \endverbatim 530 | */ 531 | struct TransformFilePathExportReturns { 532 | char* transformedFileName; ///< pointer to target file name. Fill the memory pointed to with an utf8 encoded c string 533 | ///< containing the new file name. Limited to original->transformedFileNameMaxSize bytes. 534 | char* channelPath; ///< pointer to memory for new path. Fill the memory pointed to with an utf8 encoded c string 535 | ///< containing the new path. Limited to original->channelPathMaxSize bytes. 536 | int logFileAction; ///< boolean (1/0). Whether to log this file transfer to the log. Action is not logged regardless 537 | ///< of this value if the servers \ref VIRTUALSERVER_LOG_FILETRANSFER property is 0. 538 | }; 539 | 540 | struct FileTransferCallbackExport { 541 | anyID clientID; ///< the client who started the file transfer 542 | anyID transferID; ///< local identifier of the transfer that has completed 543 | anyID remoteTransferID; ///< remote identifier of the transfer that has completed 544 | unsigned int status; ///< status of the transfer. One of the values from the \ref FileTransferState enum 545 | const char* statusMessage; ///< utf8 encoded c string containing a human readable description of the status 546 | uint64 remotefileSize; ///< size in bytes of the complete file to be transferred 547 | uint64 bytes; ///< number of bytes transferred. Same as remotefileSize when the transfer completed entirely. 548 | int isSender; ///< boolean. 1 if the server is sending the file. 0 if the server is receiving the file. 549 | }; 550 | 551 | /*define for file transfer bandwith limits*/ 552 | #define BANDWIDTH_LIMIT_UNLIMITED 0xFFFFFFFFFFFFFFFFll 553 | 554 | /*defines for speaker locations used by some sound callbacks*/ 555 | #ifndef SPEAKER_FRONT_LEFT 556 | #define SPEAKER_FRONT_LEFT 0x1 557 | #define SPEAKER_FRONT_RIGHT 0x2 558 | #define SPEAKER_FRONT_CENTER 0x4 559 | #define SPEAKER_LOW_FREQUENCY 0x8 560 | #define SPEAKER_BACK_LEFT 0x10 561 | #define SPEAKER_BACK_RIGHT 0x20 562 | #define SPEAKER_FRONT_LEFT_OF_CENTER 0x40 563 | #define SPEAKER_FRONT_RIGHT_OF_CENTER 0x80 564 | #define SPEAKER_BACK_CENTER 0x100 565 | #define SPEAKER_SIDE_LEFT 0x200 566 | #define SPEAKER_SIDE_RIGHT 0x400 567 | #define SPEAKER_TOP_CENTER 0x800 568 | #define SPEAKER_TOP_FRONT_LEFT 0x1000 569 | #define SPEAKER_TOP_FRONT_CENTER 0x2000 570 | #define SPEAKER_TOP_FRONT_RIGHT 0x4000 571 | #define SPEAKER_TOP_BACK_LEFT 0x8000 572 | #define SPEAKER_TOP_BACK_CENTER 0x10000 573 | #define SPEAKER_TOP_BACK_RIGHT 0x20000 574 | #endif 575 | #define SPEAKER_HEADPHONES_LEFT 0x10000000 576 | #define SPEAKER_HEADPHONES_RIGHT 0x20000000 577 | #define SPEAKER_MONO 0x40000000 578 | 579 | #endif /*PUBLIC_DEFINITIONS_H*/ 580 | -------------------------------------------------------------------------------- /include/teamspeak/public_errors.h: -------------------------------------------------------------------------------- 1 | #ifndef PUBLIC_ERRORS_H 2 | #define PUBLIC_ERRORS_H 3 | 4 | //The idea here is: the values are 2 bytes wide, the first byte identifies the group, the second the count within that group 5 | 6 | enum Ts3ErrorType { 7 | //general 8 | ERROR_ok = 0x0000, ///< Indicates success. 9 | ERROR_undefined = 0x0001, 10 | ERROR_not_implemented = 0x0002, ///< The attempted operation is not available in this context 11 | ERROR_ok_no_update = 0x0003, ///< Indicates success, but no change occurred. Returned for example upon flushing (e.g. using \ref ts3client_flushChannelUpdates) when all indicated changes already matched the current state. 12 | ERROR_dont_notify = 0x0004, 13 | ERROR_lib_time_limit_reached = 0x0005, 14 | ERROR_out_of_memory = 0x0006, ///< Not enough system memory to perform operation 15 | ERROR_canceled = 0x0007, 16 | 17 | //dunno 18 | ERROR_command_not_found = 0x0100, 19 | ERROR_unable_to_bind_network_port = 0x0101, ///< Unspecified failure to create a listening port 20 | ERROR_no_network_port_available = 0x0102, ///< Failure to initialize a listening port for FileTransfer 21 | ERROR_port_already_in_use = 0x0103, ///< Specified port is already in use by a different application 22 | 23 | //client 24 | ERROR_client_invalid_id = 0x0200, ///< Client no longer connected 25 | ERROR_client_nickname_inuse = 0x0201, ///< Client name is already in use. Client names must be unique 26 | ERROR_client_protocol_limit_reached = 0x0203, ///< Too many clients on the server 27 | ERROR_client_invalid_type = 0x0204, ///< Function called for normal clients that is only available for query clients or vice versa 28 | ERROR_client_already_subscribed = 0x0205, ///< Attempting to subscribe to a channel already subscribed to 29 | ERROR_client_not_logged_in = 0x0206, 30 | ERROR_client_could_not_validate_identity = 0x0207, ///< Identity not valid or insufficient security level 31 | ERROR_client_invalid_password = 0x0208, 32 | ERROR_client_version_outdated = 0x020a, ///< Server requires newer client version as determined by the min_client_version properties 33 | ERROR_client_is_flooding = 0x020c, ///< Triggered flood protection. Further information is supplied in the extra message if applicable. 34 | ERROR_client_hacked = 0x020d, 35 | ERROR_client_cannot_verify_now = 0x020e, 36 | ERROR_client_login_not_permitted = 0x020f, 37 | ERROR_client_not_subscribed = 0x0210, ///< Action is only available on subscribed channels 38 | 39 | //channel 40 | ERROR_channel_invalid_id = 0x0300, ///< Channel does not exist on the server (any longer) 41 | ERROR_channel_protocol_limit_reached = 0x0301, ///< Too many channels on the server 42 | ERROR_channel_already_in = 0x0302, ///< Attempting to move a client or channel to its current channel 43 | ERROR_channel_name_inuse = 0x0303, ///< Channel name is already taken by another channel. Channel names must be unique 44 | ERROR_channel_not_empty = 0x0304, ///< Attempting to delete a channel with clients or sub channels in it 45 | ERROR_channel_can_not_delete_default = 0x0305, ///< Default channel cannot be deleted. Set a new default channel first (see \ref ts3client_setChannelVariableAsInt or \ref ts3server_setChannelVariableAsInt ) 46 | ERROR_channel_default_require_permanent = 0x0306, ///< Attempt to set a non permanent channel as default channel. Set channel to permanent first (see \ref ts3client_setChannelVariableAsInt or \ref ts3server_setChannelVariableAsInt ) 47 | ERROR_channel_invalid_flags = 0x0307, ///< Invalid combination of \ref ChannelProperties, trying to remove \ref CHANNEL_FLAG_DEFAULT or set a password on the default channel 48 | ERROR_channel_parent_not_permanent = 0x0308, ///< Attempt to move a permanent channel into a non-permanent one, or set a channel to be permanent that is a sub channel of a non-permanent one 49 | ERROR_channel_maxclients_reached = 0x0309, ///< Channel is full as determined by its \ref CHANNEL_MAXCLIENTS setting 50 | ERROR_channel_maxfamily_reached = 0x030a, ///< Channel tree is full as determined by its \ref CHANNEL_MAXFAMILYCLIENTS setting 51 | ERROR_channel_invalid_order = 0x030b, ///< Invalid value for the \ref CHANNEL_ORDER property. The specified channel must exist on the server and be on the same level. 52 | ERROR_channel_no_filetransfer_supported = 0x030c, ///< Invalid \ref CHANNEL_FILEPATH set for the channel 53 | ERROR_channel_invalid_password = 0x030d, ///< Channel has a password not matching the password supplied in the call 54 | // used in public_rare_errors = 0x030e, 55 | ERROR_channel_invalid_security_hash = 0x030f, 56 | 57 | //server 58 | ERROR_server_invalid_id = 0x0400, ///< Chosen virtual server does not exist or is offline 59 | ERROR_server_running = 0x0401, ///< attempting to delete a server that is running. Stop the server before deleting it. 60 | ERROR_server_is_shutting_down = 0x0402, ///< Client disconnected because the server is going offline 61 | ERROR_server_maxclients_reached = 0x0403, ///< Given in the onConnectStatusChange event when the server has reached its maximum number of clients as defined by the \ref VIRTUALSERVER_MAXCLIENTS property 62 | ERROR_server_invalid_password = 0x0404, ///< Specified server password is wrong. Provide the correct password in the \ref ts3client_startConnection / \ref ts3client_startConnectionWithChannelID call. 63 | ERROR_server_is_virtual = 0x0407, ///< Server is in virtual status. The attempted action is not possible in this state. Start the virtual server first. 64 | ERROR_server_is_not_running = 0x0409, ///< Attempting to stop a server that is not online. 65 | ERROR_server_is_booting = 0x040a, // Not used 66 | ERROR_server_status_invalid = 0x040b, 67 | ERROR_server_version_outdated = 0x040d, ///< Attempt to connect to an outdated server version. The server needs to be updated. 68 | ERROR_server_duplicate_running = 0x040e, ///< This server is already running within the instance. Each virtual server may only exist once. 69 | 70 | //parameter 71 | ERROR_parameter_quote = 0x0600, // Not used 72 | ERROR_parameter_invalid_count = 0x0601, ///< Attempt to flush changes without previously calling set*VariableAs* since the last flush 73 | ERROR_parameter_invalid = 0x0602, ///< At least one of the supplied parameters did not meet the criteria for that parameter 74 | ERROR_parameter_not_found = 0x0603, ///< Failure to supply all the necessary parameters 75 | ERROR_parameter_convert = 0x0604, ///< Invalid type supplied for a parameter, such as passing a string (ie. "five") that expects a number. 76 | ERROR_parameter_invalid_size = 0x0605, ///< Value out of allowed range. Such as strings are too long/short or numeric values outside allowed range 77 | ERROR_parameter_missing = 0x0606, ///< Neglecting to specify a required parameter 78 | ERROR_parameter_checksum = 0x0607, ///< Attempting to deploy a modified snapshot 79 | 80 | //unsorted, need further investigation 81 | ERROR_vs_critical = 0x0700, ///< Failure to create default channel 82 | ERROR_connection_lost = 0x0701, ///< Generic error with the connection. 83 | ERROR_not_connected = 0x0702, ///< Attempting to call functions with a serverConnectionHandler that is not connected. You can use \ref ts3client_getConnectionStatus to check whether the connection handler is connected to a server 84 | ERROR_no_cached_connection_info = 0x0703, ///< Attempting to query connection information (bandwidth usage, ping, etc) without requesting them first using \ref ts3client_requestConnectionInfo 85 | ERROR_currently_not_possible = 0x0704, ///< Requested information is not currently available. You may have to call \ref ts3client_requestClientVariables or \ref ts3client_requestServerVariables 86 | ERROR_failed_connection_initialisation = 0x0705, ///< No TeamSpeak server running on the specified IP address and port 87 | ERROR_could_not_resolve_hostname = 0x0706, ///< Failure to resolve the specified hostname to an IP address 88 | ERROR_invalid_server_connection_handler_id = 0x0707, ///< Attempting to perform actions on a non-existent server connection handler 89 | ERROR_could_not_initialise_input_manager = 0x0708, // Not used 90 | ERROR_clientlibrary_not_initialised = 0x0709, ///< Calling client library functions without successfully calling \ref ts3client_initClientLib before 91 | ERROR_serverlibrary_not_initialised = 0x070a, ///< Calling server library functions without successfully calling \ref ts3server_initServerLib before 92 | ERROR_whisper_too_many_targets = 0x070b, ///< Using a whisper list that contain more clients than the servers \ref VIRTUALSERVER_MIN_CLIENTS_IN_CHANNEL_BEFORE_FORCED_SILENCE property 93 | ERROR_whisper_no_targets = 0x070c, ///< The active whisper list is empty or no clients matched the whisper list (e.g. all channels in the list are empty) 94 | ERROR_connection_ip_protocol_missing = 0x070d, ///< Invalid or unsupported protocol (e.g. attempting an IPv6 connection on an IPv4 only machine) 95 | ERROR_handshake_failed = 0x070e, 96 | ERROR_illegal_server_license = 0x070f, 97 | 98 | //file transfer 99 | ERROR_file_invalid_name = 0x0800, ///< Invalid UTF8 string or not a valid file 100 | ERROR_file_invalid_permissions = 0x0801, ///< Permissions prevent opening the file 101 | ERROR_file_already_exists = 0x0802, ///< Target path already exists as a directory 102 | ERROR_file_not_found = 0x0803, ///< Attempt to access or move non existing file 103 | ERROR_file_io_error = 0x0804, ///< Generic file input / output error 104 | ERROR_file_invalid_transfer_id = 0x0805, ///< Attempt to get information about a file transfer after it has already been cleaned up. File transfer information is not available indefinitely after the transfer completed 105 | ERROR_file_invalid_path = 0x0806, ///< specified path contains invalid characters or does not start with "/" 106 | ERROR_file_no_files_available = 0x0807, // Not used 107 | ERROR_file_overwrite_excludes_resume = 0x0808, ///< File overwrite and resume are mutually exclusive. Only one or neither can be 1. 108 | ERROR_file_invalid_size = 0x0809, ///< Attempt to write more bytes than claimed file size. 109 | ERROR_file_already_in_use = 0x080a, ///< File is currently not available, try again later. 110 | ERROR_file_could_not_open_connection = 0x080b, ///< Generic failure in file transfer connection / other party did not conform to file transfer protocol 111 | ERROR_file_no_space_left_on_device = 0x080c, ///< Operating system reports hard disk is full. May be caused by quota limitations. 112 | ERROR_file_exceeds_file_system_maximum_size = 0x080d, ///< File is too large for the file system of the target device. 113 | ERROR_file_transfer_connection_timeout = 0x080e, // Not used 114 | ERROR_file_connection_lost = 0x080f, ///< File input / output timeout or connection failure 115 | ERROR_file_exceeds_supplied_size = 0x0810, // Not used 116 | ERROR_file_transfer_complete = 0x0811, ///< Indicates successful completion 117 | ERROR_file_transfer_canceled = 0x0812, ///< Transfer was cancelled through @ref ts3client_haltTransfer 118 | ERROR_file_transfer_interrupted = 0x0813, ///< Transfer failed because the server is shutting down, or network connection issues 119 | ERROR_file_transfer_server_quota_exceeded = 0x0814, ///< Transfer terminated due to server bandwidth quota being exceeded. No client can transfer files. 120 | ERROR_file_transfer_client_quota_exceeded = 0x0815, ///< Attempt to transfer more data than allowed by this clients' bandwidth quota. Other clients may continue to transfer files. 121 | ERROR_file_transfer_reset = 0x0816, // Not used 122 | ERROR_file_transfer_limit_reached = 0x0817, ///< Too many file transfers are in progress. Try again later 123 | ERROR_file_invalid_storage_class = 0x0818, // TODO: Invalid storage class for HTTP FileTransfer (what is a storage class?) 124 | ERROR_file_invalid_dimension = 0x0819, ///< Avatar image exceeds maximum width or height accepted by the server. 125 | ERROR_file_transfer_channel_quota_exceeded = 0x081a, ///< Transfer failed because the channel quota was exceeded. Uploading to this channel is not possible, but other channels may be fine. 126 | 127 | //sound 128 | ERROR_sound_preprocessor_disabled = 0x0900, ///< Cannot set or query pre processor variables with preprocessing disabled 129 | ERROR_sound_internal_preprocessor = 0x0901, 130 | ERROR_sound_internal_encoder = 0x0902, 131 | ERROR_sound_internal_playback = 0x0903, 132 | ERROR_sound_no_capture_device_available = 0x0904, ///< No audio capture devices are available 133 | ERROR_sound_no_playback_device_available = 0x0905, ///< No audio playback devices are available 134 | ERROR_sound_could_not_open_capture_device = 0x0906, ///< Error accessing audio device, or audio device does not support the requested mode 135 | ERROR_sound_could_not_open_playback_device = 0x0907, ///< Error accessing audio device, or audio device does not support the requested mode 136 | ERROR_sound_handler_has_device = 0x0908, ///< Attempt to open a sound device on a connection handler which already has an open device. Close the already open device first using \ref ts3client_closeCaptureDevice or \ref ts3client_closePlaybackDevice 137 | ERROR_sound_invalid_capture_device = 0x0909, ///< Attempt to use a device for capture that does not support capturing audio 138 | ERROR_sound_invalid_playback_device = 0x090a, ///< Attempt to use a device for playback that does not support playback of audio 139 | ERROR_sound_invalid_wave = 0x090b, ///< Attempt to use a non WAV file in \ref ts3client_playWaveFile or \ref ts3client_playWaveFileHandle 140 | ERROR_sound_unsupported_wave = 0x090c, ///< Unsupported wave file used in \ref ts3client_playWaveFile or \ref ts3client_playWaveFileHandle. 141 | ERROR_sound_open_wave = 0x090d, ///< Failure to open the specified sound file 142 | ERROR_sound_internal_capture = 0x090e, 143 | ERROR_sound_device_in_use = 0x090f, ///< Attempt to unregister a custom device that is being used. Close the device first using \ref ts3client_closeCaptureDevice or \ref ts3client_closePlaybackDevice 144 | ERROR_sound_device_already_registerred = 0x0910, ///< Attempt to register a custom device with a device id that has already been used in a previous call. Device ids must be unique. 145 | ERROR_sound_unknown_device = 0x0911, ///< Attempt to open, close, unregister or use a device which is not known. Custom devices must be registered before being used (see \ref ts3client_registerCustomDevice) 146 | ERROR_sound_unsupported_frequency = 0x0912, 147 | ERROR_sound_invalid_channel_count = 0x0913, ///< Invalid device audio channel count, must be > 0 148 | ERROR_sound_read_wave = 0x0914, ///< Failure to read sound samples from an opened wave file. Is this a valid wave file? 149 | ERROR_sound_need_more_data = 0x0915, // for internal purposes only 150 | ERROR_sound_device_busy = 0x0916, // for internal purposes only 151 | ERROR_sound_no_data = 0x0917, ///< Indicates there is currently no data for playback, e.g. nobody is speaking right now. 152 | ERROR_sound_channel_mask_mismatch = 0x0918, ///< Opening a device with an unsupported channel count 153 | 154 | //permissions 155 | ERROR_permissions_client_insufficient = 0x0a08, ///< Not enough permissions to perform the requested activity 156 | ERROR_permissions = 0x0a0c, ///< Permissions to use sound device not granted by operating system, e.g. Windows denied microphone access. 157 | 158 | //accounting 159 | ERROR_accounting_virtualserver_limit_reached = 0x0b00, ///< Attempt to use more virtual servers than allowed by the license 160 | ERROR_accounting_slot_limit_reached = 0x0b01, ///< Attempt to set more slots than allowed by the license 161 | ERROR_accounting_license_file_not_found = 0x0b02, // Not used 162 | ERROR_accounting_license_date_not_ok = 0x0b03, ///< License expired or not valid yet 163 | ERROR_accounting_unable_to_connect_to_server = 0x0b04, ///< Failure to communicate with accounting backend 164 | ERROR_accounting_unknown_error = 0x0b05, ///< Failure to write update license file 165 | ERROR_accounting_server_error = 0x0b06, // Not used 166 | ERROR_accounting_instance_limit_reached = 0x0b07, ///< More than one process of the server is running 167 | ERROR_accounting_instance_check_error = 0x0b08, ///< Shared memory access failure. 168 | ERROR_accounting_license_file_invalid = 0x0b09, ///< License is not a TeamSpeak license 169 | ERROR_accounting_running_elsewhere = 0x0b0a, ///< A copy of this server is already running in another instance. Each server may only exist once. 170 | ERROR_accounting_instance_duplicated = 0x0b0b, ///< A copy of this server is running already in this process. Each server may only exist once. 171 | ERROR_accounting_already_started = 0x0b0c, ///< Attempt to start a server that is already running 172 | ERROR_accounting_not_started = 0x0b0d, 173 | ERROR_accounting_to_many_starts = 0x0b0e, ///< Starting instance / virtual servers too often in too short a time period 174 | 175 | //provisioning server 176 | /// @cond HAS_PROVISIONING 177 | ERROR_provisioning_invalid_password = 0x1100, 178 | ERROR_provisioning_invalid_request = 0x1101, 179 | ERROR_provisioning_no_slots_available = 0x1102, 180 | ERROR_provisioning_pool_missing = 0x1103, 181 | ERROR_provisioning_pool_unknown = 0x1104, 182 | ERROR_provisioning_unknown_ip_location = 0x1105, 183 | ERROR_provisioning_internal_tries_exceeded = 0x1106, 184 | ERROR_provisioning_too_many_slots_requested = 0x1107, 185 | ERROR_provisioning_too_many_reserved = 0x1108, 186 | ERROR_provisioning_could_not_connect = 0x1109, 187 | ERROR_provisioning_auth_server_not_connected = 0x1110, 188 | ERROR_provisioning_auth_data_too_large = 0x1111, 189 | ERROR_provisioning_already_initialized = 0x1112, 190 | ERROR_provisioning_not_initialized = 0x1113, 191 | ERROR_provisioning_connecting = 0x1114, 192 | ERROR_provisioning_already_connected = 0x1115, 193 | ERROR_provisioning_not_connected = 0x1116, 194 | ERROR_provisioning_io_error = 0x1117, 195 | ERROR_provisioning_invalid_timeout = 0x1118, 196 | ERROR_provisioning_ts3server_not_found = 0x1119, 197 | ERROR_provisioning_no_permission = 0x111A, 198 | /// @endcond 199 | }; 200 | #endif 201 | -------------------------------------------------------------------------------- /include/teamspeak/public_errors_rare.h: -------------------------------------------------------------------------------- 1 | #ifndef PUBLIC_ERRORS__RARE_H 2 | #define PUBLIC_ERRORS__RARE_H 3 | 4 | //The idea here is: the values are 2 bytes wide, the first byte identifies the group, the second the count within that group 5 | 6 | enum Ts3RareErrorType { 7 | //client 8 | ERROR_client_too_many_clones_connected = 0x0209, 9 | ERROR_client_is_online = 0x020b, 10 | 11 | //channel 12 | ERROR_channel_is_private_channel = 0x030e, 13 | //note 0x030f is defined in public_errors; 14 | 15 | //database 16 | ERROR_database = 0x0500, 17 | ERROR_database_empty_result = 0x0501, 18 | ERROR_database_duplicate_entry = 0x0502, 19 | ERROR_database_no_modifications = 0x0503, 20 | ERROR_database_constraint = 0x0504, 21 | ERROR_database_reinvoke = 0x0505, 22 | 23 | //permissions 24 | ERROR_permission_invalid_group_id = 0x0a00, 25 | ERROR_permission_duplicate_entry = 0x0a01, 26 | ERROR_permission_invalid_perm_id = 0x0a02, 27 | ERROR_permission_empty_result = 0x0a03, 28 | ERROR_permission_default_group_forbidden = 0x0a04, 29 | ERROR_permission_invalid_size = 0x0a05, 30 | ERROR_permission_invalid_value = 0x0a06, 31 | ERROR_permissions_group_not_empty = 0x0a07, 32 | ERROR_permissions_insufficient_group_power = 0x0a09, 33 | ERROR_permissions_insufficient_permission_power = 0x0a0a, 34 | ERROR_permission_template_group_is_used = 0x0a0b, 35 | //0x0a0c is in public_errors.h 36 | ERROR_permission_used_by_integration = 0x0a0d, 37 | 38 | //server 39 | ERROR_server_deployment_active = 0x0405, 40 | ERROR_server_unable_to_stop_own_server = 0x0406, 41 | ERROR_server_wrong_machineid = 0x0408, 42 | ERROR_server_modal_quit = 0x040c, 43 | ERROR_server_time_difference_too_large = 0x040f, 44 | ERROR_server_blacklisted = 0x0410, 45 | ERROR_server_shutdown = 0x0411, 46 | 47 | //messages 48 | ERROR_message_invalid_id = 0x0c00, 49 | 50 | //ban 51 | ERROR_ban_invalid_id = 0x0d00, 52 | ERROR_connect_failed_banned = 0x0d01, 53 | ERROR_rename_failed_banned = 0x0d02, 54 | ERROR_ban_flooding = 0x0d03, 55 | 56 | //tts 57 | ERROR_tts_unable_to_initialize = 0x0e00, 58 | 59 | //privilege key 60 | ERROR_privilege_key_invalid = 0x0f00, 61 | 62 | //voip 63 | ERROR_voip_pjsua = 0x1000, 64 | ERROR_voip_already_initialized = 0x1001, 65 | ERROR_voip_too_many_accounts = 0x1002, 66 | ERROR_voip_invalid_account = 0x1003, 67 | ERROR_voip_internal_error = 0x1004, 68 | ERROR_voip_invalid_connectionId = 0x1005, 69 | ERROR_voip_cannot_answer_initiated_call = 0x1006, 70 | ERROR_voip_not_initialized = 0x1007, 71 | 72 | //mytsid - client 73 | ERROR_invalid_mytsid_data = 0x1200, 74 | ERROR_invalid_integration = 0x1201, 75 | ERROR_mytsid_needed = 0x1202, 76 | 77 | //ed25519 78 | ERROR_ed25519_rng_fail = 0x1300, 79 | ERROR_ed25519_signature_invalid = 0x1301, 80 | ERROR_ed25519_invalid_key = 0x1302, 81 | ERROR_ed25519_unable_to_create_valid_key = 0x1303, 82 | ERROR_ed25519_out_of_memory = 0x1304, 83 | ERROR_ed25519_exists = 0x1305, 84 | ERROR_ed25519_read_beyond_eof = 0x1306, 85 | ERROR_ed25519_write_beyond_eof = 0x1307, 86 | ERROR_ed25519_version = 0x1308, 87 | ERROR_ed25519_invalid = 0x1309, 88 | ERROR_ed25519_invalid_date = 0x130A, 89 | ERROR_ed25519_unauthorized = 0x130B, 90 | ERROR_ed25519_invalid_type = 0x130C, 91 | ERROR_ed25519_address_nomatch = 0x130D, 92 | ERROR_ed25519_not_valid_yet = 0x130E, 93 | ERROR_ed25519_expired = 0x130F, 94 | ERROR_ed25519_index_out_of_range = 0x1310, 95 | ERROR_ed25519_invalid_size = 0x1311, 96 | 97 | //api key 98 | ERROR_apikey_outofscope = 0x1400, 99 | ERROR_apikey_crypto_error = 0x1401, 100 | ERROR_apikey_invalid = 0x1402, 101 | ERROR_apikey_invalid_id = 0x1403, 102 | ERROR_apikey_missing = 0x1404, 103 | 104 | //homebase 105 | ERROR_homebase_no_slots_available = 0x1500, 106 | }; 107 | 108 | #endif 109 | -------------------------------------------------------------------------------- /include/teamspeak/public_rare_definitions.h: -------------------------------------------------------------------------------- 1 | #ifndef PUBLIC_RARE_DEFINITIONS_H 2 | #define PUBLIC_RARE_DEFINITIONS_H 3 | 4 | #include "public_definitions.h" 5 | 6 | //limited length, measured in characters 7 | #define TS3_MAX_SIZE_CLIENT_NICKNAME_NONSDK 30 8 | #define TS3_MIN_SIZE_CLIENT_NICKNAME_NONSDK 3 9 | #define TS3_MAX_SIZE_AWAY_MESSAGE 80 10 | #define TS3_MAX_SIZE_GROUP_NAME 30 11 | #define TS3_MAX_SIZE_TALK_REQUEST_MESSAGE 50 12 | #define TS3_MAX_SIZE_COMPLAIN_MESSAGE 200 13 | #define TS3_MAX_SIZE_CLIENT_DESCRIPTION 200 14 | #define TS3_MAX_SIZE_HOST_MESSAGE 200 15 | #define TS3_MAX_SIZE_HOSTBUTTON_TOOLTIP 50 16 | #define TS3_MAX_SIZE_POKE_MESSAGE 100 17 | #define TS3_MAX_SIZE_OFFLINE_MESSAGE 4096 18 | #define TS3_MAX_SIZE_OFFLINE_MESSAGE_SUBJECT 200 19 | #define TS3_MAX_SIZE_USER_TAG 100 20 | 21 | //limited length, measured in bytes (utf8 encoded) 22 | #define TS3_MAX_SIZE_PLUGIN_COMMAND 1024 * 8 23 | #define TS3_MAX_SIZE_VIRTUALSERVER_HOSTBANNER_GFX_URL 2000 24 | 25 | enum GroupShowNameTreeMode { 26 | GroupShowNameTreeMode_NONE = 0, //dont group show name 27 | GroupShowNameTreeMode_BEFORE, //show group name before client name 28 | GroupShowNameTreeMode_BEHIND //show group name behind client name 29 | }; 30 | 31 | enum PluginTargetMode { 32 | PluginCommandTarget_CURRENT_CHANNEL = 0, //send plugincmd to all clients in current channel 33 | PluginCommandTarget_SERVER, //send plugincmd to all clients on server 34 | PluginCommandTarget_CLIENT, //send plugincmd to all given client ids 35 | PluginCommandTarget_CURRENT_CHANNEL_SUBSCRIBED_CLIENTS, //send plugincmd to all subscribed clients in current channel 36 | PluginCommandTarget_MAX 37 | }; 38 | 39 | enum { 40 | SERVER_BINDING_VIRTUALSERVER = 0, 41 | SERVER_BINDING_SERVERQUERY = 1, 42 | SERVER_BINDING_FILETRANSFER = 2, 43 | }; 44 | 45 | enum HostMessageMode { 46 | HostMessageMode_NONE = 0, //dont display anything 47 | HostMessageMode_LOG, //display message inside log 48 | HostMessageMode_MODAL, //display message inside a modal dialog 49 | HostMessageMode_MODALQUIT //display message inside a modal dialog and quit/close server/connection 50 | }; 51 | 52 | enum HostBannerMode { 53 | HostBannerMode_NO_ADJUST = 0, //Do not adjust 54 | HostBannerMode_ADJUST_IGNORE_ASPECT, //Adjust but ignore aspect ratio 55 | HostBannerMode_ADJUST_KEEP_ASPECT, //Adjust and keep aspect ratio 56 | }; 57 | 58 | enum ClientType { 59 | ClientType_NORMAL = 0, 60 | ClientType_SERVERQUERY, 61 | }; 62 | 63 | enum AwayStatus { 64 | AWAY_NONE = 0, 65 | AWAY_ZZZ, 66 | }; 67 | 68 | enum CommandLinePropertiesRare { 69 | #ifdef SERVER 70 | COMMANDLINE_CREATE_DEFAULT_VIRTUALSERVER = 0, //create default virtualserver 71 | COMMANDLINE_MACHINE_ID, //machine id (starts only virtualserver with given machineID 72 | COMMANDLINE_DEFAULT_VOICE_PORT, 73 | COMMANDLINE_VOICE_IP, 74 | COMMANDLINE_THREADS_VOICE_UDP, 75 | COMMANDLINE_LICENSEPATH, 76 | COMMANDLINE_YAMLFILE, 77 | #ifndef TEAMSPEAK_SDK 78 | COMMANDLINE_FILETRANSFER_PORT, 79 | COMMANDLINE_FILETRANSFER_IP, 80 | COMMANDLINE_QUERY_PORT, 81 | COMMANDLINE_QUERY_IP, 82 | COMMANDLINE_QUERY_IP_ALLOWLIST, 83 | COMMANDLINE_QUERY_IP_DENYLIST, 84 | COMMANDLINE_CLEAR_DATABASE, 85 | COMMANDLINE_SERVERADMIN_PASSWORD, 86 | COMMANDLINE_DBPLUGIN, 87 | COMMANDLINE_DBPLUGINPARAMETER, 88 | COMMANDLINE_DBSQLPATH, 89 | COMMANDLINE_DBSQLCREATEPATH, 90 | COMMANDLINE_DBCONNECTIONS, 91 | COMMANDLINE_LOGPATH, 92 | COMMANDLINE_CREATEINIFILE, 93 | COMMANDLINE_INIFILE, 94 | COMMANDLINE_LOGQUERYCOMMANDS, 95 | COMMANDLINE_DBCLIENTKEEPDAYS, 96 | COMMANDLINE_NO_PERMISSION_UPDATE, 97 | COMMANDLINE_OPEN_WIN_CONSOLE, 98 | COMMANDLINE_NO_PASSWORD_DIALOG, 99 | COMMANDLINE_LOGAPPEND, 100 | COMMANDLINE_QUERY_SKIPBRUTEFORCECHECK, 101 | COMMANDLINE_QUERY_BUFFER_MB, 102 | #endif 103 | COMMANDLINE_HTTP_PROXY, 104 | #ifndef TEAMSPEAK_SDK 105 | COMMANDLINE_LICENSE_ACCEPTED, 106 | COMMANDLINE_SERVERQUERYDOCS_PATH, 107 | COMMANDLINE_QUERY_SSH_IP, 108 | COMMANDLINE_QUERY_SSH_PORT, 109 | COMMANDLINE_QUERY_PROTOCOLS, 110 | COMMANDLINE_QUERY_SSH_RSA_HOST_KEY, 111 | COMMANDLINE_QUERY_TIMEOUT, 112 | COMMANDLINE_VERSION, 113 | COMMANDLINE_CRASHDUMPSPATH, 114 | COMMANDLINE_DAEMON, 115 | COMMANDLINE_PID_FILE, 116 | COMMANDLINE_HINTS_ENABLED, 117 | COMMANDLINE_QUERY_HTTP_IP, 118 | COMMANDLINE_QUERY_HTTP_PORT, 119 | COMMANDLINE_QUERY_HTTPS_IP, 120 | COMMANDLINE_QUERY_HTTPS_PORT, 121 | COMMANDLINE_QUERY_HTTPS_CERTIFICATE_FILE, 122 | COMMANDLINE_QUERY_HTTPS_PRIVATE_KEY_FILE, 123 | COMMANDLINE_QUERY_POOL_SIZE, 124 | COMMANDLINE_MMDBPATH, 125 | COMMANDLINE_LOGQUERYTIMINGINTERVAL, 126 | COMMANDLINE_EVENT_TO_DB_LOGGING, 127 | COMMANDLINE_ADMINISTRATIVE_DOMAIN, 128 | #endif 129 | COMMANDLINE_WEBRTC_SERVER_ENABLED, 130 | #else 131 | COMMANDLINE_NOTHING = 0, 132 | #endif 133 | COMMANDLINE_ENDMARKER_RARE, 134 | }; 135 | 136 | enum ServerInstancePropertiesRare { 137 | SERVERINSTANCE_DATABASE_VERSION = 0, 138 | SERVERINSTANCE_FILETRANSFER_PORT, 139 | SERVERINSTANCE_SERVER_ENTROPY, 140 | SERVERINSTANCE_MONTHLY_TIMESTAMP, 141 | SERVERINSTANCE_MAX_DOWNLOAD_TOTAL_BANDWIDTH, 142 | SERVERINSTANCE_MAX_UPLOAD_TOTAL_BANDWIDTH, 143 | SERVERINSTANCE_GUEST_SERVERQUERY_GROUP, 144 | SERVERINSTANCE_SERVERQUERY_FLOOD_COMMANDS, //how many commands we can issue while in the SERVERINSTANCE_SERVERQUERY_FLOOD_TIME window 145 | SERVERINSTANCE_SERVERQUERY_FLOOD_TIME, //time window in seconds for max command execution check 146 | SERVERINSTANCE_SERVERQUERY_BAN_TIME, //how many seconds someone get banned if he floods 147 | SERVERINSTANCE_TEMPLATE_SERVERADMIN_GROUP, 148 | SERVERINSTANCE_TEMPLATE_SERVERDEFAULT_GROUP, 149 | SERVERINSTANCE_TEMPLATE_CHANNELADMIN_GROUP, 150 | SERVERINSTANCE_TEMPLATE_CHANNELDEFAULT_GROUP, 151 | SERVERINSTANCE_PERMISSIONS_VERSION, 152 | SERVERINSTANCE_PENDING_CONNECTIONS_PER_IP, 153 | SERVERINSTANCE_SERVERQUERY_MAX_CONNECTIONS_PER_IP, 154 | SERVERINSTANCE_MAX_HOMEBASES, //How many matrix homebase users this instance can have. -1 for no limit 155 | SERVERINSTANCE_ENDMARKER_RARE, 156 | }; 157 | 158 | enum VirtualServerPropertiesRare { 159 | VIRTUALSERVER_DUMMY_1 = VIRTUALSERVER_ENDMARKER, 160 | VIRTUALSERVER_DUMMY_2, 161 | VIRTUALSERVER_DUMMY_3, 162 | VIRTUALSERVER_DUMMY_4, 163 | VIRTUALSERVER_DUMMY_5, 164 | VIRTUALSERVER_DUMMY_6, 165 | VIRTUALSERVER_DUMMY_7, 166 | VIRTUALSERVER_DUMMY_8, 167 | VIRTUALSERVER_KEYPAIR, //internal use 168 | VIRTUALSERVER_HOSTMESSAGE, //available when connected, not updated while connected 169 | VIRTUALSERVER_HOSTMESSAGE_MODE, //available when connected, not updated while connected 170 | // VIRTUALSERVER_FILEBASE, // Moved to VirtualServerProperties due to SDK usage 171 | VIRTUALSERVER_DEFAULT_SERVER_GROUP = 25, //the client permissions server group that a new client gets assigned 172 | VIRTUALSERVER_DEFAULT_CHANNEL_GROUP, //the channel permissions group that a new client gets assigned when joining a channel 173 | VIRTUALSERVER_FLAG_PASSWORD, //only available on request (=> requestServerVariables) 174 | VIRTUALSERVER_DEFAULT_CHANNEL_ADMIN_GROUP, //the channel permissions group that a client gets assigned when creating a channel 175 | // VIRTUALSERVER_MAX_DOWNLOAD_TOTAL_BANDWIDTH, // Moved to VirtualServerProperties due to SDK usage 176 | // VIRTUALSERVER_MAX_UPLOAD_TOTAL_BANDWIDTH, // Moved to VirtualServerProperties due to SDK usage 177 | VIRTUALSERVER_HOSTBANNER_URL = 31, //available when connected, always up-to-date 178 | VIRTUALSERVER_HOSTBANNER_GFX_URL, //available when connected, always up-to-date 179 | VIRTUALSERVER_HOSTBANNER_GFX_INTERVAL, //available when connected, always up-to-date 180 | VIRTUALSERVER_COMPLAIN_AUTOBAN_COUNT, //only available on request (=> requestServerVariables) 181 | VIRTUALSERVER_COMPLAIN_AUTOBAN_TIME, //only available on request (=> requestServerVariables) 182 | VIRTUALSERVER_COMPLAIN_REMOVE_TIME, //only available on request (=> requestServerVariables) 183 | VIRTUALSERVER_MIN_CLIENTS_IN_CHANNEL_BEFORE_FORCED_SILENCE, //only available on request (=> requestServerVariables) 184 | VIRTUALSERVER_PRIORITY_SPEAKER_DIMM_MODIFICATOR, //available when connected, always up-to-date 185 | VIRTUALSERVER_ID, //available when connected 186 | VIRTUALSERVER_ANTIFLOOD_POINTS_TICK_REDUCE, //only available on request (=> requestServerVariables) 187 | VIRTUALSERVER_ANTIFLOOD_POINTS_NEEDED_COMMAND_BLOCK, //only available on request (=> requestServerVariables) 188 | VIRTUALSERVER_ANTIFLOOD_POINTS_NEEDED_IP_BLOCK, //only available on request (=> requestServerVariables) 189 | VIRTUALSERVER_CLIENT_CONNECTIONS, //only available on request (=> requestServerVariables) 190 | VIRTUALSERVER_QUERY_CLIENT_CONNECTIONS, //only available on request (=> requestServerVariables) 191 | VIRTUALSERVER_HOSTBUTTON_TOOLTIP, //available when connected, always up-to-date 192 | VIRTUALSERVER_HOSTBUTTON_URL, //available when connected, always up-to-date 193 | VIRTUALSERVER_HOSTBUTTON_GFX_URL, //available when connected, always up-to-date 194 | VIRTUALSERVER_QUERYCLIENTS_ONLINE, //only available on request (=> requestServerVariables) 195 | VIRTUALSERVER_DOWNLOAD_QUOTA, //only available on request (=> requestServerVariables) 196 | VIRTUALSERVER_UPLOAD_QUOTA, //only available on request (=> requestServerVariables) 197 | VIRTUALSERVER_MONTH_BYTES_DOWNLOADED, //only available on request (=> requestServerVariables) 198 | VIRTUALSERVER_MONTH_BYTES_UPLOADED, //only available on request (=> requestServerVariables) 199 | VIRTUALSERVER_TOTAL_BYTES_DOWNLOADED, //only available on request (=> requestServerVariables) 200 | VIRTUALSERVER_TOTAL_BYTES_UPLOADED, //only available on request (=> requestServerVariables) 201 | VIRTUALSERVER_PORT, //only available on request (=> requestServerVariables) 202 | VIRTUALSERVER_AUTOSTART, //only available on request (=> requestServerVariables) 203 | VIRTUALSERVER_MACHINE_ID, //only available on request (=> requestServerVariables) 204 | VIRTUALSERVER_NEEDED_IDENTITY_SECURITY_LEVEL, //only available on request (=> requestServerVariables) 205 | VIRTUALSERVER_LOG_CLIENT, //only available on request (=> requestServerVariables) 206 | VIRTUALSERVER_LOG_QUERY, //only available on request (=> requestServerVariables) 207 | VIRTUALSERVER_LOG_CHANNEL, //only available on request (=> requestServerVariables) 208 | VIRTUALSERVER_LOG_PERMISSIONS, //only available on request (=> requestServerVariables) 209 | VIRTUALSERVER_LOG_SERVER, //only available on request (=> requestServerVariables) 210 | // VIRTUALSERVER_LOG_FILETRANSFER, // Moved to VirtualServerProperties due to SDK usage 211 | VIRTUALSERVER_MIN_CLIENT_VERSION = 65, //only available on request (=> requestServerVariables) 212 | VIRTUALSERVER_NAME_PHONETIC, //available when connected, always up-to-date 213 | VIRTUALSERVER_ICON_ID, //available when connected, always up-to-date 214 | VIRTUALSERVER_RESERVED_SLOTS, //available when connected, always up-to-date 215 | VIRTUALSERVER_TOTAL_PACKETLOSS_SPEECH, //only available on request (=> requestServerVariables) 216 | VIRTUALSERVER_TOTAL_PACKETLOSS_KEEPALIVE, //only available on request (=> requestServerVariables) 217 | VIRTUALSERVER_TOTAL_PACKETLOSS_CONTROL, //only available on request (=> requestServerVariables) 218 | VIRTUALSERVER_TOTAL_PACKETLOSS_TOTAL, //only available on request (=> requestServerVariables) 219 | VIRTUALSERVER_TOTAL_PING, //only available on request (=> requestServerVariables) 220 | VIRTUALSERVER_IP, //internal use | contains comma separated ip list 221 | VIRTUALSERVER_WEBLIST_ENABLED, //only available on request (=> requestServerVariables) 222 | VIRTUALSERVER_AUTOGENERATED_PRIVILEGEKEY, //internal use 223 | VIRTUALSERVER_ASK_FOR_PRIVILEGEKEY, //available when connected 224 | VIRTUALSERVER_HOSTBANNER_MODE, //available when connected, always up-to-date 225 | VIRTUALSERVER_CHANNEL_TEMP_DELETE_DELAY_DEFAULT, //available when connected, always up-to-date 226 | VIRTUALSERVER_MIN_ANDROID_VERSION, //only available on request (=> requestServerVariables) 227 | VIRTUALSERVER_MIN_IOS_VERSION, //only available on request (=> requestServerVariables) 228 | VIRTUALSERVER_MIN_WINPHONE_VERSION, //only available on request (=> requestServerVariables) 229 | VIRTUALSERVER_NICKNAME, //available when connected, always up-to-date 230 | VIRTUALSERVER_ACCOUNTING_TOKEN, //internal use | contains base64 encoded token data 231 | VIRTUALSERVER_PROTOCOL_VERIFY_KEYPAIR, //internal use 232 | VIRTUALSERVER_ANTIFLOOD_POINTS_NEEDED_PLUGIN_BLOCK, //only available on request (=> requestServerVariables) 233 | VIRTUALSERVER_CAPABILITY_EXTENSIONS, //available when connected, not updated while connected 234 | VIRTUALSERVER_STORAGE_QUOTA, // Allowed filetransfer storage on this server (including chat attachments) in megabytes 235 | VIRTUALSERVER_WEBRTC_CERTIFICATE, //internal use 236 | VIRTUALSERVER_WEBRTC_PRIVATE_KEY, //internal use 237 | VIRTUALSERVER_UUID, //the uuid of the server (uuid v5 of VIRTUALSERVER_UNIQUE_IDENTIFIER) 238 | VIRTUALSERVER_ADMINISTRATIVE_DOMAIN, //The domain which is responsible for this teamspeak server (which hosts its .well-known file) 239 | VIRTUALSERVER_CANONICAL_NAME, //The canonical name under which the server is reachable 240 | VIRTUALSERVER_MYTSID_CONNECT_ONLY, //Only clients that have a valid mytsid can connect 241 | VIRTUALSERVER_MAX_HOMEBASES, //How many matrix homebases this virtual server supports. -1 = no limit 242 | VIRTUALSERVER_HOMEBASE_STORAGE_QUOTA, // Allowed filetransfer storage for homebase attachments in megabytes 243 | VIRTUALSERVER_ENDMARKER_RARE 244 | }; 245 | 246 | enum ChannelPropertiesRare { 247 | CHANNEL_DUMMY_3 = CHANNEL_ENDMARKER, 248 | CHANNEL_DUMMY_4, 249 | CHANNEL_DUMMY_5, 250 | CHANNEL_DUMMY_6, 251 | CHANNEL_DUMMY_7, 252 | CHANNEL_FLAG_MAXCLIENTS_UNLIMITED, //Available for all channels that are "in view", always up-to-date 253 | CHANNEL_FLAG_MAXFAMILYCLIENTS_UNLIMITED, //Available for all channels that are "in view", always up-to-date 254 | CHANNEL_FLAG_MAXFAMILYCLIENTS_INHERITED, //Available for all channels that are "in view", always up-to-date 255 | CHANNEL_FLAG_ARE_SUBSCRIBED, //Only available client side, stores whether we are subscribed to this channel 256 | CHANNEL_FILEPATH, //not available client side, the folder used for file-transfers for this channel 257 | CHANNEL_NEEDED_TALK_POWER, //Available for all channels that are "in view", always up-to-date 258 | CHANNEL_FORCED_SILENCE, //Available for all channels that are "in view", always up-to-date 259 | CHANNEL_NAME_PHONETIC, //Available for all channels that are "in view", always up-to-date 260 | CHANNEL_ICON_ID, //Available for all channels that are "in view", always up-to-date 261 | CHANNEL_BANNER_GFX_URL, //Available for all channels that are "in view", always up-to-date 262 | CHANNEL_BANNER_MODE, //Available for all channels that are "in view", always up-to-date 263 | CHANNEL_PERMISSION_HINTS, 264 | CHANNEL_STORAGE_QUOTA, // Storage space that is allowed to be used by this channels files (in MiB) 265 | CHANNEL_ENDMARKER_RARE, 266 | CHANNEL_DELETE_DELAY_DEADLINE = 127 //(for clientlibv2) expected delete time in monotonic clock seconds or 0 if nothing is expected 267 | }; 268 | 269 | enum ClientPropertiesRare { 270 | CLIENT_DUMMY_4 = CLIENT_ENDMARKER, 271 | CLIENT_DUMMY_5, 272 | CLIENT_DUMMY_6, 273 | CLIENT_DUMMY_7, 274 | CLIENT_DUMMY_8, 275 | CLIENT_DUMMY_9, 276 | CLIENT_KEY_OFFSET, //internal use 277 | CLIENT_LAST_VAR_REQUEST, //internal use 278 | CLIENT_LOGIN_NAME, //used for serverquery clients, makes no sense on normal clients currently 279 | CLIENT_LOGIN_PASSWORD, //used for serverquery clients, makes no sense on normal clients currently 280 | CLIENT_DATABASE_ID, //automatically up-to-date for any client "in view", only valid with PERMISSION feature, holds database client id 281 | CLIENT_CHANNEL_GROUP_ID, //automatically up-to-date for any client "in view", only valid with PERMISSION feature, holds database client id 282 | CLIENT_SERVERGROUPS, //automatically up-to-date for any client "in view", only valid with PERMISSION feature, holds all servergroups client belongs too 283 | CLIENT_CREATED, //this needs to be requested (=> requestClientVariables), first time this client connected to this server 284 | CLIENT_LASTCONNECTED, //this needs to be requested (=> requestClientVariables), last time this client connected to this server 285 | CLIENT_TOTALCONNECTIONS, //this needs to be requested (=> requestClientVariables), how many times this client connected to this server 286 | CLIENT_AWAY, //automatically up-to-date for any client "in view", this clients away status 287 | CLIENT_AWAY_MESSAGE, //automatically up-to-date for any client "in view", this clients away message 288 | CLIENT_TYPE, //automatically up-to-date for any client "in view", determines if this is a real client or a server-query connection 289 | CLIENT_FLAG_AVATAR, //automatically up-to-date for any client "in view", this client got an avatar 290 | CLIENT_TALK_POWER, //automatically up-to-date for any client "in view", only valid with PERMISSION feature, holds database client id 291 | CLIENT_TALK_REQUEST, //automatically up-to-date for any client "in view", only valid with PERMISSION feature, holds timestamp where client requested to talk 292 | CLIENT_TALK_REQUEST_MSG, //automatically up-to-date for any client "in view", only valid with PERMISSION feature, holds matter for the request 293 | CLIENT_DESCRIPTION, //automatically up-to-date for any client "in view" 294 | CLIENT_IS_TALKER, //automatically up-to-date for any client "in view" 295 | CLIENT_MONTH_BYTES_UPLOADED, //this needs to be requested (=> requestClientVariables) 296 | CLIENT_MONTH_BYTES_DOWNLOADED, //this needs to be requested (=> requestClientVariables) 297 | CLIENT_TOTAL_BYTES_UPLOADED, //this needs to be requested (=> requestClientVariables) 298 | CLIENT_TOTAL_BYTES_DOWNLOADED, //this needs to be requested (=> requestClientVariables) 299 | CLIENT_IS_PRIORITY_SPEAKER, //automatically up-to-date for any client "in view" 300 | CLIENT_UNREAD_MESSAGES, //automatically up-to-date for any client "in view" 301 | CLIENT_NICKNAME_PHONETIC, //automatically up-to-date for any client "in view" 302 | CLIENT_NEEDED_SERVERQUERY_VIEW_POWER, //automatically up-to-date for any client "in view" 303 | CLIENT_DEFAULT_TOKEN, //only usable for ourself, the default token we used to connect on our last connection attempt 304 | CLIENT_ICON_ID, //automatically up-to-date for any client "in view" 305 | CLIENT_IS_CHANNEL_COMMANDER, //automatically up-to-date for any client "in view" 306 | CLIENT_COUNTRY, //automatically up-to-date for any client "in view" 307 | CLIENT_CHANNEL_GROUP_INHERITED_CHANNEL_ID, //automatically up-to-date for any client "in view", only valid with PERMISSION feature, contains channel_id where the channel_group_id is set from 308 | CLIENT_BADGES, //automatically up-to-date for any client "in view", stores icons for partner badges 309 | CLIENT_MYTEAMSPEAK_ID, //automatically up-to-date for any client "in view", stores myteamspeak id 310 | CLIENT_INTEGRATIONS, //automatically up-to-date for any client "in view", stores integrations 311 | CLIENT_ACTIVE_INTEGRATIONS_INFO, //stores info from the myts server and contains the subscription info 312 | CLIENT_MYTS_AVATAR, 313 | CLIENT_SIGNED_BADGES, 314 | CLIENT_PERMISSION_HINTS, 315 | CLIENT_USER_TAG, //automatically up-to-date for any client "in view", stores public chat user tag 316 | CLIENT_ENDMARKER_RARE, 317 | CLIENT_HW_ID = 127 //(for clientlibv2) unique hardware id 318 | }; 319 | 320 | enum BBCodeTags { 321 | BBCodeTag_B = 0x00000001, 322 | BBCodeTag_I = 0x00000002, 323 | BBCodeTag_U = 0x00000004, 324 | BBCodeTag_S = 0x00000008, 325 | BBCodeTag_SUP = 0x00000010, 326 | BBCodeTag_SUB = 0x00000020, 327 | BBCodeTag_COLOR = 0x00000040, 328 | BBCodeTag_SIZE = 0x00000080, 329 | BBCodeTag_group_text = 0x000000FF, 330 | 331 | BBCodeTag_LEFT = 0x00001000, 332 | BBCodeTag_RIGHT = 0x00002000, 333 | BBCodeTag_CENTER = 0x00004000, 334 | BBCodeTag_group_align = 0x00007000, 335 | 336 | BBCodeTag_URL = 0x00010000, 337 | BBCodeTag_IMAGE = 0x00020000, 338 | BBCodeTag_HR = 0x00040000, 339 | 340 | BBCodeTag_LIST = 0x00100000, 341 | BBCodeTag_LISTITEM = 0x00200000, 342 | BBCodeTag_group_list = 0x00300000, 343 | 344 | BBCodeTag_TABLE = 0x00400000, 345 | BBCodeTag_TR = 0x00800000, 346 | BBCodeTag_TH = 0x01000000, 347 | BBCodeTag_TD = 0x02000000, 348 | BBCodeTag_group_table = 0x03C00000, 349 | 350 | BBCodeTag_def_simple = BBCodeTag_B | BBCodeTag_I | BBCodeTag_U | BBCodeTag_S | BBCodeTag_SUP | BBCodeTag_SUB | BBCodeTag_COLOR | BBCodeTag_URL, 351 | BBCodeTag_def_simple_Img = BBCodeTag_def_simple | BBCodeTag_IMAGE, 352 | BBCodeTag_def_extended = BBCodeTag_group_text | BBCodeTag_group_align | BBCodeTag_URL | BBCodeTag_IMAGE | BBCodeTag_HR | BBCodeTag_group_list | BBCodeTag_group_table, 353 | }; 354 | 355 | enum LicenseIssue { Blacklisted = 0, Greylisted }; 356 | 357 | enum MytsDataUnsetFlags { 358 | MytsDataUnsetFlag_None = 0, 359 | MytsDataUnsetFlag_Badges = 1, 360 | MytsDataUnsetFlag_Avatar = 1 << 1, 361 | 362 | MytsDataUnsetFlag_All = MytsDataUnsetFlag_Badges | MytsDataUnsetFlag_Avatar // make sure "all" really contains all flags 363 | }; 364 | 365 | typedef int (*ExtraBBCodeValidator)(void* userparam, const char* tag, const char* paramValue, int paramValueSize, const char* childValue, int childValueSize); 366 | typedef const char* (*ExtraBBCodeParamTransform)(void* userparam, const char* tag, const char* paramValue); 367 | 368 | #endif //PUBLIC_RARE_DEFINITIONS_H 369 | -------------------------------------------------------------------------------- /include/ts3_functions.h: -------------------------------------------------------------------------------- 1 | #ifndef TS3_FUNCTIONS_H 2 | #define TS3_FUNCTIONS_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include "plugin_definitions.h" 9 | #include "teamspeak/public_definitions.h" 10 | 11 | /* Functions exported to plugin from main binary */ 12 | struct TS3Functions { 13 | unsigned int (*getClientLibVersion)(char** result); 14 | unsigned int (*getClientLibVersionNumber)(uint64* result); 15 | unsigned int (*spawnNewServerConnectionHandler)(int port, uint64* result); 16 | unsigned int (*destroyServerConnectionHandler)(uint64 serverConnectionHandlerID); 17 | 18 | /* Error handling */ 19 | unsigned int (*getErrorMessage)(unsigned int errorCode, char** error); 20 | 21 | /* Memory management */ 22 | unsigned int (*freeMemory)(void* pointer); 23 | 24 | /* Logging */ 25 | unsigned int (*logMessage)(const char* logMessage, enum LogLevel severity, const char* channel, uint64 logID); 26 | 27 | /* Sound */ 28 | unsigned int (*getPlaybackDeviceList)(const char* modeID, char**** result); 29 | unsigned int (*getPlaybackModeList)(char*** result); 30 | unsigned int (*getCaptureDeviceList)(const char* modeID, char**** result); 31 | unsigned int (*getCaptureModeList)(char*** result); 32 | unsigned int (*getDefaultPlaybackDevice)(const char* modeID, char*** result); 33 | unsigned int (*getDefaultPlayBackMode)(char** result); 34 | unsigned int (*getDefaultCaptureDevice)(const char* modeID, char*** result); 35 | unsigned int (*getDefaultCaptureMode)(char** result); 36 | unsigned int (*openPlaybackDevice)(uint64 serverConnectionHandlerID, const char* modeID, const char* playbackDevice); 37 | unsigned int (*openCaptureDevice)(uint64 serverConnectionHandlerID, const char* modeID, const char* captureDevice); 38 | unsigned int (*getCurrentPlaybackDeviceName)(uint64 serverConnectionHandlerID, char** result, int* isDefault); 39 | unsigned int (*getCurrentPlayBackMode)(uint64 serverConnectionHandlerID, char** result); 40 | unsigned int (*getCurrentCaptureDeviceName)(uint64 serverConnectionHandlerID, char** result, int* isDefault); 41 | unsigned int (*getCurrentCaptureMode)(uint64 serverConnectionHandlerID, char** result); 42 | unsigned int (*initiateGracefulPlaybackShutdown)(uint64 serverConnectionHandlerID); 43 | unsigned int (*closePlaybackDevice)(uint64 serverConnectionHandlerID); 44 | unsigned int (*closeCaptureDevice)(uint64 serverConnectionHandlerID); 45 | unsigned int (*activateCaptureDevice)(uint64 serverConnectionHandlerID); 46 | unsigned int (*playWaveFileHandle)(uint64 serverConnectionHandlerID, const char* path, int loop, uint64* waveHandle); 47 | unsigned int (*pauseWaveFileHandle)(uint64 serverConnectionHandlerID, uint64 waveHandle, int pause); 48 | unsigned int (*closeWaveFileHandle)(uint64 serverConnectionHandlerID, uint64 waveHandle); 49 | unsigned int (*playWaveFile)(uint64 serverConnectionHandlerID, const char* path); 50 | unsigned int (*registerCustomDevice)(const char* deviceID, const char* deviceDisplayName, int capFrequency, int capChannels, int playFrequency, int playChannels); 51 | unsigned int (*unregisterCustomDevice)(const char* deviceID); 52 | unsigned int (*processCustomCaptureData)(const char* deviceName, const short* buffer, int samples); 53 | unsigned int (*acquireCustomPlaybackData)(const char* deviceName, short* buffer, int samples); 54 | 55 | /* Preprocessor */ 56 | unsigned int (*getPreProcessorInfoValueFloat)(uint64 serverConnectionHandlerID, const char* ident, float* result); 57 | unsigned int (*getPreProcessorConfigValue)(uint64 serverConnectionHandlerID, const char* ident, char** result); 58 | unsigned int (*setPreProcessorConfigValue)(uint64 serverConnectionHandlerID, const char* ident, const char* value); 59 | 60 | /* Encoder */ 61 | unsigned int (*getEncodeConfigValue)(uint64 serverConnectionHandlerID, const char* ident, char** result); 62 | 63 | /* Playback */ 64 | unsigned int (*getPlaybackConfigValueAsFloat)(uint64 serverConnectionHandlerID, const char* ident, float* result); 65 | unsigned int (*setPlaybackConfigValue)(uint64 serverConnectionHandlerID, const char* ident, const char* value); 66 | unsigned int (*setClientVolumeModifier)(uint64 serverConnectionHandlerID, anyID clientID, float value); 67 | 68 | /* Recording status */ 69 | unsigned int (*startVoiceRecording)(uint64 serverConnectionHandlerID); 70 | unsigned int (*stopVoiceRecording)(uint64 serverConnectionHandlerID); 71 | 72 | /* 3d sound positioning */ 73 | unsigned int (*systemset3DListenerAttributes)(uint64 serverConnectionHandlerID, const TS3_VECTOR* position, const TS3_VECTOR* forward, const TS3_VECTOR* up); 74 | unsigned int (*set3DWaveAttributes)(uint64 serverConnectionHandlerID, uint64 waveHandle, const TS3_VECTOR* position); 75 | unsigned int (*systemset3DSettings)(uint64 serverConnectionHandlerID, float distanceFactor, float rolloffScale); 76 | unsigned int (*channelset3DAttributes)(uint64 serverConnectionHandlerID, anyID clientID, const TS3_VECTOR* position); 77 | 78 | /* Interaction with the server */ 79 | unsigned int (*startConnection)(uint64 serverConnectionHandlerID, const char* identity, const char* ip, unsigned int port, const char* nickname, const char** defaultChannelArray, const char* defaultChannelPassword, const char* serverPassword); 80 | unsigned int (*stopConnection)(uint64 serverConnectionHandlerID, const char* quitMessage); 81 | unsigned int (*requestClientMove)(uint64 serverConnectionHandlerID, anyID clientID, uint64 newChannelID, const char* password, const char* returnCode); 82 | unsigned int (*requestClientVariables)(uint64 serverConnectionHandlerID, anyID clientID, const char* returnCode); 83 | unsigned int (*requestClientKickFromChannel)(uint64 serverConnectionHandlerID, anyID clientID, const char* kickReason, const char* returnCode); 84 | unsigned int (*requestClientKickFromServer)(uint64 serverConnectionHandlerID, anyID clientID, const char* kickReason, const char* returnCode); 85 | unsigned int (*requestChannelDelete)(uint64 serverConnectionHandlerID, uint64 channelID, int force, const char* returnCode); 86 | unsigned int (*requestChannelMove)(uint64 serverConnectionHandlerID, uint64 channelID, uint64 newChannelParentID, uint64 newChannelOrder, const char* returnCode); 87 | unsigned int (*requestSendPrivateTextMsg)(uint64 serverConnectionHandlerID, const char* message, anyID targetClientID, const char* returnCode); 88 | unsigned int (*requestSendChannelTextMsg)(uint64 serverConnectionHandlerID, const char* message, uint64 targetChannelID, const char* returnCode); 89 | unsigned int (*requestSendServerTextMsg)(uint64 serverConnectionHandlerID, const char* message, const char* returnCode); 90 | unsigned int (*requestConnectionInfo)(uint64 serverConnectionHandlerID, anyID clientID, const char* returnCode); 91 | unsigned int (*requestClientSetWhisperList)(uint64 serverConnectionHandlerID, anyID clientID, const uint64* targetChannelIDArray, const anyID* targetClientIDArray, const char* returnCode); 92 | unsigned int (*requestChannelSubscribe)(uint64 serverConnectionHandlerID, const uint64* channelIDArray, const char* returnCode); 93 | unsigned int (*requestChannelSubscribeAll)(uint64 serverConnectionHandlerID, const char* returnCode); 94 | unsigned int (*requestChannelUnsubscribe)(uint64 serverConnectionHandlerID, const uint64* channelIDArray, const char* returnCode); 95 | unsigned int (*requestChannelUnsubscribeAll)(uint64 serverConnectionHandlerID, const char* returnCode); 96 | unsigned int (*requestChannelDescription)(uint64 serverConnectionHandlerID, uint64 channelID, const char* returnCode); 97 | unsigned int (*requestMuteClients)(uint64 serverConnectionHandlerID, const anyID* clientIDArray, const char* returnCode); 98 | unsigned int (*requestUnmuteClients)(uint64 serverConnectionHandlerID, const anyID* clientIDArray, const char* returnCode); 99 | unsigned int (*requestClientPoke)(uint64 serverConnectionHandlerID, anyID clientID, const char* message, const char* returnCode); 100 | unsigned int (*requestClientIDs)(uint64 serverConnectionHandlerID, const char* clientUniqueIdentifier, const char* returnCode); 101 | unsigned int (*clientChatClosed)(uint64 serverConnectionHandlerID, const char* clientUniqueIdentifier, anyID clientID, const char* returnCode); 102 | unsigned int (*clientChatComposing)(uint64 serverConnectionHandlerID, anyID clientID, const char* returnCode); 103 | unsigned int (*requestServerTemporaryPasswordAdd)(uint64 serverConnectionHandlerID, const char* password, const char* description, uint64 duration, uint64 targetChannelID, const char* targetChannelPW, const char* returnCode); 104 | unsigned int (*requestServerTemporaryPasswordDel)(uint64 serverConnectionHandlerID, const char* password, const char* returnCode); 105 | unsigned int (*requestServerTemporaryPasswordList)(uint64 serverConnectionHandlerID, const char* returnCode); 106 | 107 | /* Access clientlib information */ 108 | 109 | /* Query own client ID */ 110 | unsigned int (*getClientID)(uint64 serverConnectionHandlerID, anyID* result); 111 | 112 | /* Client info */ 113 | unsigned int (*getClientSelfVariableAsInt)(uint64 serverConnectionHandlerID, size_t flag, int* result); 114 | unsigned int (*getClientSelfVariableAsString)(uint64 serverConnectionHandlerID, size_t flag, char** result); 115 | unsigned int (*setClientSelfVariableAsInt)(uint64 serverConnectionHandlerID, size_t flag, int value); 116 | unsigned int (*setClientSelfVariableAsString)(uint64 serverConnectionHandlerID, size_t flag, const char* value); 117 | unsigned int (*flushClientSelfUpdates)(uint64 serverConnectionHandlerID, const char* returnCode); 118 | unsigned int (*getClientVariableAsInt)(uint64 serverConnectionHandlerID, anyID clientID, size_t flag, int* result); 119 | unsigned int (*getClientVariableAsUInt64)(uint64 serverConnectionHandlerID, anyID clientID, size_t flag, uint64* result); 120 | unsigned int (*getClientVariableAsString)(uint64 serverConnectionHandlerID, anyID clientID, size_t flag, char** result); 121 | unsigned int (*getClientList)(uint64 serverConnectionHandlerID, anyID** result); 122 | unsigned int (*getChannelOfClient)(uint64 serverConnectionHandlerID, anyID clientID, uint64* result); 123 | 124 | /* Channel info */ 125 | unsigned int (*getChannelVariableAsInt)(uint64 serverConnectionHandlerID, uint64 channelID, size_t flag, int* result); 126 | unsigned int (*getChannelVariableAsUInt64)(uint64 serverConnectionHandlerID, uint64 channelID, size_t flag, uint64* result); 127 | unsigned int (*getChannelVariableAsString)(uint64 serverConnectionHandlerID, uint64 channelID, size_t flag, char** result); 128 | unsigned int (*getChannelIDFromChannelNames)(uint64 serverConnectionHandlerID, char** channelNameArray, uint64* result); 129 | unsigned int (*setChannelVariableAsInt)(uint64 serverConnectionHandlerID, uint64 channelID, size_t flag, int value); 130 | unsigned int (*setChannelVariableAsUInt64)(uint64 serverConnectionHandlerID, uint64 channelID, size_t flag, uint64 value); 131 | unsigned int (*setChannelVariableAsString)(uint64 serverConnectionHandlerID, uint64 channelID, size_t flag, const char* value); 132 | unsigned int (*flushChannelUpdates)(uint64 serverConnectionHandlerID, uint64 channelID, const char* returnCode); 133 | unsigned int (*flushChannelCreation)(uint64 serverConnectionHandlerID, uint64 channelParentID, const char* returnCode); 134 | unsigned int (*getChannelList)(uint64 serverConnectionHandlerID, uint64** result); 135 | unsigned int (*getChannelClientList)(uint64 serverConnectionHandlerID, uint64 channelID, anyID** result); 136 | unsigned int (*getParentChannelOfChannel)(uint64 serverConnectionHandlerID, uint64 channelID, uint64* result); 137 | 138 | /* Server info */ 139 | unsigned int (*getServerConnectionHandlerList)(uint64** result); 140 | unsigned int (*getServerVariableAsInt)(uint64 serverConnectionHandlerID, size_t flag, int* result); 141 | unsigned int (*getServerVariableAsUInt64)(uint64 serverConnectionHandlerID, size_t flag, uint64* result); 142 | unsigned int (*getServerVariableAsString)(uint64 serverConnectionHandlerID, size_t flag, char** result); 143 | unsigned int (*requestServerVariables)(uint64 serverConnectionHandlerID); 144 | 145 | /* Connection info */ 146 | unsigned int (*getConnectionStatus)(uint64 serverConnectionHandlerID, int* result); 147 | unsigned int (*getConnectionVariableAsUInt64)(uint64 serverConnectionHandlerID, anyID clientID, size_t flag, uint64* result); 148 | unsigned int (*getConnectionVariableAsDouble)(uint64 serverConnectionHandlerID, anyID clientID, size_t flag, double* result); 149 | unsigned int (*getConnectionVariableAsString)(uint64 serverConnectionHandlerID, anyID clientID, size_t flag, char** result); 150 | unsigned int (*cleanUpConnectionInfo)(uint64 serverConnectionHandlerID, anyID clientID); 151 | 152 | /* Client related */ 153 | unsigned int (*requestClientDBIDfromUID)(uint64 serverConnectionHandlerID, const char* clientUniqueIdentifier, const char* returnCode); 154 | unsigned int (*requestClientNamefromUID)(uint64 serverConnectionHandlerID, const char* clientUniqueIdentifier, const char* returnCode); 155 | unsigned int (*requestClientNamefromDBID)(uint64 serverConnectionHandlerID, uint64 clientDatabaseID, const char* returnCode); 156 | unsigned int (*requestClientEditDescription)(uint64 serverConnectionHandlerID, anyID clientID, const char* clientDescription, const char* returnCode); 157 | unsigned int (*requestClientSetIsTalker)(uint64 serverConnectionHandlerID, anyID clientID, int isTalker, const char* returnCode); 158 | unsigned int (*requestIsTalker)(uint64 serverConnectionHandlerID, int isTalkerRequest, const char* isTalkerRequestMessage, const char* returnCode); 159 | 160 | /* Plugin related */ 161 | unsigned int (*requestSendClientQueryCommand)(uint64 serverConnectionHandlerID, const char* command, const char* returnCode); 162 | 163 | /* Filetransfer */ 164 | unsigned int (*getTransferFileName)(anyID transferID, char** result); 165 | unsigned int (*getTransferFilePath)(anyID transferID, char** result); 166 | unsigned int (*getTransferFileSize)(anyID transferID, uint64* result); 167 | unsigned int (*getTransferFileSizeDone)(anyID transferID, uint64* result); 168 | unsigned int (*isTransferSender)(anyID transferID, int* result); /* 1 == upload, 0 == download */ 169 | unsigned int (*getTransferStatus)(anyID transferID, int* result); 170 | unsigned int (*getCurrentTransferSpeed)(anyID transferID, float* result); 171 | unsigned int (*getAverageTransferSpeed)(anyID transferID, float* result); 172 | unsigned int (*getTransferRunTime)(anyID transferID, uint64* result); 173 | unsigned int (*sendFile)(uint64 serverConnectionHandlerID, uint64 channelID, const char* channelPW, const char* file, int overwrite, int resume, const char* sourceDirectory, anyID* result, const char* returnCode); 174 | unsigned int (*requestFile)(uint64 serverConnectionHandlerID, uint64 channelID, const char* channelPW, const char* file, int overwrite, int resume, const char* destinationDirectory, anyID* result, const char* returnCode); 175 | unsigned int (*haltTransfer)(uint64 serverConnectionHandlerID, anyID transferID, int deleteUnfinishedFile, const char* returnCode); 176 | unsigned int (*requestFileList)(uint64 serverConnectionHandlerID, uint64 channelID, const char* channelPW, const char* path, const char* returnCode); 177 | unsigned int (*requestFileInfo)(uint64 serverConnectionHandlerID, uint64 channelID, const char* channelPW, const char* file, const char* returnCode); 178 | unsigned int (*requestDeleteFile)(uint64 serverConnectionHandlerID, uint64 channelID, const char* channelPW, const char** file, const char* returnCode); 179 | unsigned int (*requestCreateDirectory)(uint64 serverConnectionHandlerID, uint64 channelID, const char* channelPW, const char* directoryPath, const char* returnCode); 180 | unsigned int (*requestRenameFile)(uint64 serverConnectionHandlerID, uint64 fromChannelID, const char* channelPW, uint64 toChannelID, const char* toChannelPW, const char* oldFile, const char* newFile, const char* returnCode); 181 | 182 | /* Offline message management */ 183 | unsigned int (*requestMessageAdd)(uint64 serverConnectionHandlerID, const char* toClientUID, const char* subject, const char* message, const char* returnCode); 184 | unsigned int (*requestMessageDel)(uint64 serverConnectionHandlerID, uint64 messageID, const char* returnCode); 185 | unsigned int (*requestMessageGet)(uint64 serverConnectionHandlerID, uint64 messageID, const char* returnCode); 186 | unsigned int (*requestMessageList)(uint64 serverConnectionHandlerID, const char* returnCode); 187 | unsigned int (*requestMessageUpdateFlag)(uint64 serverConnectionHandlerID, uint64 messageID, int flag, const char* returnCode); 188 | 189 | /* Interacting with the server - confirming passwords */ 190 | unsigned int (*verifyServerPassword)(uint64 serverConnectionHandlerID, const char* serverPassword, const char* returnCode); 191 | unsigned int (*verifyChannelPassword)(uint64 serverConnectionHandlerID, uint64 channelID, const char* channelPassword, const char* returnCode); 192 | 193 | /* Interacting with the server - banning */ 194 | unsigned int (*banclient)(uint64 serverConnectionHandlerID, anyID clientID, uint64 timeInSeconds, const char* banReason, const char* returnCode); 195 | unsigned int (*banadd)(uint64 serverConnectionHandlerID, const char* ipRegExp, const char* nameRegexp, const char* uniqueIdentity, const char* mytsID, uint64 timeInSeconds, const char* banReason, const char* returnCode); 196 | unsigned int (*banclientdbid)(uint64 serverConnectionHandlerID, uint64 clientDBID, uint64 timeInSeconds, const char* banReason, const char* returnCode); 197 | unsigned int (*bandel)(uint64 serverConnectionHandlerID, uint64 banID, const char* returnCode); 198 | unsigned int (*bandelall)(uint64 serverConnectionHandlerID, const char* returnCode); 199 | unsigned int (*requestBanList)(uint64 serverConnectionHandlerID, uint64 start, unsigned int duration, const char* returnCode); 200 | 201 | /* Interacting with the server - complain */ 202 | unsigned int (*requestComplainAdd)(uint64 serverConnectionHandlerID, uint64 targetClientDatabaseID, const char* complainReason, const char* returnCode); 203 | unsigned int (*requestComplainDel)(uint64 serverConnectionHandlerID, uint64 targetClientDatabaseID, uint64 fromClientDatabaseID, const char* returnCode); 204 | unsigned int (*requestComplainDelAll)(uint64 serverConnectionHandlerID, uint64 targetClientDatabaseID, const char* returnCode); 205 | unsigned int (*requestComplainList)(uint64 serverConnectionHandlerID, uint64 targetClientDatabaseID, const char* returnCode); 206 | 207 | /* Permissions */ 208 | unsigned int (*requestServerGroupList)(uint64 serverConnectionHandlerID, const char* returnCode); 209 | unsigned int (*requestServerGroupAdd)(uint64 serverConnectionHandlerID, const char* groupName, int groupType, const char* returnCode); 210 | unsigned int (*requestServerGroupDel)(uint64 serverConnectionHandlerID, uint64 serverGroupID, int force, const char* returnCode); 211 | unsigned int (*requestServerGroupAddClient)(uint64 serverConnectionHandlerID, uint64 serverGroupID, uint64 clientDatabaseID, const char* returnCode); 212 | unsigned int (*requestServerGroupDelClient)(uint64 serverConnectionHandlerID, uint64 serverGroupID, uint64 clientDatabaseID, const char* returnCode); 213 | unsigned int (*requestServerGroupsByClientID)(uint64 serverConnectionHandlerID, uint64 clientDatabaseID, const char* returnCode); 214 | unsigned int (*requestServerGroupAddPerm)(uint64 serverConnectionHandlerID, uint64 serverGroupID, int continueonerror, const unsigned int* permissionIDArray, const int* permissionValueArray, const int* permissionNegatedArray, 215 | const int* permissionSkipArray, int arraySize, const char* returnCode); 216 | unsigned int (*requestServerGroupDelPerm)(uint64 serverConnectionHandlerID, uint64 serverGroupID, int continueOnError, const unsigned int* permissionIDArray, int arraySize, const char* returnCode); 217 | unsigned int (*requestServerGroupPermList)(uint64 serverConnectionHandlerID, uint64 serverGroupID, const char* returnCode); 218 | unsigned int (*requestServerGroupClientList)(uint64 serverConnectionHandlerID, uint64 serverGroupID, int withNames, const char* returnCode); 219 | unsigned int (*requestChannelGroupList)(uint64 serverConnectionHandlerID, const char* returnCode); 220 | unsigned int (*requestChannelGroupAdd)(uint64 serverConnectionHandlerID, const char* groupName, int groupType, const char* returnCode); 221 | unsigned int (*requestChannelGroupDel)(uint64 serverConnectionHandlerID, uint64 channelGroupID, int force, const char* returnCode); 222 | unsigned int (*requestChannelGroupAddPerm)(uint64 serverConnectionHandlerID, uint64 channelGroupID, int continueonerror, const unsigned int* permissionIDArray, const int* permissionValueArray, int arraySize, const char* returnCode); 223 | unsigned int (*requestChannelGroupDelPerm)(uint64 serverConnectionHandlerID, uint64 channelGroupID, int continueOnError, const unsigned int* permissionIDArray, int arraySize, const char* returnCode); 224 | unsigned int (*requestChannelGroupPermList)(uint64 serverConnectionHandlerID, uint64 channelGroupID, const char* returnCode); 225 | unsigned int (*requestSetClientChannelGroup)(uint64 serverConnectionHandlerID, const uint64* channelGroupIDArray, const uint64* channelIDArray, const uint64* clientDatabaseIDArray, int arraySize, const char* returnCode); 226 | unsigned int (*requestChannelAddPerm)(uint64 serverConnectionHandlerID, uint64 channelID, const unsigned int* permissionIDArray, const int* permissionValueArray, int arraySize, const char* returnCode); 227 | unsigned int (*requestChannelDelPerm)(uint64 serverConnectionHandlerID, uint64 channelID, const unsigned int* permissionIDArray, int arraySize, const char* returnCode); 228 | unsigned int (*requestChannelPermList)(uint64 serverConnectionHandlerID, uint64 channelID, const char* returnCode); 229 | unsigned int (*requestClientAddPerm)(uint64 serverConnectionHandlerID, uint64 clientDatabaseID, const unsigned int* permissionIDArray, const int* permissionValueArray, const int* permissionSkipArray, int arraySize, const char* returnCode); 230 | unsigned int (*requestClientDelPerm)(uint64 serverConnectionHandlerID, uint64 clientDatabaseID, const unsigned int* permissionIDArray, int arraySize, const char* returnCode); 231 | unsigned int (*requestClientPermList)(uint64 serverConnectionHandlerID, uint64 clientDatabaseID, const char* returnCode); 232 | unsigned int (*requestChannelClientAddPerm)(uint64 serverConnectionHandlerID, uint64 channelID, uint64 clientDatabaseID, const unsigned int* permissionIDArray, const int* permissionValueArray, int arraySize, const char* returnCode); 233 | unsigned int (*requestChannelClientDelPerm)(uint64 serverConnectionHandlerID, uint64 channelID, uint64 clientDatabaseID, const unsigned int* permissionIDArray, int arraySize, const char* returnCode); 234 | unsigned int (*requestChannelClientPermList)(uint64 serverConnectionHandlerID, uint64 channelID, uint64 clientDatabaseID, const char* returnCode); 235 | unsigned int (*privilegeKeyUse)(uint64 serverConnectionHandler, const char* tokenKey, const char* returnCode); 236 | unsigned int (*requestPermissionList)(uint64 serverConnectionHandler, const char* returnCode); 237 | unsigned int (*requestPermissionOverview)(uint64 serverConnectionHandler, uint64 clientDBID, uint64 channelID, const char* returnCode); 238 | 239 | /* Helper Functions */ 240 | unsigned int (*clientPropertyStringToFlag)(const char* clientPropertyString, size_t* resultFlag); 241 | unsigned int (*channelPropertyStringToFlag)(const char* channelPropertyString, size_t* resultFlag); 242 | unsigned int (*serverPropertyStringToFlag)(const char* serverPropertyString, size_t* resultFlag); 243 | 244 | /* Client functions */ 245 | void (*getAppPath)(char* path, size_t maxLen); 246 | void (*getResourcesPath)(char* path, size_t maxLen); 247 | void (*getConfigPath)(char* path, size_t maxLen); 248 | void (*getPluginPath)(char* path, size_t maxLen, const char* pluginID); 249 | uint64 (*getCurrentServerConnectionHandlerID)(void); 250 | void (*printMessage)(uint64 serverConnectionHandlerID, const char* message, enum PluginMessageTarget messageTarget); 251 | void (*printMessageToCurrentTab)(const char* message); 252 | void (*urlsToBB)(const char* text, char* result, size_t maxLen); 253 | void (*sendPluginCommand)(uint64 serverConnectionHandlerID, const char* pluginID, const char* command, int targetMode, const anyID* targetIDs, const char* returnCode); 254 | void (*getDirectories)(const char* path, char* result, size_t maxLen); 255 | unsigned int (*getServerConnectInfo)(uint64 scHandlerID, char* host, unsigned short* port, char* password, size_t maxLen); 256 | unsigned int (*getChannelConnectInfo)(uint64 scHandlerID, uint64 channelID, char* path, char* password, size_t maxLen); 257 | void (*createReturnCode)(const char* pluginID, char* returnCode, size_t maxLen); 258 | unsigned int (*requestInfoUpdate)(uint64 scHandlerID, enum PluginItemType itemType, uint64 itemID); 259 | uint64 (*getServerVersion)(uint64 scHandlerID); 260 | unsigned int (*isWhispering)(uint64 scHandlerID, anyID clientID, int* result); 261 | unsigned int (*isReceivingWhisper)(uint64 scHandlerID, anyID clientID, int* result); 262 | unsigned int (*getAvatar)(uint64 scHandlerID, anyID clientID, char* result, size_t maxLen); 263 | void (*setPluginMenuEnabled)(const char* pluginID, int menuID, int enabled); 264 | void (*showHotkeySetup)(void); 265 | void (*requestHotkeyInputDialog)(const char* pluginID, const char* keyword, int isDown, void* qParentWindow); 266 | unsigned int (*getHotkeyFromKeyword)(const char* pluginID, const char** keywords, char** hotkeys, size_t arrayLen, size_t hotkeyBufSize); 267 | unsigned int (*getClientDisplayName)(uint64 scHandlerID, anyID clientID, char* result, size_t maxLen); 268 | unsigned int (*getBookmarkList)(struct PluginBookmarkList** list); 269 | unsigned int (*getProfileList)(enum PluginGuiProfile profile, int* defaultProfileIdx, char*** result); 270 | unsigned int (*guiConnect)(enum PluginConnectTab connectTab, const char* serverLabel, const char* serverAddress, const char* serverPassword, const char* nickname, const char* channel, const char* channelPassword, const char* captureProfile, 271 | const char* playbackProfile, const char* hotkeyProfile, const char* soundProfile, const char* userIdentity, const char* oneTimeKey, const char* phoneticName, uint64* scHandlerID); 272 | unsigned int (*guiConnectBookmark)(enum PluginConnectTab connectTab, const char* bookmarkuuid, uint64* scHandlerID); 273 | unsigned int (*createBookmark)(const char* bookmarkuuid, const char* serverLabel, const char* serverAddress, const char* serverPassword, const char* nickname, const char* channel, const char* channelPassword, const char* captureProfile, 274 | const char* playbackProfile, const char* hotkeyProfile, const char* soundProfile, const char* uniqueUserId, const char* oneTimeKey, const char* phoneticName); 275 | unsigned int (*getPermissionIDByName)(uint64 serverConnectionHandlerID, const char* permissionName, unsigned int* result); 276 | unsigned int (*getClientNeededPermission)(uint64 serverConnectionHandlerID, const char* permissionName, int* result); 277 | void (*notifyKeyEvent)(const char* pluginID, const char* keyIdentifier, int up_down); 278 | 279 | /* Single-Track/Multi-Track recording */ 280 | unsigned int (*startRecording)(uint64 serverConnectionHandlerID, int multitrack, int noFileSelector, const char* path); 281 | unsigned int (*stopRecording)(uint64 serverConnectionHandlerID); 282 | 283 | /* Convenience functions */ 284 | unsigned int (*requestClientsMove)(uint64 serverConnectionHandlerID, const anyID* clientIDArray, uint64 newChannelID, const char* password, const char* returnCode); 285 | unsigned int (*requestClientsKickFromChannel)(uint64 serverConnectionHandlerID, const anyID* clientIDArray, const char* kickReason, const char* returnCode); 286 | unsigned int (*requestClientsKickFromServer)(uint64 serverConnectionHandlerID, const anyID* clientIDArray, const char* kickReason, const char* returnCode); 287 | unsigned int (*requestMuteClientsTemporary)(uint64 serverConnectionHandlerID, const anyID* clientIDArray, const char* returnCode); 288 | unsigned int (*requestUnmuteClientsTemporary)(uint64 serverConnectionHandlerID, const anyID* clientIDArray, const char* returnCode); 289 | unsigned int (*getPermissionNameByID)(uint64 scHandlerID, unsigned int permissionID, char* result, size_t max_len); 290 | unsigned int (*clientPropertyFlagToString)(size_t clientPropertyFlag, char** resultString); 291 | unsigned int (*channelPropertyFlagToString)(size_t channelPropertyFlag, char** resultString); 292 | unsigned int (*serverPropertyFlagToString)(size_t serverPropertyFlag, char** resultString); 293 | 294 | /* Server editing */ 295 | unsigned int (*setServerVariableAsInt)(uint64 serverConnectionHandlerID, size_t flag, int value); 296 | unsigned int (*setServerVariableAsUInt64)(uint64 serverConnectionHandlerID, size_t flag, uint64 value); 297 | unsigned int (*setServerVariableAsDouble)(uint64 serverConnectionHandlerID, size_t flag, double value); 298 | unsigned int (*setServerVariableAsString)(uint64 serverConnectionHandlerID, size_t flag, const char* value); 299 | unsigned int (*flushServerUpdates)(uint64 serverConnectionHandlerID, const char* returnCode); 300 | 301 | /* Server/Channel group helper functions */ 302 | unsigned int (*getServerGroupIDByName)(uint64 serverConnectionHandlerID, const char* groupName, unsigned int* result); 303 | unsigned int (*getServerGroupNameByID)(uint64 scHandlerID, unsigned int groupID, char* result, size_t max_len); 304 | unsigned int (*getChannelGroupIDByName)(uint64 serverConnectionHandlerID, const char* groupName, unsigned int* result); 305 | unsigned int (*getChannelGroupNameByID)(uint64 scHandlerID, unsigned int groupID, char* result, size_t max_len); 306 | }; 307 | 308 | #ifdef __cplusplus 309 | } 310 | #endif 311 | 312 | #endif 313 | -------------------------------------------------------------------------------- /src/icons/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teamspeak/ts3client-pluginsdk/4aa90a53aa150cbf81e13bc97e68c0431b26499f/src/icons/1.png -------------------------------------------------------------------------------- /src/icons/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teamspeak/ts3client-pluginsdk/4aa90a53aa150cbf81e13bc97e68c0431b26499f/src/icons/2.png -------------------------------------------------------------------------------- /src/icons/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teamspeak/ts3client-pluginsdk/4aa90a53aa150cbf81e13bc97e68c0431b26499f/src/icons/3.png -------------------------------------------------------------------------------- /src/icons/t.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teamspeak/ts3client-pluginsdk/4aa90a53aa150cbf81e13bc97e68c0431b26499f/src/icons/t.png -------------------------------------------------------------------------------- /src/plugin.c: -------------------------------------------------------------------------------- 1 | /* 2 | * TeamSpeak 3 demo plugin 3 | * 4 | * Copyright (c) TeamSpeak Systems GmbH 5 | */ 6 | 7 | #if defined(WIN32) || defined(__WIN32__) || defined(_WIN32) 8 | #pragma warning(disable : 4100) /* Disable Unreferenced parameter warning */ 9 | #include 10 | #endif 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #include "teamspeak/public_definitions.h" 18 | #include "teamspeak/public_errors.h" 19 | #include "teamspeak/public_errors_rare.h" 20 | #include "teamspeak/public_rare_definitions.h" 21 | #include "ts3_functions.h" 22 | 23 | #include "plugin.h" 24 | 25 | static struct TS3Functions ts3Functions; 26 | 27 | #ifdef _WIN32 28 | #define _strcpy(dest, destSize, src) strcpy_s(dest, destSize, src) 29 | #define snprintf sprintf_s 30 | #else 31 | #define _strcpy(dest, destSize, src) \ 32 | { \ 33 | strncpy(dest, src, destSize - 1); \ 34 | (dest)[destSize - 1] = '\0'; \ 35 | } 36 | #endif 37 | 38 | #define PLUGIN_API_VERSION 26 39 | 40 | #define PATH_BUFSIZE 512 41 | #define COMMAND_BUFSIZE 128 42 | #define INFODATA_BUFSIZE 128 43 | #define SERVERINFO_BUFSIZE 256 44 | #define CHANNELINFO_BUFSIZE 512 45 | #define RETURNCODE_BUFSIZE 128 46 | 47 | static char* pluginID = NULL; 48 | 49 | #ifdef _WIN32 50 | /* Helper function to convert wchar_T to Utf-8 encoded strings on Windows */ 51 | static int wcharToUtf8(const wchar_t* str, char** result) 52 | { 53 | int outlen = WideCharToMultiByte(CP_UTF8, 0, str, -1, 0, 0, 0, 0); 54 | *result = (char*)malloc(outlen); 55 | if (WideCharToMultiByte(CP_UTF8, 0, str, -1, *result, outlen, 0, 0) == 0) { 56 | *result = NULL; 57 | return -1; 58 | } 59 | return 0; 60 | } 61 | #endif 62 | 63 | /*********************************** Required functions ************************************/ 64 | /* 65 | * If any of these required functions is not implemented, TS3 will refuse to load the plugin 66 | */ 67 | 68 | /* Unique name identifying this plugin */ 69 | const char* ts3plugin_name() 70 | { 71 | #ifdef _WIN32 72 | /* TeamSpeak expects UTF-8 encoded characters. Following demonstrates a possibility how to convert UTF-16 wchar_t into UTF-8. */ 73 | static char* result = NULL; /* Static variable so it's allocated only once */ 74 | if (!result) { 75 | const wchar_t* name = L"Test Plugin"; 76 | if (wcharToUtf8(name, &result) == -1) { /* Convert name into UTF-8 encoded result */ 77 | result = "Test Plugin"; /* Conversion failed, fallback here */ 78 | } 79 | } 80 | return result; 81 | #else 82 | return "Test Plugin"; 83 | #endif 84 | } 85 | 86 | /* Plugin version */ 87 | const char* ts3plugin_version() 88 | { 89 | return "1.2"; 90 | } 91 | 92 | /* Plugin API version. Must be the same as the clients API major version, else the plugin fails to load. */ 93 | int ts3plugin_apiVersion() 94 | { 95 | return PLUGIN_API_VERSION; 96 | } 97 | 98 | /* Plugin author */ 99 | const char* ts3plugin_author() 100 | { 101 | /* If you want to use wchar_t, see ts3plugin_name() on how to use */ 102 | return "TeamSpeak Systems GmbH"; 103 | } 104 | 105 | /* Plugin description */ 106 | const char* ts3plugin_description() 107 | { 108 | /* If you want to use wchar_t, see ts3plugin_name() on how to use */ 109 | return "This plugin demonstrates the TeamSpeak 3 client plugin architecture."; 110 | } 111 | 112 | /* Set TeamSpeak 3 callback functions */ 113 | void ts3plugin_setFunctionPointers(const struct TS3Functions funcs) 114 | { 115 | ts3Functions = funcs; 116 | } 117 | 118 | /* 119 | * Custom code called right after loading the plugin. Returns 0 on success, 1 on failure. 120 | * If the function returns 1 on failure, the plugin will be unloaded again. 121 | */ 122 | int ts3plugin_init() 123 | { 124 | char appPath[PATH_BUFSIZE]; 125 | char resourcesPath[PATH_BUFSIZE]; 126 | char configPath[PATH_BUFSIZE]; 127 | char pluginPath[PATH_BUFSIZE]; 128 | 129 | /* Your plugin init code here */ 130 | printf("PLUGIN: init\n"); 131 | 132 | /* Example on how to query application, resources and configuration paths from client */ 133 | /* Note: Console client returns empty string for app and resources path */ 134 | ts3Functions.getAppPath(appPath, PATH_BUFSIZE); 135 | ts3Functions.getResourcesPath(resourcesPath, PATH_BUFSIZE); 136 | ts3Functions.getConfigPath(configPath, PATH_BUFSIZE); 137 | ts3Functions.getPluginPath(pluginPath, PATH_BUFSIZE, pluginID); 138 | 139 | printf("PLUGIN: App path: %s\nResources path: %s\nConfig path: %s\nPlugin path: %s\n", appPath, resourcesPath, configPath, pluginPath); 140 | 141 | return 0; /* 0 = success, 1 = failure, -2 = failure but client will not show a "failed to load" warning */ 142 | /* -2 is a very special case and should only be used if a plugin displays a dialog (e.g. overlay) asking the user to disable 143 | * the plugin again, avoiding the show another dialog by the client telling the user the plugin failed to load. 144 | * For normal case, if a plugin really failed to load because of an error, the correct return value is 1. */ 145 | } 146 | 147 | /* Custom code called right before the plugin is unloaded */ 148 | void ts3plugin_shutdown() 149 | { 150 | /* Your plugin cleanup code here */ 151 | printf("PLUGIN: shutdown\n"); 152 | 153 | /* 154 | * Note: 155 | * If your plugin implements a settings dialog, it must be closed and deleted here, else the 156 | * TeamSpeak client will most likely crash (DLL removed but dialog from DLL code still open). 157 | */ 158 | 159 | /* Free pluginID if we registered it */ 160 | if (pluginID) { 161 | free(pluginID); 162 | pluginID = NULL; 163 | } 164 | } 165 | 166 | /****************************** Optional functions ********************************/ 167 | /* 168 | * Following functions are optional, if not needed you don't need to implement them. 169 | */ 170 | 171 | /* Tell client if plugin offers a configuration window. If this function is not implemented, it's an assumed "does not offer" (PLUGIN_OFFERS_NO_CONFIGURE). */ 172 | int ts3plugin_offersConfigure() 173 | { 174 | printf("PLUGIN: offersConfigure\n"); 175 | /* 176 | * Return values: 177 | * PLUGIN_OFFERS_NO_CONFIGURE - Plugin does not implement ts3plugin_configure 178 | * PLUGIN_OFFERS_CONFIGURE_NEW_THREAD - Plugin does implement ts3plugin_configure and requests to run this function in an own thread 179 | * PLUGIN_OFFERS_CONFIGURE_QT_THREAD - Plugin does implement ts3plugin_configure and requests to run this function in the Qt GUI thread 180 | */ 181 | return PLUGIN_OFFERS_NO_CONFIGURE; /* In this case ts3plugin_configure does not need to be implemented */ 182 | } 183 | 184 | /* Plugin might offer a configuration window. If ts3plugin_offersConfigure returns 0, this function does not need to be implemented. */ 185 | void ts3plugin_configure(void* handle, void* qParentWidget) 186 | { 187 | printf("PLUGIN: configure\n"); 188 | } 189 | 190 | /* 191 | * If the plugin wants to use error return codes, plugin commands, hotkeys or menu items, it needs to register a command ID. This function will be 192 | * automatically called after the plugin was initialized. This function is optional. If you don't use these features, this function can be omitted. 193 | * Note the passed pluginID parameter is no longer valid after calling this function, so you must copy it and store it in the plugin. 194 | */ 195 | void ts3plugin_registerPluginID(const char* id) 196 | { 197 | const size_t sz = strlen(id) + 1; 198 | pluginID = (char*)malloc(sz * sizeof(char)); 199 | _strcpy(pluginID, sz, id); /* The id buffer will invalidate after exiting this function */ 200 | printf("PLUGIN: registerPluginID: %s\n", pluginID); 201 | } 202 | 203 | /* Plugin command keyword. Return NULL or "" if not used. */ 204 | const char* ts3plugin_commandKeyword() 205 | { 206 | return "test"; 207 | } 208 | 209 | static void print_and_free_bookmarks_list(struct PluginBookmarkList* list) 210 | { 211 | int i; 212 | for (i = 0; i < list->itemcount; ++i) { 213 | if (list->items[i].isFolder) { 214 | printf("Folder: name=%s\n", list->items[i].name); 215 | print_and_free_bookmarks_list(list->items[i].folder); 216 | ts3Functions.freeMemory(list->items[i].name); 217 | } else { 218 | printf("Bookmark: name=%s uuid=%s\n", list->items[i].name, list->items[i].uuid); 219 | ts3Functions.freeMemory(list->items[i].name); 220 | ts3Functions.freeMemory(list->items[i].uuid); 221 | } 222 | } 223 | ts3Functions.freeMemory(list); 224 | } 225 | 226 | /* Plugin processes console command. Return 0 if plugin handled the command, 1 if not handled. */ 227 | int ts3plugin_processCommand(uint64 serverConnectionHandlerID, const char* command) 228 | { 229 | char buf[COMMAND_BUFSIZE]; 230 | char *s, *param1 = NULL, *param2 = NULL; 231 | int i = 0; 232 | enum { CMD_NONE = 0, CMD_JOIN, CMD_COMMAND, CMD_SERVERINFO, CMD_CHANNELINFO, CMD_AVATAR, CMD_ENABLEMENU, CMD_SUBSCRIBE, CMD_UNSUBSCRIBE, CMD_SUBSCRIBEALL, CMD_UNSUBSCRIBEALL, CMD_BOOKMARKSLIST } cmd = CMD_NONE; 233 | #ifdef _WIN32 234 | char* context = NULL; 235 | #endif 236 | 237 | printf("PLUGIN: process command: '%s'\n", command); 238 | 239 | _strcpy(buf, COMMAND_BUFSIZE, command); 240 | #ifdef _WIN32 241 | s = strtok_s(buf, " ", &context); 242 | #else 243 | s = strtok(buf, " "); 244 | #endif 245 | while (s != NULL) { 246 | if (i == 0) { 247 | if (!strcmp(s, "join")) { 248 | cmd = CMD_JOIN; 249 | } else if (!strcmp(s, "command")) { 250 | cmd = CMD_COMMAND; 251 | } else if (!strcmp(s, "serverinfo")) { 252 | cmd = CMD_SERVERINFO; 253 | } else if (!strcmp(s, "channelinfo")) { 254 | cmd = CMD_CHANNELINFO; 255 | } else if (!strcmp(s, "avatar")) { 256 | cmd = CMD_AVATAR; 257 | } else if (!strcmp(s, "enablemenu")) { 258 | cmd = CMD_ENABLEMENU; 259 | } else if (!strcmp(s, "subscribe")) { 260 | cmd = CMD_SUBSCRIBE; 261 | } else if (!strcmp(s, "unsubscribe")) { 262 | cmd = CMD_UNSUBSCRIBE; 263 | } else if (!strcmp(s, "subscribeall")) { 264 | cmd = CMD_SUBSCRIBEALL; 265 | } else if (!strcmp(s, "unsubscribeall")) { 266 | cmd = CMD_UNSUBSCRIBEALL; 267 | } else if (!strcmp(s, "bookmarkslist")) { 268 | cmd = CMD_BOOKMARKSLIST; 269 | } 270 | } else if (i == 1) { 271 | param1 = s; 272 | } else { 273 | param2 = s; 274 | } 275 | #ifdef _WIN32 276 | s = strtok_s(NULL, " ", &context); 277 | #else 278 | s = strtok(NULL, " "); 279 | #endif 280 | i++; 281 | } 282 | 283 | switch (cmd) { 284 | case CMD_NONE: 285 | return 1; /* Command not handled by plugin */ 286 | case CMD_JOIN: /* /test join [optionalCannelPassword] */ 287 | if (param1) { 288 | uint64 channelID = (uint64)atoi(param1); 289 | char* password = param2 ? param2 : ""; 290 | char returnCode[RETURNCODE_BUFSIZE]; 291 | anyID myID; 292 | 293 | /* Get own clientID */ 294 | if (ts3Functions.getClientID(serverConnectionHandlerID, &myID) != ERROR_ok) { 295 | ts3Functions.logMessage("Error querying client ID", LogLevel_ERROR, "Plugin", serverConnectionHandlerID); 296 | break; 297 | } 298 | 299 | /* Create return code for requestClientMove function call. If creation fails, returnCode will be NULL, which can be 300 | * passed into the client functions meaning no return code is used. 301 | * Note: To use return codes, the plugin needs to register a plugin ID using ts3plugin_registerPluginID */ 302 | ts3Functions.createReturnCode(pluginID, returnCode, RETURNCODE_BUFSIZE); 303 | 304 | /* In a real world plugin, the returnCode should be remembered (e.g. in a dynamic STL vector, if it's a C++ plugin). 305 | * onServerErrorEvent can then check the received returnCode, compare with the remembered ones and thus identify 306 | * which function call has triggered the event and react accordingly. */ 307 | 308 | /* Request joining specified channel using above created return code */ 309 | if (ts3Functions.requestClientMove(serverConnectionHandlerID, myID, channelID, password, returnCode) != ERROR_ok) { 310 | ts3Functions.logMessage("Error requesting client move", LogLevel_INFO, "Plugin", serverConnectionHandlerID); 311 | } 312 | } else { 313 | ts3Functions.printMessageToCurrentTab("Missing channel ID parameter."); 314 | } 315 | break; 316 | case CMD_COMMAND: /* /test command */ 317 | if (param1) { 318 | /* Send plugin command to all clients in current channel. In this case targetIds is unused and can be NULL. */ 319 | if (pluginID) { 320 | /* See ts3plugin_registerPluginID for how to obtain a pluginID */ 321 | printf("PLUGIN: Sending plugin command to current channel: %s\n", param1); 322 | ts3Functions.sendPluginCommand(serverConnectionHandlerID, pluginID, param1, PluginCommandTarget_CURRENT_CHANNEL, NULL, NULL); 323 | } else { 324 | printf("PLUGIN: Failed to send plugin command, was not registered.\n"); 325 | } 326 | } else { 327 | ts3Functions.printMessageToCurrentTab("Missing command parameter."); 328 | } 329 | break; 330 | case CMD_SERVERINFO: { /* /test serverinfo */ 331 | /* Query host, port and server password of current server tab. 332 | * The password parameter can be NULL if the plugin does not want to receive the server password. 333 | * Note: Server password is only available if the user has actually used it when connecting. If a user has 334 | * connected with the permission to ignore passwords (b_virtualserver_join_ignore_password) and the password, 335 | * was not entered, it will not be available. 336 | * getServerConnectInfo returns 0 on success, 1 on error or if current server tab is disconnected. */ 337 | char host[SERVERINFO_BUFSIZE]; 338 | /*char password[SERVERINFO_BUFSIZE];*/ 339 | char* password = NULL; /* Don't receive server password */ 340 | unsigned short port; 341 | if (!ts3Functions.getServerConnectInfo(serverConnectionHandlerID, host, &port, password, SERVERINFO_BUFSIZE)) { 342 | char msg[SERVERINFO_BUFSIZE]; 343 | snprintf(msg, sizeof(msg), "Server Connect Info: %s:%d", host, port); 344 | ts3Functions.printMessageToCurrentTab(msg); 345 | } else { 346 | ts3Functions.printMessageToCurrentTab("No server connect info available."); 347 | } 348 | break; 349 | } 350 | case CMD_CHANNELINFO: { /* /test channelinfo */ 351 | /* Query channel path and password of current server tab. 352 | * The password parameter can be NULL if the plugin does not want to receive the channel password. 353 | * Note: Channel password is only available if the user has actually used it when entering the channel. If a user has 354 | * entered a channel with the permission to ignore passwords (b_channel_join_ignore_password) and the password, 355 | * was not entered, it will not be available. 356 | * getChannelConnectInfo returns 0 on success, 1 on error or if current server tab is disconnected. */ 357 | char path[CHANNELINFO_BUFSIZE]; 358 | /*char password[CHANNELINFO_BUFSIZE];*/ 359 | char* password = NULL; /* Don't receive channel password */ 360 | 361 | /* Get own clientID and channelID */ 362 | anyID myID; 363 | uint64 myChannelID; 364 | if (ts3Functions.getClientID(serverConnectionHandlerID, &myID) != ERROR_ok) { 365 | ts3Functions.logMessage("Error querying client ID", LogLevel_ERROR, "Plugin", serverConnectionHandlerID); 366 | break; 367 | } 368 | /* Get own channel ID */ 369 | if (ts3Functions.getChannelOfClient(serverConnectionHandlerID, myID, &myChannelID) != ERROR_ok) { 370 | ts3Functions.logMessage("Error querying channel ID", LogLevel_ERROR, "Plugin", serverConnectionHandlerID); 371 | break; 372 | } 373 | 374 | /* Get channel connect info of own channel */ 375 | if (!ts3Functions.getChannelConnectInfo(serverConnectionHandlerID, myChannelID, path, password, CHANNELINFO_BUFSIZE)) { 376 | char msg[CHANNELINFO_BUFSIZE]; 377 | snprintf(msg, sizeof(msg), "Channel Connect Info: %s", path); 378 | ts3Functions.printMessageToCurrentTab(msg); 379 | } else { 380 | ts3Functions.printMessageToCurrentTab("No channel connect info available."); 381 | } 382 | break; 383 | } 384 | case CMD_AVATAR: { /* /test avatar */ 385 | char avatarPath[PATH_BUFSIZE]; 386 | anyID clientID = (anyID)atoi(param1); 387 | unsigned int error; 388 | 389 | memset(avatarPath, 0, PATH_BUFSIZE); 390 | error = ts3Functions.getAvatar(serverConnectionHandlerID, clientID, avatarPath, PATH_BUFSIZE); 391 | if (error == ERROR_ok) { /* ERROR_ok means the client has an avatar set. */ 392 | if (strlen(avatarPath)) { /* Avatar path contains the full path to the avatar image in the TS3Client cache directory */ 393 | printf("Avatar path: %s\n", avatarPath); 394 | } else { /* Empty avatar path means the client has an avatar but the image has not yet been cached. The TeamSpeak 395 | * client will automatically start the download and call onAvatarUpdated when done */ 396 | printf("Avatar not yet downloaded, waiting for onAvatarUpdated...\n"); 397 | } 398 | } else if (error == ERROR_database_empty_result) { /* Not an error, the client simply has no avatar set */ 399 | printf("Client has no avatar\n"); 400 | } else { /* Other error occured (invalid server connection handler ID, invalid client ID, file io error etc) */ 401 | printf("Error getting avatar: %d\n", error); 402 | } 403 | break; 404 | } 405 | case CMD_ENABLEMENU: /* /test enablemenu <0|1> */ 406 | if (param1) { 407 | int menuID = atoi(param1); 408 | int enable = param2 ? atoi(param2) : 0; 409 | ts3Functions.setPluginMenuEnabled(pluginID, menuID, enable); 410 | } else { 411 | ts3Functions.printMessageToCurrentTab("Usage is: /test enablemenu <0|1>"); 412 | } 413 | break; 414 | case CMD_SUBSCRIBE: /* /test subscribe */ 415 | if (param1) { 416 | char returnCode[RETURNCODE_BUFSIZE]; 417 | uint64 channelIDArray[2]; 418 | channelIDArray[0] = (uint64)atoi(param1); 419 | channelIDArray[1] = 0; 420 | ts3Functions.createReturnCode(pluginID, returnCode, RETURNCODE_BUFSIZE); 421 | if (ts3Functions.requestChannelSubscribe(serverConnectionHandlerID, channelIDArray, returnCode) != ERROR_ok) { 422 | ts3Functions.logMessage("Error subscribing channel", LogLevel_INFO, "Plugin", serverConnectionHandlerID); 423 | } 424 | } 425 | break; 426 | case CMD_UNSUBSCRIBE: /* /test unsubscribe */ 427 | if (param1) { 428 | char returnCode[RETURNCODE_BUFSIZE]; 429 | uint64 channelIDArray[2]; 430 | channelIDArray[0] = (uint64)atoi(param1); 431 | channelIDArray[1] = 0; 432 | ts3Functions.createReturnCode(pluginID, returnCode, RETURNCODE_BUFSIZE); 433 | if (ts3Functions.requestChannelUnsubscribe(serverConnectionHandlerID, channelIDArray, NULL) != ERROR_ok) { 434 | ts3Functions.logMessage("Error unsubscribing channel", LogLevel_INFO, "Plugin", serverConnectionHandlerID); 435 | } 436 | } 437 | break; 438 | case CMD_SUBSCRIBEALL: { /* /test subscribeall */ 439 | char returnCode[RETURNCODE_BUFSIZE]; 440 | ts3Functions.createReturnCode(pluginID, returnCode, RETURNCODE_BUFSIZE); 441 | if (ts3Functions.requestChannelSubscribeAll(serverConnectionHandlerID, returnCode) != ERROR_ok) { 442 | ts3Functions.logMessage("Error subscribing channel", LogLevel_INFO, "Plugin", serverConnectionHandlerID); 443 | } 444 | break; 445 | } 446 | case CMD_UNSUBSCRIBEALL: { /* /test unsubscribeall */ 447 | char returnCode[RETURNCODE_BUFSIZE]; 448 | ts3Functions.createReturnCode(pluginID, returnCode, RETURNCODE_BUFSIZE); 449 | if (ts3Functions.requestChannelUnsubscribeAll(serverConnectionHandlerID, returnCode) != ERROR_ok) { 450 | ts3Functions.logMessage("Error subscribing channel", LogLevel_INFO, "Plugin", serverConnectionHandlerID); 451 | } 452 | break; 453 | } 454 | case CMD_BOOKMARKSLIST: { /* test bookmarkslist */ 455 | struct PluginBookmarkList* list; 456 | unsigned int error = ts3Functions.getBookmarkList(&list); 457 | if (error == ERROR_ok) { 458 | print_and_free_bookmarks_list(list); 459 | } else { 460 | ts3Functions.logMessage("Error getting bookmarks list", LogLevel_ERROR, "Plugin", serverConnectionHandlerID); 461 | } 462 | break; 463 | } 464 | } 465 | 466 | return 0; /* Plugin handled command */ 467 | } 468 | 469 | /* Client changed current server connection handler */ 470 | void ts3plugin_currentServerConnectionChanged(uint64 serverConnectionHandlerID) 471 | { 472 | printf("PLUGIN: currentServerConnectionChanged %llu (%llu)\n", (long long unsigned int)serverConnectionHandlerID, (long long unsigned int)ts3Functions.getCurrentServerConnectionHandlerID()); 473 | } 474 | 475 | /* 476 | * Implement the following three functions when the plugin should display a line in the server/channel/client info. 477 | * If any of ts3plugin_infoTitle, ts3plugin_infoData or ts3plugin_freeMemory is missing, the info text will not be displayed. 478 | */ 479 | 480 | /* Static title shown in the left column in the info frame */ 481 | const char* ts3plugin_infoTitle() 482 | { 483 | return "Test plugin info"; 484 | } 485 | 486 | /* 487 | * Dynamic content shown in the right column in the info frame. Memory for the data string needs to be allocated in this 488 | * function. The client will call ts3plugin_freeMemory once done with the string to release the allocated memory again. 489 | * Check the parameter "type" if you want to implement this feature only for specific item types. Set the parameter 490 | * "data" to NULL to have the client ignore the info data. 491 | */ 492 | void ts3plugin_infoData(uint64 serverConnectionHandlerID, uint64 id, enum PluginItemType type, char** data) 493 | { 494 | char* name; 495 | 496 | /* For demonstration purpose, display the name of the currently selected server, channel or client. */ 497 | switch (type) { 498 | case PLUGIN_SERVER: 499 | if (ts3Functions.getServerVariableAsString(serverConnectionHandlerID, VIRTUALSERVER_NAME, &name) != ERROR_ok) { 500 | printf("Error getting virtual server name\n"); 501 | return; 502 | } 503 | break; 504 | case PLUGIN_CHANNEL: 505 | if (ts3Functions.getChannelVariableAsString(serverConnectionHandlerID, id, CHANNEL_NAME, &name) != ERROR_ok) { 506 | printf("Error getting channel name\n"); 507 | return; 508 | } 509 | break; 510 | case PLUGIN_CLIENT: 511 | if (ts3Functions.getClientVariableAsString(serverConnectionHandlerID, (anyID)id, CLIENT_NICKNAME, &name) != ERROR_ok) { 512 | printf("Error getting client nickname\n"); 513 | return; 514 | } 515 | break; 516 | default: 517 | printf("Invalid item type: %d\n", type); 518 | data = NULL; /* Ignore */ 519 | return; 520 | } 521 | 522 | *data = (char*)malloc(INFODATA_BUFSIZE * sizeof(char)); /* Must be allocated in the plugin! */ 523 | snprintf(*data, INFODATA_BUFSIZE, "The nickname is [I]\"%s\"[/I]", name); /* bbCode is supported. HTML is not supported */ 524 | ts3Functions.freeMemory(name); 525 | } 526 | 527 | /* Required to release the memory for parameter "data" allocated in ts3plugin_infoData and ts3plugin_initMenus */ 528 | void ts3plugin_freeMemory(void* data) 529 | { 530 | free(data); 531 | } 532 | 533 | /* 534 | * Plugin requests to be always automatically loaded by the TeamSpeak 3 client unless 535 | * the user manually disabled it in the plugin dialog. 536 | * This function is optional. If missing, no autoload is assumed. 537 | */ 538 | int ts3plugin_requestAutoload() 539 | { 540 | return 0; /* 1 = request autoloaded, 0 = do not request autoload */ 541 | } 542 | 543 | /* Helper function to create a menu item */ 544 | static struct PluginMenuItem* createMenuItem(enum PluginMenuType type, int id, const char* text, const char* icon) 545 | { 546 | struct PluginMenuItem* menuItem = (struct PluginMenuItem*)malloc(sizeof(struct PluginMenuItem)); 547 | menuItem->type = type; 548 | menuItem->id = id; 549 | _strcpy(menuItem->text, PLUGIN_MENU_BUFSZ, text); 550 | _strcpy(menuItem->icon, PLUGIN_MENU_BUFSZ, icon); 551 | return menuItem; 552 | } 553 | 554 | /* Some makros to make the code to create menu items a bit more readable */ 555 | #define BEGIN_CREATE_MENUS(x) \ 556 | const size_t sz = x + 1; \ 557 | size_t n = 0; \ 558 | *menuItems = (struct PluginMenuItem**)malloc(sizeof(struct PluginMenuItem*) * sz); 559 | #define CREATE_MENU_ITEM(a, b, c, d) (*menuItems)[n++] = createMenuItem(a, b, c, d); 560 | #define END_CREATE_MENUS \ 561 | (*menuItems)[n++] = NULL; \ 562 | assert(n == sz); 563 | 564 | /* 565 | * Menu IDs for this plugin. Pass these IDs when creating a menuitem to the TS3 client. When the menu item is triggered, 566 | * ts3plugin_onMenuItemEvent will be called passing the menu ID of the triggered menu item. 567 | * These IDs are freely choosable by the plugin author. It's not really needed to use an enum, it just looks prettier. 568 | */ 569 | enum { MENU_ID_CLIENT_1 = 1, MENU_ID_CLIENT_2, MENU_ID_CHANNEL_1, MENU_ID_CHANNEL_2, MENU_ID_CHANNEL_3, MENU_ID_GLOBAL_1, MENU_ID_GLOBAL_2 }; 570 | 571 | /* 572 | * Initialize plugin menus. 573 | * This function is called after ts3plugin_init and ts3plugin_registerPluginID. A pluginID is required for plugin menus to work. 574 | * Both ts3plugin_registerPluginID and ts3plugin_freeMemory must be implemented to use menus. 575 | * If plugin menus are not used by a plugin, do not implement this function or return NULL. 576 | */ 577 | void ts3plugin_initMenus(struct PluginMenuItem*** menuItems, char** menuIcon) 578 | { 579 | /* 580 | * Create the menus 581 | * There are three types of menu items: 582 | * - PLUGIN_MENU_TYPE_CLIENT: Client context menu 583 | * - PLUGIN_MENU_TYPE_CHANNEL: Channel context menu 584 | * - PLUGIN_MENU_TYPE_GLOBAL: "Plugins" menu in menu bar of main window 585 | * 586 | * Menu IDs are used to identify the menu item when ts3plugin_onMenuItemEvent is called 587 | * 588 | * The menu text is required, max length is 128 characters 589 | * 590 | * The icon is optional, max length is 128 characters. When not using icons, just pass an empty string. 591 | * Icons are loaded from a subdirectory in the TeamSpeak client plugins folder. The subdirectory must be named like the 592 | * plugin filename, without dll/so/dylib suffix 593 | * e.g. for "test_plugin.dll", icon "1.png" is loaded from \plugins\test_plugin\1.png 594 | */ 595 | 596 | BEGIN_CREATE_MENUS(7); /* IMPORTANT: Number of menu items must be correct! */ 597 | CREATE_MENU_ITEM(PLUGIN_MENU_TYPE_CLIENT, MENU_ID_CLIENT_1, "Client item 1", "1.png"); 598 | CREATE_MENU_ITEM(PLUGIN_MENU_TYPE_CLIENT, MENU_ID_CLIENT_2, "Client item 2", "2.png"); 599 | CREATE_MENU_ITEM(PLUGIN_MENU_TYPE_CHANNEL, MENU_ID_CHANNEL_1, "Channel item 1", "1.png"); 600 | CREATE_MENU_ITEM(PLUGIN_MENU_TYPE_CHANNEL, MENU_ID_CHANNEL_2, "Channel item 2", "2.png"); 601 | CREATE_MENU_ITEM(PLUGIN_MENU_TYPE_CHANNEL, MENU_ID_CHANNEL_3, "Channel item 3", "3.png"); 602 | CREATE_MENU_ITEM(PLUGIN_MENU_TYPE_GLOBAL, MENU_ID_GLOBAL_1, "Global item 1", "1.png"); 603 | CREATE_MENU_ITEM(PLUGIN_MENU_TYPE_GLOBAL, MENU_ID_GLOBAL_2, "Global item 2", "2.png"); 604 | END_CREATE_MENUS; /* Includes an assert checking if the number of menu items matched */ 605 | 606 | /* 607 | * Specify an optional icon for the plugin. This icon is used for the plugins submenu within context and main menus 608 | * If unused, set menuIcon to NULL 609 | */ 610 | *menuIcon = (char*)malloc(PLUGIN_MENU_BUFSZ * sizeof(char)); 611 | _strcpy(*menuIcon, PLUGIN_MENU_BUFSZ, "t.png"); 612 | 613 | /* 614 | * Menus can be enabled or disabled with: ts3Functions.setPluginMenuEnabled(pluginID, menuID, 0|1); 615 | * Test it with plugin command: /test enablemenu <0|1> 616 | * Menus are enabled by default. Please note that shown menus will not automatically enable or disable when calling this function to 617 | * ensure Qt menus are not modified by any thread other the UI thread. The enabled or disable state will change the next time a 618 | * menu is displayed. 619 | */ 620 | /* For example, this would disable MENU_ID_GLOBAL_2: */ 621 | /* ts3Functions.setPluginMenuEnabled(pluginID, MENU_ID_GLOBAL_2, 0); */ 622 | 623 | /* All memory allocated in this function will be automatically released by the TeamSpeak client later by calling ts3plugin_freeMemory */ 624 | } 625 | 626 | /* Helper function to create a hotkey */ 627 | static struct PluginHotkey* createHotkey(const char* keyword, const char* description) 628 | { 629 | struct PluginHotkey* hotkey = (struct PluginHotkey*)malloc(sizeof(struct PluginHotkey)); 630 | _strcpy(hotkey->keyword, PLUGIN_HOTKEY_BUFSZ, keyword); 631 | _strcpy(hotkey->description, PLUGIN_HOTKEY_BUFSZ, description); 632 | return hotkey; 633 | } 634 | 635 | /* Some makros to make the code to create hotkeys a bit more readable */ 636 | #define BEGIN_CREATE_HOTKEYS(x) \ 637 | const size_t sz = x + 1; \ 638 | size_t n = 0; \ 639 | *hotkeys = (struct PluginHotkey**)malloc(sizeof(struct PluginHotkey*) * sz); 640 | #define CREATE_HOTKEY(a, b) (*hotkeys)[n++] = createHotkey(a, b); 641 | #define END_CREATE_HOTKEYS \ 642 | (*hotkeys)[n++] = NULL; \ 643 | assert(n == sz); 644 | 645 | /* 646 | * Initialize plugin hotkeys. If your plugin does not use this feature, this function can be omitted. 647 | * Hotkeys require ts3plugin_registerPluginID and ts3plugin_freeMemory to be implemented. 648 | * This function is automatically called by the client after ts3plugin_init. 649 | */ 650 | void ts3plugin_initHotkeys(struct PluginHotkey*** hotkeys) 651 | { 652 | /* Register hotkeys giving a keyword and a description. 653 | * The keyword will be later passed to ts3plugin_onHotkeyEvent to identify which hotkey was triggered. 654 | * The description is shown in the clients hotkey dialog. */ 655 | BEGIN_CREATE_HOTKEYS(3); /* Create 3 hotkeys. Size must be correct for allocating memory. */ 656 | CREATE_HOTKEY("keyword_1", "Test hotkey 1"); 657 | CREATE_HOTKEY("keyword_2", "Test hotkey 2"); 658 | CREATE_HOTKEY("keyword_3", "Test hotkey 3"); 659 | END_CREATE_HOTKEYS; 660 | 661 | /* The client will call ts3plugin_freeMemory to release all allocated memory */ 662 | } 663 | 664 | /************************** TeamSpeak callbacks ***************************/ 665 | /* 666 | * Following functions are optional, feel free to remove unused callbacks. 667 | * See the clientlib documentation for details on each function. 668 | */ 669 | 670 | /* Clientlib */ 671 | 672 | void ts3plugin_onConnectStatusChangeEvent(uint64 serverConnectionHandlerID, int newStatus, unsigned int errorNumber) 673 | { 674 | /* Some example code following to show how to use the information query functions. */ 675 | 676 | if (newStatus == STATUS_CONNECTION_ESTABLISHED) { /* connection established and we have client and channels available */ 677 | char* s; 678 | char msg[1024]; 679 | anyID myID; 680 | uint64* ids; 681 | size_t i; 682 | unsigned int error; 683 | 684 | /* Print clientlib version */ 685 | if (ts3Functions.getClientLibVersion(&s) == ERROR_ok) { 686 | printf("PLUGIN: Client lib version: %s\n", s); 687 | ts3Functions.freeMemory(s); /* Release string */ 688 | } else { 689 | ts3Functions.logMessage("Error querying client lib version", LogLevel_ERROR, "Plugin", serverConnectionHandlerID); 690 | return; 691 | } 692 | 693 | /* Write plugin name and version to log */ 694 | snprintf(msg, sizeof(msg), "Plugin %s, Version %s, Author: %s", ts3plugin_name(), ts3plugin_version(), ts3plugin_author()); 695 | ts3Functions.logMessage(msg, LogLevel_INFO, "Plugin", serverConnectionHandlerID); 696 | 697 | /* Print virtual server name */ 698 | if ((error = ts3Functions.getServerVariableAsString(serverConnectionHandlerID, VIRTUALSERVER_NAME, &s)) != ERROR_ok) { 699 | if (error != ERROR_not_connected) { /* Don't spam error in this case (failed to connect) */ 700 | ts3Functions.logMessage("Error querying server name", LogLevel_ERROR, "Plugin", serverConnectionHandlerID); 701 | } 702 | return; 703 | } 704 | printf("PLUGIN: Server name: %s\n", s); 705 | ts3Functions.freeMemory(s); 706 | 707 | /* Print virtual server welcome message */ 708 | if (ts3Functions.getServerVariableAsString(serverConnectionHandlerID, VIRTUALSERVER_WELCOMEMESSAGE, &s) != ERROR_ok) { 709 | ts3Functions.logMessage("Error querying server welcome message", LogLevel_ERROR, "Plugin", serverConnectionHandlerID); 710 | return; 711 | } 712 | printf("PLUGIN: Server welcome message: %s\n", s); 713 | ts3Functions.freeMemory(s); /* Release string */ 714 | 715 | /* Print own client ID and nickname on this server */ 716 | if (ts3Functions.getClientID(serverConnectionHandlerID, &myID) != ERROR_ok) { 717 | ts3Functions.logMessage("Error querying client ID", LogLevel_ERROR, "Plugin", serverConnectionHandlerID); 718 | return; 719 | } 720 | if (ts3Functions.getClientSelfVariableAsString(serverConnectionHandlerID, CLIENT_NICKNAME, &s) != ERROR_ok) { 721 | ts3Functions.logMessage("Error querying client nickname", LogLevel_ERROR, "Plugin", serverConnectionHandlerID); 722 | return; 723 | } 724 | printf("PLUGIN: My client ID = %d, nickname = %s\n", myID, s); 725 | ts3Functions.freeMemory(s); 726 | 727 | /* Print list of all channels on this server */ 728 | if (ts3Functions.getChannelList(serverConnectionHandlerID, &ids) != ERROR_ok) { 729 | ts3Functions.logMessage("Error getting channel list", LogLevel_ERROR, "Plugin", serverConnectionHandlerID); 730 | return; 731 | } 732 | printf("PLUGIN: Available channels:\n"); 733 | for (i = 0; ids[i]; i++) { 734 | /* Query channel name */ 735 | if (ts3Functions.getChannelVariableAsString(serverConnectionHandlerID, ids[i], CHANNEL_NAME, &s) != ERROR_ok) { 736 | ts3Functions.logMessage("Error querying channel name", LogLevel_ERROR, "Plugin", serverConnectionHandlerID); 737 | return; 738 | } 739 | printf("PLUGIN: Channel ID = %llu, name = %s\n", (long long unsigned int)ids[i], s); 740 | ts3Functions.freeMemory(s); 741 | } 742 | ts3Functions.freeMemory(ids); /* Release array */ 743 | 744 | /* Print list of existing server connection handlers */ 745 | printf("PLUGIN: Existing server connection handlers:\n"); 746 | if (ts3Functions.getServerConnectionHandlerList(&ids) != ERROR_ok) { 747 | ts3Functions.logMessage("Error getting server list", LogLevel_ERROR, "Plugin", serverConnectionHandlerID); 748 | return; 749 | } 750 | for (i = 0; ids[i]; i++) { 751 | if ((error = ts3Functions.getServerVariableAsString(ids[i], VIRTUALSERVER_NAME, &s)) != ERROR_ok) { 752 | if (error != ERROR_not_connected) { /* Don't spam error in this case (failed to connect) */ 753 | ts3Functions.logMessage("Error querying server name", LogLevel_ERROR, "Plugin", serverConnectionHandlerID); 754 | } 755 | continue; 756 | } 757 | printf("- %llu - %s\n", (long long unsigned int)ids[i], s); 758 | ts3Functions.freeMemory(s); 759 | } 760 | ts3Functions.freeMemory(ids); 761 | } 762 | } 763 | 764 | void ts3plugin_onNewChannelEvent(uint64 serverConnectionHandlerID, uint64 channelID, uint64 channelParentID) {} 765 | 766 | void ts3plugin_onNewChannelCreatedEvent(uint64 serverConnectionHandlerID, uint64 channelID, uint64 channelParentID, anyID invokerID, const char* invokerName, const char* invokerUniqueIdentifier) {} 767 | 768 | void ts3plugin_onDelChannelEvent(uint64 serverConnectionHandlerID, uint64 channelID, anyID invokerID, const char* invokerName, const char* invokerUniqueIdentifier) {} 769 | 770 | void ts3plugin_onChannelMoveEvent(uint64 serverConnectionHandlerID, uint64 channelID, uint64 newChannelParentID, anyID invokerID, const char* invokerName, const char* invokerUniqueIdentifier) {} 771 | 772 | void ts3plugin_onUpdateChannelEvent(uint64 serverConnectionHandlerID, uint64 channelID) {} 773 | 774 | void ts3plugin_onUpdateChannelEditedEvent(uint64 serverConnectionHandlerID, uint64 channelID, anyID invokerID, const char* invokerName, const char* invokerUniqueIdentifier) {} 775 | 776 | void ts3plugin_onUpdateClientEvent(uint64 serverConnectionHandlerID, anyID clientID, anyID invokerID, const char* invokerName, const char* invokerUniqueIdentifier) {} 777 | 778 | void ts3plugin_onClientMoveEvent(uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility, const char* moveMessage) {} 779 | 780 | void ts3plugin_onClientMoveSubscriptionEvent(uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility) {} 781 | 782 | void ts3plugin_onClientMoveTimeoutEvent(uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility, const char* timeoutMessage) {} 783 | 784 | void ts3plugin_onClientMoveMovedEvent(uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility, anyID moverID, const char* moverName, const char* moverUniqueIdentifier, const char* moveMessage) {} 785 | 786 | void ts3plugin_onClientKickFromChannelEvent(uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility, anyID kickerID, const char* kickerName, const char* kickerUniqueIdentifier, const char* kickMessage) {} 787 | 788 | void ts3plugin_onClientKickFromServerEvent(uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility, anyID kickerID, const char* kickerName, const char* kickerUniqueIdentifier, const char* kickMessage) {} 789 | 790 | void ts3plugin_onClientIDsEvent(uint64 serverConnectionHandlerID, const char* uniqueClientIdentifier, anyID clientID, const char* clientName) {} 791 | 792 | void ts3plugin_onClientIDsFinishedEvent(uint64 serverConnectionHandlerID) {} 793 | 794 | void ts3plugin_onServerEditedEvent(uint64 serverConnectionHandlerID, anyID editerID, const char* editerName, const char* editerUniqueIdentifier) {} 795 | 796 | void ts3plugin_onServerUpdatedEvent(uint64 serverConnectionHandlerID) {} 797 | 798 | int ts3plugin_onServerErrorEvent(uint64 serverConnectionHandlerID, const char* errorMessage, unsigned int error, const char* returnCode, const char* extraMessage) 799 | { 800 | printf("PLUGIN: onServerErrorEvent %llu %s %d %s\n", (long long unsigned int)serverConnectionHandlerID, errorMessage, error, (returnCode ? returnCode : "")); 801 | if (returnCode) { 802 | /* A plugin could now check the returnCode with previously (when calling a function) remembered returnCodes and react accordingly */ 803 | /* In case of using a a plugin return code, the plugin can return: 804 | * 0: Client will continue handling this error (print to chat tab) 805 | * 1: Client will ignore this error, the plugin announces it has handled it */ 806 | return 1; 807 | } 808 | return 0; /* If no plugin return code was used, the return value of this function is ignored */ 809 | } 810 | 811 | void ts3plugin_onServerStopEvent(uint64 serverConnectionHandlerID, const char* shutdownMessage) {} 812 | 813 | int ts3plugin_onTextMessageEvent(uint64 serverConnectionHandlerID, anyID targetMode, anyID toID, anyID fromID, const char* fromName, const char* fromUniqueIdentifier, const char* message, int ffIgnored) 814 | { 815 | printf("PLUGIN: onTextMessageEvent %llu %d %d %s %s %d\n", (long long unsigned int)serverConnectionHandlerID, targetMode, fromID, fromName, message, ffIgnored); 816 | 817 | /* Friend/Foe manager has ignored the message, so ignore here as well. */ 818 | if (ffIgnored) { 819 | return 0; /* Client will ignore the message anyways, so return value here doesn't matter */ 820 | } 821 | 822 | #if 0 823 | { 824 | /* Example code: Autoreply to sender */ 825 | /* Disabled because quite annoying, but should give you some ideas what is possible here */ 826 | /* Careful, when two clients use this, they will get banned quickly... */ 827 | anyID myID; 828 | if(ts3Functions.getClientID(serverConnectionHandlerID, &myID) != ERROR_ok) { 829 | ts3Functions.logMessage("Error querying own client id", LogLevel_ERROR, "Plugin", serverConnectionHandlerID); 830 | return 0; 831 | } 832 | if(fromID != myID) { /* Don't reply when source is own client */ 833 | if(ts3Functions.requestSendPrivateTextMsg(serverConnectionHandlerID, "Text message back!", fromID, NULL) != ERROR_ok) { 834 | ts3Functions.logMessage("Error requesting send text message", LogLevel_ERROR, "Plugin", serverConnectionHandlerID); 835 | } 836 | } 837 | } 838 | #endif 839 | 840 | return 0; /* 0 = handle normally, 1 = client will ignore the text message */ 841 | } 842 | 843 | void ts3plugin_onTalkStatusChangeEvent(uint64 serverConnectionHandlerID, int status, int isReceivedWhisper, anyID clientID) 844 | { 845 | /* Demonstrate usage of getClientDisplayName */ 846 | char name[512]; 847 | if (ts3Functions.getClientDisplayName(serverConnectionHandlerID, clientID, name, 512) == ERROR_ok) { 848 | if (status == STATUS_TALKING) { 849 | printf("--> %s starts talking\n", name); 850 | } else { 851 | printf("--> %s stops talking\n", name); 852 | } 853 | } 854 | } 855 | 856 | void ts3plugin_onConnectionInfoEvent(uint64 serverConnectionHandlerID, anyID clientID) {} 857 | 858 | void ts3plugin_onServerConnectionInfoEvent(uint64 serverConnectionHandlerID) {} 859 | 860 | void ts3plugin_onChannelSubscribeEvent(uint64 serverConnectionHandlerID, uint64 channelID) {} 861 | 862 | void ts3plugin_onChannelSubscribeFinishedEvent(uint64 serverConnectionHandlerID) {} 863 | 864 | void ts3plugin_onChannelUnsubscribeEvent(uint64 serverConnectionHandlerID, uint64 channelID) {} 865 | 866 | void ts3plugin_onChannelUnsubscribeFinishedEvent(uint64 serverConnectionHandlerID) {} 867 | 868 | void ts3plugin_onChannelDescriptionUpdateEvent(uint64 serverConnectionHandlerID, uint64 channelID) {} 869 | 870 | void ts3plugin_onChannelPasswordChangedEvent(uint64 serverConnectionHandlerID, uint64 channelID) {} 871 | 872 | void ts3plugin_onPlaybackShutdownCompleteEvent(uint64 serverConnectionHandlerID) {} 873 | 874 | void ts3plugin_onSoundDeviceListChangedEvent(const char* modeID, int playOrCap) {} 875 | 876 | void ts3plugin_onEditPlaybackVoiceDataEvent(uint64 serverConnectionHandlerID, anyID clientID, short* samples, int sampleCount, int channels) {} 877 | 878 | void ts3plugin_onEditPostProcessVoiceDataEvent(uint64 serverConnectionHandlerID, anyID clientID, short* samples, int sampleCount, int channels, const unsigned int* channelSpeakerArray, unsigned int* channelFillMask) {} 879 | 880 | void ts3plugin_onEditMixedPlaybackVoiceDataEvent(uint64 serverConnectionHandlerID, short* samples, int sampleCount, int channels, const unsigned int* channelSpeakerArray, unsigned int* channelFillMask) {} 881 | 882 | void ts3plugin_onEditCapturedVoiceDataEvent(uint64 serverConnectionHandlerID, short* samples, int sampleCount, int channels, int* edited) {} 883 | 884 | void ts3plugin_onCustom3dRolloffCalculationClientEvent(uint64 serverConnectionHandlerID, anyID clientID, float distance, float* volume) {} 885 | 886 | void ts3plugin_onCustom3dRolloffCalculationWaveEvent(uint64 serverConnectionHandlerID, uint64 waveHandle, float distance, float* volume) {} 887 | 888 | void ts3plugin_onUserLoggingMessageEvent(const char* logMessage, int logLevel, const char* logChannel, uint64 logID, const char* logTime, const char* completeLogString) {} 889 | 890 | /* Clientlib rare */ 891 | 892 | void ts3plugin_onClientBanFromServerEvent(uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility, anyID kickerID, const char* kickerName, const char* kickerUniqueIdentifier, uint64 time, 893 | const char* kickMessage) 894 | { 895 | } 896 | 897 | int ts3plugin_onClientPokeEvent(uint64 serverConnectionHandlerID, anyID fromClientID, const char* pokerName, const char* pokerUniqueIdentity, const char* message, int ffIgnored) 898 | { 899 | anyID myID; 900 | 901 | printf("PLUGIN onClientPokeEvent: %llu %d %s %s %d\n", (long long unsigned int)serverConnectionHandlerID, fromClientID, pokerName, message, ffIgnored); 902 | 903 | /* Check if the Friend/Foe manager has already blocked this poke */ 904 | if (ffIgnored) { 905 | return 0; /* Client will block anyways, doesn't matter what we return */ 906 | } 907 | 908 | /* Example code: Send text message back to poking client */ 909 | if (ts3Functions.getClientID(serverConnectionHandlerID, &myID) != ERROR_ok) { /* Get own client ID */ 910 | ts3Functions.logMessage("Error querying own client id", LogLevel_ERROR, "Plugin", serverConnectionHandlerID); 911 | return 0; 912 | } 913 | if (fromClientID != myID) { /* Don't reply when source is own client */ 914 | if (ts3Functions.requestSendPrivateTextMsg(serverConnectionHandlerID, "Received your poke!", fromClientID, NULL) != ERROR_ok) { 915 | ts3Functions.logMessage("Error requesting send text message", LogLevel_ERROR, "Plugin", serverConnectionHandlerID); 916 | } 917 | } 918 | 919 | return 0; /* 0 = handle normally, 1 = client will ignore the poke */ 920 | } 921 | 922 | void ts3plugin_onClientSelfVariableUpdateEvent(uint64 serverConnectionHandlerID, int flag, const char* oldValue, const char* newValue) {} 923 | 924 | void ts3plugin_onFileListEvent(uint64 serverConnectionHandlerID, uint64 channelID, const char* path, const char* name, uint64 size, uint64 datetime, int type, uint64 incompletesize, const char* returnCode) {} 925 | 926 | void ts3plugin_onFileListFinishedEvent(uint64 serverConnectionHandlerID, uint64 channelID, const char* path) {} 927 | 928 | void ts3plugin_onFileInfoEvent(uint64 serverConnectionHandlerID, uint64 channelID, const char* name, uint64 size, uint64 datetime) {} 929 | 930 | void ts3plugin_onServerGroupListEvent(uint64 serverConnectionHandlerID, uint64 serverGroupID, const char* name, int type, int iconID, int saveDB) {} 931 | 932 | void ts3plugin_onServerGroupListFinishedEvent(uint64 serverConnectionHandlerID) {} 933 | 934 | void ts3plugin_onServerGroupByClientIDEvent(uint64 serverConnectionHandlerID, const char* name, uint64 serverGroupList, uint64 clientDatabaseID) {} 935 | 936 | void ts3plugin_onServerGroupPermListEvent(uint64 serverConnectionHandlerID, uint64 serverGroupID, unsigned int permissionID, int permissionValue, int permissionNegated, int permissionSkip) {} 937 | 938 | void ts3plugin_onServerGroupPermListFinishedEvent(uint64 serverConnectionHandlerID, uint64 serverGroupID) {} 939 | 940 | void ts3plugin_onServerGroupClientListEvent(uint64 serverConnectionHandlerID, uint64 serverGroupID, uint64 clientDatabaseID, const char* clientNameIdentifier, const char* clientUniqueID) {} 941 | 942 | void ts3plugin_onChannelGroupListEvent(uint64 serverConnectionHandlerID, uint64 channelGroupID, const char* name, int type, int iconID, int saveDB) {} 943 | 944 | void ts3plugin_onChannelGroupListFinishedEvent(uint64 serverConnectionHandlerID) {} 945 | 946 | void ts3plugin_onChannelGroupPermListEvent(uint64 serverConnectionHandlerID, uint64 channelGroupID, unsigned int permissionID, int permissionValue, int permissionNegated, int permissionSkip) {} 947 | 948 | void ts3plugin_onChannelGroupPermListFinishedEvent(uint64 serverConnectionHandlerID, uint64 channelGroupID) {} 949 | 950 | void ts3plugin_onChannelPermListEvent(uint64 serverConnectionHandlerID, uint64 channelID, unsigned int permissionID, int permissionValue, int permissionNegated, int permissionSkip) {} 951 | 952 | void ts3plugin_onChannelPermListFinishedEvent(uint64 serverConnectionHandlerID, uint64 channelID) {} 953 | 954 | void ts3plugin_onClientPermListEvent(uint64 serverConnectionHandlerID, uint64 clientDatabaseID, unsigned int permissionID, int permissionValue, int permissionNegated, int permissionSkip) {} 955 | 956 | void ts3plugin_onClientPermListFinishedEvent(uint64 serverConnectionHandlerID, uint64 clientDatabaseID) {} 957 | 958 | void ts3plugin_onChannelClientPermListEvent(uint64 serverConnectionHandlerID, uint64 channelID, uint64 clientDatabaseID, unsigned int permissionID, int permissionValue, int permissionNegated, int permissionSkip) {} 959 | 960 | void ts3plugin_onChannelClientPermListFinishedEvent(uint64 serverConnectionHandlerID, uint64 channelID, uint64 clientDatabaseID) {} 961 | 962 | void ts3plugin_onClientChannelGroupChangedEvent(uint64 serverConnectionHandlerID, uint64 channelGroupID, uint64 channelID, anyID clientID, anyID invokerClientID, const char* invokerName, const char* invokerUniqueIdentity) {} 963 | 964 | int ts3plugin_onServerPermissionErrorEvent(uint64 serverConnectionHandlerID, const char* errorMessage, unsigned int error, const char* returnCode, unsigned int failedPermissionID) 965 | { 966 | return 0; /* See onServerErrorEvent for return code description */ 967 | } 968 | 969 | void ts3plugin_onPermissionListGroupEndIDEvent(uint64 serverConnectionHandlerID, unsigned int groupEndID) {} 970 | 971 | void ts3plugin_onPermissionListEvent(uint64 serverConnectionHandlerID, unsigned int permissionID, const char* permissionName, const char* permissionDescription) {} 972 | 973 | void ts3plugin_onPermissionListFinishedEvent(uint64 serverConnectionHandlerID) {} 974 | 975 | void ts3plugin_onPermissionOverviewEvent(uint64 serverConnectionHandlerID, uint64 clientDatabaseID, uint64 channelID, int overviewType, uint64 overviewID1, uint64 overviewID2, unsigned int permissionID, int permissionValue, int permissionNegated, 976 | int permissionSkip) 977 | { 978 | } 979 | 980 | void ts3plugin_onPermissionOverviewFinishedEvent(uint64 serverConnectionHandlerID) {} 981 | 982 | void ts3plugin_onServerGroupClientAddedEvent(uint64 serverConnectionHandlerID, anyID clientID, const char* clientName, const char* clientUniqueIdentity, uint64 serverGroupID, anyID invokerClientID, const char* invokerName, 983 | const char* invokerUniqueIdentity) 984 | { 985 | } 986 | 987 | void ts3plugin_onServerGroupClientDeletedEvent(uint64 serverConnectionHandlerID, anyID clientID, const char* clientName, const char* clientUniqueIdentity, uint64 serverGroupID, anyID invokerClientID, const char* invokerName, 988 | const char* invokerUniqueIdentity) 989 | { 990 | } 991 | 992 | void ts3plugin_onClientNeededPermissionsEvent(uint64 serverConnectionHandlerID, unsigned int permissionID, int permissionValue) {} 993 | 994 | void ts3plugin_onClientNeededPermissionsFinishedEvent(uint64 serverConnectionHandlerID) {} 995 | 996 | void ts3plugin_onFileTransferStatusEvent(anyID transferID, unsigned int status, const char* statusMessage, uint64 remotefileSize, uint64 serverConnectionHandlerID) {} 997 | 998 | void ts3plugin_onClientChatClosedEvent(uint64 serverConnectionHandlerID, anyID clientID, const char* clientUniqueIdentity) {} 999 | 1000 | void ts3plugin_onClientChatComposingEvent(uint64 serverConnectionHandlerID, anyID clientID, const char* clientUniqueIdentity) {} 1001 | 1002 | void ts3plugin_onServerLogEvent(uint64 serverConnectionHandlerID, const char* logMsg) {} 1003 | 1004 | void ts3plugin_onServerLogFinishedEvent(uint64 serverConnectionHandlerID, uint64 lastPos, uint64 fileSize) {} 1005 | 1006 | void ts3plugin_onMessageListEvent(uint64 serverConnectionHandlerID, uint64 messageID, const char* fromClientUniqueIdentity, const char* subject, uint64 timestamp, int flagRead) {} 1007 | 1008 | void ts3plugin_onMessageGetEvent(uint64 serverConnectionHandlerID, uint64 messageID, const char* fromClientUniqueIdentity, const char* subject, const char* message, uint64 timestamp) {} 1009 | 1010 | void ts3plugin_onClientDBIDfromUIDEvent(uint64 serverConnectionHandlerID, const char* uniqueClientIdentifier, uint64 clientDatabaseID) {} 1011 | 1012 | void ts3plugin_onClientNamefromUIDEvent(uint64 serverConnectionHandlerID, const char* uniqueClientIdentifier, uint64 clientDatabaseID, const char* clientNickName) {} 1013 | 1014 | void ts3plugin_onClientNamefromDBIDEvent(uint64 serverConnectionHandlerID, const char* uniqueClientIdentifier, uint64 clientDatabaseID, const char* clientNickName) {} 1015 | 1016 | void ts3plugin_onComplainListEvent(uint64 serverConnectionHandlerID, uint64 targetClientDatabaseID, const char* targetClientNickName, uint64 fromClientDatabaseID, const char* fromClientNickName, const char* complainReason, uint64 timestamp) {} 1017 | 1018 | void ts3plugin_onBanListEvent(uint64 serverConnectionHandlerID, uint64 banid, const char* ip, const char* name, const char* uid, const char* mytsid, uint64 creationTime, uint64 durationTime, const char* invokerName, uint64 invokercldbid, 1019 | const char* invokeruid, const char* reason, int numberOfEnforcements, const char* lastNickName) 1020 | { 1021 | } 1022 | 1023 | void ts3plugin_onClientServerQueryLoginPasswordEvent(uint64 serverConnectionHandlerID, const char* loginPassword) {} 1024 | 1025 | void ts3plugin_onPluginCommandEvent(uint64 serverConnectionHandlerID, const char* pluginName, const char* pluginCommand, anyID invokerClientID, const char* invokerName, const char* invokerUniqueIdentity) 1026 | { 1027 | printf("ON PLUGIN COMMAND: %s %s %d %s %s\n", pluginName, pluginCommand, invokerClientID, invokerName, invokerUniqueIdentity); 1028 | } 1029 | 1030 | void ts3plugin_onIncomingClientQueryEvent(uint64 serverConnectionHandlerID, const char* commandText) {} 1031 | 1032 | void ts3plugin_onServerTemporaryPasswordListEvent(uint64 serverConnectionHandlerID, const char* clientNickname, const char* uniqueClientIdentifier, const char* description, const char* password, uint64 timestampStart, uint64 timestampEnd, 1033 | uint64 targetChannelID, const char* targetChannelPW) 1034 | { 1035 | } 1036 | 1037 | /* Client UI callbacks */ 1038 | 1039 | /* 1040 | * Called from client when an avatar image has been downloaded to or deleted from cache. 1041 | * This callback can be called spontaneously or in response to ts3Functions.getAvatar() 1042 | */ 1043 | void ts3plugin_onAvatarUpdated(uint64 serverConnectionHandlerID, anyID clientID, const char* avatarPath) 1044 | { 1045 | /* If avatarPath is NULL, the avatar got deleted */ 1046 | /* If not NULL, avatarPath contains the path to the avatar file in the TS3Client cache */ 1047 | if (avatarPath != NULL) { 1048 | printf("onAvatarUpdated: %llu %d %s\n", (long long unsigned int)serverConnectionHandlerID, clientID, avatarPath); 1049 | } else { 1050 | printf("onAvatarUpdated: %llu %d - deleted\n", (long long unsigned int)serverConnectionHandlerID, clientID); 1051 | } 1052 | } 1053 | 1054 | /* 1055 | * Called when a plugin menu item (see ts3plugin_initMenus) is triggered. Optional function, when not using plugin menus, do not implement this. 1056 | * 1057 | * Parameters: 1058 | * - serverConnectionHandlerID: ID of the current server tab 1059 | * - type: Type of the menu (PLUGIN_MENU_TYPE_CHANNEL, PLUGIN_MENU_TYPE_CLIENT or PLUGIN_MENU_TYPE_GLOBAL) 1060 | * - menuItemID: Id used when creating the menu item 1061 | * - selectedItemID: Channel or Client ID in the case of PLUGIN_MENU_TYPE_CHANNEL and PLUGIN_MENU_TYPE_CLIENT. 0 for PLUGIN_MENU_TYPE_GLOBAL. 1062 | */ 1063 | void ts3plugin_onMenuItemEvent(uint64 serverConnectionHandlerID, enum PluginMenuType type, int menuItemID, uint64 selectedItemID) 1064 | { 1065 | printf("PLUGIN: onMenuItemEvent: serverConnectionHandlerID=%llu, type=%d, menuItemID=%d, selectedItemID=%llu\n", (long long unsigned int)serverConnectionHandlerID, type, menuItemID, (long long unsigned int)selectedItemID); 1066 | switch (type) { 1067 | case PLUGIN_MENU_TYPE_GLOBAL: 1068 | /* Global menu item was triggered. selectedItemID is unused and set to zero. */ 1069 | switch (menuItemID) { 1070 | case MENU_ID_GLOBAL_1: 1071 | /* Menu global 1 was triggered */ 1072 | break; 1073 | case MENU_ID_GLOBAL_2: 1074 | /* Menu global 2 was triggered */ 1075 | break; 1076 | default: 1077 | break; 1078 | } 1079 | break; 1080 | case PLUGIN_MENU_TYPE_CHANNEL: 1081 | /* Channel contextmenu item was triggered. selectedItemID is the channelID of the selected channel */ 1082 | switch (menuItemID) { 1083 | case MENU_ID_CHANNEL_1: 1084 | /* Menu channel 1 was triggered */ 1085 | break; 1086 | case MENU_ID_CHANNEL_2: 1087 | /* Menu channel 2 was triggered */ 1088 | break; 1089 | case MENU_ID_CHANNEL_3: 1090 | /* Menu channel 3 was triggered */ 1091 | break; 1092 | default: 1093 | break; 1094 | } 1095 | break; 1096 | case PLUGIN_MENU_TYPE_CLIENT: 1097 | /* Client contextmenu item was triggered. selectedItemID is the clientID of the selected client */ 1098 | switch (menuItemID) { 1099 | case MENU_ID_CLIENT_1: 1100 | /* Menu client 1 was triggered */ 1101 | break; 1102 | case MENU_ID_CLIENT_2: 1103 | /* Menu client 2 was triggered */ 1104 | break; 1105 | default: 1106 | break; 1107 | } 1108 | break; 1109 | default: 1110 | break; 1111 | } 1112 | } 1113 | 1114 | /* This function is called if a plugin hotkey was pressed. Omit if hotkeys are unused. */ 1115 | void ts3plugin_onHotkeyEvent(const char* keyword) 1116 | { 1117 | printf("PLUGIN: Hotkey event: %s\n", keyword); 1118 | /* Identify the hotkey by keyword ("keyword_1", "keyword_2" or "keyword_3" in this example) and handle here... */ 1119 | } 1120 | 1121 | /* Called when recording a hotkey has finished after calling ts3Functions.requestHotkeyInputDialog */ 1122 | void ts3plugin_onHotkeyRecordedEvent(const char* keyword, const char* key) {} 1123 | 1124 | // This function receives your key Identifier you send to notifyKeyEvent and should return 1125 | // the friendly device name of the device this hotkey originates from. Used for display in UI. 1126 | const char* ts3plugin_keyDeviceName(const char* keyIdentifier) 1127 | { 1128 | return NULL; 1129 | } 1130 | 1131 | // This function translates the given key identifier to a friendly key name for display in the UI 1132 | const char* ts3plugin_displayKeyText(const char* keyIdentifier) 1133 | { 1134 | return NULL; 1135 | } 1136 | 1137 | // This is used internally as a prefix for hotkeys so we can store them without collisions. 1138 | // Should be unique across plugins. 1139 | const char* ts3plugin_keyPrefix() 1140 | { 1141 | return NULL; 1142 | } 1143 | 1144 | /* Called when client custom nickname changed */ 1145 | void ts3plugin_onClientDisplayNameChanged(uint64 serverConnectionHandlerID, anyID clientID, const char* displayName, const char* uniqueClientIdentifier) {} 1146 | -------------------------------------------------------------------------------- /src/plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * TeamSpeak 3 demo plugin 3 | * 4 | * Copyright (c) TeamSpeak Systems GmbH 5 | */ 6 | 7 | #ifndef PLUGIN_H 8 | #define PLUGIN_H 9 | 10 | #if defined(WIN32) || defined(__WIN32__) || defined(_WIN32) 11 | #define PLUGINS_EXPORTDLL __declspec(dllexport) 12 | #else 13 | #define PLUGINS_EXPORTDLL __attribute__((visibility("default"))) 14 | #endif 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | /* Required functions */ 21 | PLUGINS_EXPORTDLL const char* ts3plugin_name(); 22 | PLUGINS_EXPORTDLL const char* ts3plugin_version(); 23 | PLUGINS_EXPORTDLL int ts3plugin_apiVersion(); 24 | PLUGINS_EXPORTDLL const char* ts3plugin_author(); 25 | PLUGINS_EXPORTDLL const char* ts3plugin_description(); 26 | PLUGINS_EXPORTDLL void ts3plugin_setFunctionPointers(const struct TS3Functions funcs); 27 | PLUGINS_EXPORTDLL int ts3plugin_init(); 28 | PLUGINS_EXPORTDLL void ts3plugin_shutdown(); 29 | 30 | /* Optional functions */ 31 | PLUGINS_EXPORTDLL int ts3plugin_offersConfigure(); 32 | PLUGINS_EXPORTDLL void ts3plugin_configure(void* handle, void* qParentWidget); 33 | PLUGINS_EXPORTDLL void ts3plugin_registerPluginID(const char* id); 34 | PLUGINS_EXPORTDLL const char* ts3plugin_commandKeyword(); 35 | PLUGINS_EXPORTDLL int ts3plugin_processCommand(uint64 serverConnectionHandlerID, const char* command); 36 | PLUGINS_EXPORTDLL void ts3plugin_currentServerConnectionChanged(uint64 serverConnectionHandlerID); 37 | PLUGINS_EXPORTDLL const char* ts3plugin_infoTitle(); 38 | PLUGINS_EXPORTDLL void ts3plugin_infoData(uint64 serverConnectionHandlerID, uint64 id, enum PluginItemType type, char** data); 39 | PLUGINS_EXPORTDLL void ts3plugin_freeMemory(void* data); 40 | PLUGINS_EXPORTDLL int ts3plugin_requestAutoload(); 41 | PLUGINS_EXPORTDLL void ts3plugin_initMenus(struct PluginMenuItem*** menuItems, char** menuIcon); 42 | PLUGINS_EXPORTDLL void ts3plugin_initHotkeys(struct PluginHotkey*** hotkeys); 43 | 44 | /* Clientlib */ 45 | PLUGINS_EXPORTDLL void ts3plugin_onConnectStatusChangeEvent(uint64 serverConnectionHandlerID, int newStatus, unsigned int errorNumber); 46 | PLUGINS_EXPORTDLL void ts3plugin_onNewChannelEvent(uint64 serverConnectionHandlerID, uint64 channelID, uint64 channelParentID); 47 | PLUGINS_EXPORTDLL void ts3plugin_onNewChannelCreatedEvent(uint64 serverConnectionHandlerID, uint64 channelID, uint64 channelParentID, anyID invokerID, const char* invokerName, const char* invokerUniqueIdentifier); 48 | PLUGINS_EXPORTDLL void ts3plugin_onDelChannelEvent(uint64 serverConnectionHandlerID, uint64 channelID, anyID invokerID, const char* invokerName, const char* invokerUniqueIdentifier); 49 | PLUGINS_EXPORTDLL void ts3plugin_onChannelMoveEvent(uint64 serverConnectionHandlerID, uint64 channelID, uint64 newChannelParentID, anyID invokerID, const char* invokerName, const char* invokerUniqueIdentifier); 50 | PLUGINS_EXPORTDLL void ts3plugin_onUpdateChannelEvent(uint64 serverConnectionHandlerID, uint64 channelID); 51 | PLUGINS_EXPORTDLL void ts3plugin_onUpdateChannelEditedEvent(uint64 serverConnectionHandlerID, uint64 channelID, anyID invokerID, const char* invokerName, const char* invokerUniqueIdentifier); 52 | PLUGINS_EXPORTDLL void ts3plugin_onUpdateClientEvent(uint64 serverConnectionHandlerID, anyID clientID, anyID invokerID, const char* invokerName, const char* invokerUniqueIdentifier); 53 | PLUGINS_EXPORTDLL void ts3plugin_onClientMoveEvent(uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility, const char* moveMessage); 54 | PLUGINS_EXPORTDLL void ts3plugin_onClientMoveSubscriptionEvent(uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility); 55 | PLUGINS_EXPORTDLL void ts3plugin_onClientMoveTimeoutEvent(uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility, const char* timeoutMessage); 56 | PLUGINS_EXPORTDLL void ts3plugin_onClientMoveMovedEvent(uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility, anyID moverID, const char* moverName, const char* moverUniqueIdentifier, 57 | const char* moveMessage); 58 | PLUGINS_EXPORTDLL void ts3plugin_onClientKickFromChannelEvent(uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility, anyID kickerID, const char* kickerName, const char* kickerUniqueIdentifier, 59 | const char* kickMessage); 60 | PLUGINS_EXPORTDLL void ts3plugin_onClientKickFromServerEvent(uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility, anyID kickerID, const char* kickerName, const char* kickerUniqueIdentifier, 61 | const char* kickMessage); 62 | PLUGINS_EXPORTDLL void ts3plugin_onClientIDsEvent(uint64 serverConnectionHandlerID, const char* uniqueClientIdentifier, anyID clientID, const char* clientName); 63 | PLUGINS_EXPORTDLL void ts3plugin_onClientIDsFinishedEvent(uint64 serverConnectionHandlerID); 64 | PLUGINS_EXPORTDLL void ts3plugin_onServerEditedEvent(uint64 serverConnectionHandlerID, anyID editerID, const char* editerName, const char* editerUniqueIdentifier); 65 | PLUGINS_EXPORTDLL void ts3plugin_onServerUpdatedEvent(uint64 serverConnectionHandlerID); 66 | PLUGINS_EXPORTDLL int ts3plugin_onServerErrorEvent(uint64 serverConnectionHandlerID, const char* errorMessage, unsigned int error, const char* returnCode, const char* extraMessage); 67 | PLUGINS_EXPORTDLL void ts3plugin_onServerStopEvent(uint64 serverConnectionHandlerID, const char* shutdownMessage); 68 | PLUGINS_EXPORTDLL int ts3plugin_onTextMessageEvent(uint64 serverConnectionHandlerID, anyID targetMode, anyID toID, anyID fromID, const char* fromName, const char* fromUniqueIdentifier, const char* message, int ffIgnored); 69 | PLUGINS_EXPORTDLL void ts3plugin_onTalkStatusChangeEvent(uint64 serverConnectionHandlerID, int status, int isReceivedWhisper, anyID clientID); 70 | PLUGINS_EXPORTDLL void ts3plugin_onConnectionInfoEvent(uint64 serverConnectionHandlerID, anyID clientID); 71 | PLUGINS_EXPORTDLL void ts3plugin_onServerConnectionInfoEvent(uint64 serverConnectionHandlerID); 72 | PLUGINS_EXPORTDLL void ts3plugin_onChannelSubscribeEvent(uint64 serverConnectionHandlerID, uint64 channelID); 73 | PLUGINS_EXPORTDLL void ts3plugin_onChannelSubscribeFinishedEvent(uint64 serverConnectionHandlerID); 74 | PLUGINS_EXPORTDLL void ts3plugin_onChannelUnsubscribeEvent(uint64 serverConnectionHandlerID, uint64 channelID); 75 | PLUGINS_EXPORTDLL void ts3plugin_onChannelUnsubscribeFinishedEvent(uint64 serverConnectionHandlerID); 76 | PLUGINS_EXPORTDLL void ts3plugin_onChannelDescriptionUpdateEvent(uint64 serverConnectionHandlerID, uint64 channelID); 77 | PLUGINS_EXPORTDLL void ts3plugin_onChannelPasswordChangedEvent(uint64 serverConnectionHandlerID, uint64 channelID); 78 | PLUGINS_EXPORTDLL void ts3plugin_onPlaybackShutdownCompleteEvent(uint64 serverConnectionHandlerID); 79 | PLUGINS_EXPORTDLL void ts3plugin_onSoundDeviceListChangedEvent(const char* modeID, int playOrCap); 80 | PLUGINS_EXPORTDLL void ts3plugin_onEditPlaybackVoiceDataEvent(uint64 serverConnectionHandlerID, anyID clientID, short* samples, int sampleCount, int channels); 81 | PLUGINS_EXPORTDLL void ts3plugin_onEditPostProcessVoiceDataEvent(uint64 serverConnectionHandlerID, anyID clientID, short* samples, int sampleCount, int channels, const unsigned int* channelSpeakerArray, unsigned int* channelFillMask); 82 | PLUGINS_EXPORTDLL void ts3plugin_onEditMixedPlaybackVoiceDataEvent(uint64 serverConnectionHandlerID, short* samples, int sampleCount, int channels, const unsigned int* channelSpeakerArray, unsigned int* channelFillMask); 83 | PLUGINS_EXPORTDLL void ts3plugin_onEditCapturedVoiceDataEvent(uint64 serverConnectionHandlerID, short* samples, int sampleCount, int channels, int* edited); 84 | PLUGINS_EXPORTDLL void ts3plugin_onCustom3dRolloffCalculationClientEvent(uint64 serverConnectionHandlerID, anyID clientID, float distance, float* volume); 85 | PLUGINS_EXPORTDLL void ts3plugin_onCustom3dRolloffCalculationWaveEvent(uint64 serverConnectionHandlerID, uint64 waveHandle, float distance, float* volume); 86 | PLUGINS_EXPORTDLL void ts3plugin_onUserLoggingMessageEvent(const char* logMessage, int logLevel, const char* logChannel, uint64 logID, const char* logTime, const char* completeLogString); 87 | 88 | /* Clientlib rare */ 89 | PLUGINS_EXPORTDLL void ts3plugin_onClientBanFromServerEvent(uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility, anyID kickerID, const char* kickerName, const char* kickerUniqueIdentifier, uint64 time, 90 | const char* kickMessage); 91 | PLUGINS_EXPORTDLL int ts3plugin_onClientPokeEvent(uint64 serverConnectionHandlerID, anyID fromClientID, const char* pokerName, const char* pokerUniqueIdentity, const char* message, int ffIgnored); 92 | PLUGINS_EXPORTDLL void ts3plugin_onClientSelfVariableUpdateEvent(uint64 serverConnectionHandlerID, int flag, const char* oldValue, const char* newValue); 93 | PLUGINS_EXPORTDLL void ts3plugin_onFileListEvent(uint64 serverConnectionHandlerID, uint64 channelID, const char* path, const char* name, uint64 size, uint64 datetime, int type, uint64 incompletesize, const char* returnCode); 94 | PLUGINS_EXPORTDLL void ts3plugin_onFileListFinishedEvent(uint64 serverConnectionHandlerID, uint64 channelID, const char* path); 95 | PLUGINS_EXPORTDLL void ts3plugin_onFileInfoEvent(uint64 serverConnectionHandlerID, uint64 channelID, const char* name, uint64 size, uint64 datetime); 96 | PLUGINS_EXPORTDLL void ts3plugin_onServerGroupListEvent(uint64 serverConnectionHandlerID, uint64 serverGroupID, const char* name, int type, int iconID, int saveDB); 97 | PLUGINS_EXPORTDLL void ts3plugin_onServerGroupListFinishedEvent(uint64 serverConnectionHandlerID); 98 | PLUGINS_EXPORTDLL void ts3plugin_onServerGroupByClientIDEvent(uint64 serverConnectionHandlerID, const char* name, uint64 serverGroupList, uint64 clientDatabaseID); 99 | PLUGINS_EXPORTDLL void ts3plugin_onServerGroupPermListEvent(uint64 serverConnectionHandlerID, uint64 serverGroupID, unsigned int permissionID, int permissionValue, int permissionNegated, int permissionSkip); 100 | PLUGINS_EXPORTDLL void ts3plugin_onServerGroupPermListFinishedEvent(uint64 serverConnectionHandlerID, uint64 serverGroupID); 101 | PLUGINS_EXPORTDLL void ts3plugin_onServerGroupClientListEvent(uint64 serverConnectionHandlerID, uint64 serverGroupID, uint64 clientDatabaseID, const char* clientNameIdentifier, const char* clientUniqueID); 102 | PLUGINS_EXPORTDLL void ts3plugin_onChannelGroupListEvent(uint64 serverConnectionHandlerID, uint64 channelGroupID, const char* name, int type, int iconID, int saveDB); 103 | PLUGINS_EXPORTDLL void ts3plugin_onChannelGroupListFinishedEvent(uint64 serverConnectionHandlerID); 104 | PLUGINS_EXPORTDLL void ts3plugin_onChannelGroupPermListEvent(uint64 serverConnectionHandlerID, uint64 channelGroupID, unsigned int permissionID, int permissionValue, int permissionNegated, int permissionSkip); 105 | PLUGINS_EXPORTDLL void ts3plugin_onChannelGroupPermListFinishedEvent(uint64 serverConnectionHandlerID, uint64 channelGroupID); 106 | PLUGINS_EXPORTDLL void ts3plugin_onChannelPermListEvent(uint64 serverConnectionHandlerID, uint64 channelID, unsigned int permissionID, int permissionValue, int permissionNegated, int permissionSkip); 107 | PLUGINS_EXPORTDLL void ts3plugin_onChannelPermListFinishedEvent(uint64 serverConnectionHandlerID, uint64 channelID); 108 | PLUGINS_EXPORTDLL void ts3plugin_onClientPermListEvent(uint64 serverConnectionHandlerID, uint64 clientDatabaseID, unsigned int permissionID, int permissionValue, int permissionNegated, int permissionSkip); 109 | PLUGINS_EXPORTDLL void ts3plugin_onClientPermListFinishedEvent(uint64 serverConnectionHandlerID, uint64 clientDatabaseID); 110 | PLUGINS_EXPORTDLL void ts3plugin_onChannelClientPermListEvent(uint64 serverConnectionHandlerID, uint64 channelID, uint64 clientDatabaseID, unsigned int permissionID, int permissionValue, int permissionNegated, int permissionSkip); 111 | PLUGINS_EXPORTDLL void ts3plugin_onChannelClientPermListFinishedEvent(uint64 serverConnectionHandlerID, uint64 channelID, uint64 clientDatabaseID); 112 | PLUGINS_EXPORTDLL void ts3plugin_onClientChannelGroupChangedEvent(uint64 serverConnectionHandlerID, uint64 channelGroupID, uint64 channelID, anyID clientID, anyID invokerClientID, const char* invokerName, const char* invokerUniqueIdentity); 113 | PLUGINS_EXPORTDLL int ts3plugin_onServerPermissionErrorEvent(uint64 serverConnectionHandlerID, const char* errorMessage, unsigned int error, const char* returnCode, unsigned int failedPermissionID); 114 | PLUGINS_EXPORTDLL void ts3plugin_onPermissionListGroupEndIDEvent(uint64 serverConnectionHandlerID, unsigned int groupEndID); 115 | PLUGINS_EXPORTDLL void ts3plugin_onPermissionListEvent(uint64 serverConnectionHandlerID, unsigned int permissionID, const char* permissionName, const char* permissionDescription); 116 | PLUGINS_EXPORTDLL void ts3plugin_onPermissionListFinishedEvent(uint64 serverConnectionHandlerID); 117 | PLUGINS_EXPORTDLL void ts3plugin_onPermissionOverviewEvent(uint64 serverConnectionHandlerID, uint64 clientDatabaseID, uint64 channelID, int overviewType, uint64 overviewID1, uint64 overviewID2, unsigned int permissionID, int permissionValue, 118 | int permissionNegated, int permissionSkip); 119 | PLUGINS_EXPORTDLL void ts3plugin_onPermissionOverviewFinishedEvent(uint64 serverConnectionHandlerID); 120 | PLUGINS_EXPORTDLL void ts3plugin_onServerGroupClientAddedEvent(uint64 serverConnectionHandlerID, anyID clientID, const char* clientName, const char* clientUniqueIdentity, uint64 serverGroupID, anyID invokerClientID, const char* invokerName, 121 | const char* invokerUniqueIdentity); 122 | PLUGINS_EXPORTDLL void ts3plugin_onServerGroupClientDeletedEvent(uint64 serverConnectionHandlerID, anyID clientID, const char* clientName, const char* clientUniqueIdentity, uint64 serverGroupID, anyID invokerClientID, const char* invokerName, 123 | const char* invokerUniqueIdentity); 124 | PLUGINS_EXPORTDLL void ts3plugin_onClientNeededPermissionsEvent(uint64 serverConnectionHandlerID, unsigned int permissionID, int permissionValue); 125 | PLUGINS_EXPORTDLL void ts3plugin_onClientNeededPermissionsFinishedEvent(uint64 serverConnectionHandlerID); 126 | PLUGINS_EXPORTDLL void ts3plugin_onFileTransferStatusEvent(anyID transferID, unsigned int status, const char* statusMessage, uint64 remotefileSize, uint64 serverConnectionHandlerID); 127 | PLUGINS_EXPORTDLL void ts3plugin_onClientChatClosedEvent(uint64 serverConnectionHandlerID, anyID clientID, const char* clientUniqueIdentity); 128 | PLUGINS_EXPORTDLL void ts3plugin_onClientChatComposingEvent(uint64 serverConnectionHandlerID, anyID clientID, const char* clientUniqueIdentity); 129 | PLUGINS_EXPORTDLL void ts3plugin_onServerLogEvent(uint64 serverConnectionHandlerID, const char* logMsg); 130 | PLUGINS_EXPORTDLL void ts3plugin_onServerLogFinishedEvent(uint64 serverConnectionHandlerID, uint64 lastPos, uint64 fileSize); 131 | PLUGINS_EXPORTDLL void ts3plugin_onMessageListEvent(uint64 serverConnectionHandlerID, uint64 messageID, const char* fromClientUniqueIdentity, const char* subject, uint64 timestamp, int flagRead); 132 | PLUGINS_EXPORTDLL void ts3plugin_onMessageGetEvent(uint64 serverConnectionHandlerID, uint64 messageID, const char* fromClientUniqueIdentity, const char* subject, const char* message, uint64 timestamp); 133 | PLUGINS_EXPORTDLL void ts3plugin_onClientDBIDfromUIDEvent(uint64 serverConnectionHandlerID, const char* uniqueClientIdentifier, uint64 clientDatabaseID); 134 | PLUGINS_EXPORTDLL void ts3plugin_onClientNamefromUIDEvent(uint64 serverConnectionHandlerID, const char* uniqueClientIdentifier, uint64 clientDatabaseID, const char* clientNickName); 135 | PLUGINS_EXPORTDLL void ts3plugin_onClientNamefromDBIDEvent(uint64 serverConnectionHandlerID, const char* uniqueClientIdentifier, uint64 clientDatabaseID, const char* clientNickName); 136 | PLUGINS_EXPORTDLL void ts3plugin_onComplainListEvent(uint64 serverConnectionHandlerID, uint64 targetClientDatabaseID, const char* targetClientNickName, uint64 fromClientDatabaseID, const char* fromClientNickName, const char* complainReason, 137 | uint64 timestamp); 138 | PLUGINS_EXPORTDLL void ts3plugin_onBanListEvent(uint64 serverConnectionHandlerID, uint64 banid, const char* ip, const char* name, const char* uid, const char* mytsid, uint64 creationTime, uint64 durationTime, const char* invokerName, uint64 invokercldbid, 139 | const char* invokeruid, const char* reason, int numberOfEnforcements, const char* lastNickName); 140 | PLUGINS_EXPORTDLL void ts3plugin_onClientServerQueryLoginPasswordEvent(uint64 serverConnectionHandlerID, const char* loginPassword); 141 | PLUGINS_EXPORTDLL void ts3plugin_onPluginCommandEvent(uint64 serverConnectionHandlerID, const char* pluginName, const char* pluginCommand, anyID invokerClientID, const char* invokerName, const char* invokerUniqueIdentity); 142 | PLUGINS_EXPORTDLL void ts3plugin_onIncomingClientQueryEvent(uint64 serverConnectionHandlerID, const char* commandText); 143 | PLUGINS_EXPORTDLL void ts3plugin_onServerTemporaryPasswordListEvent(uint64 serverConnectionHandlerID, const char* clientNickname, const char* uniqueClientIdentifier, const char* description, const char* password, uint64 timestampStart, uint64 timestampEnd, 144 | uint64 targetChannelID, const char* targetChannelPW); 145 | 146 | /* Client UI callbacks */ 147 | PLUGINS_EXPORTDLL void ts3plugin_onAvatarUpdated(uint64 serverConnectionHandlerID, anyID clientID, const char* avatarPath); 148 | PLUGINS_EXPORTDLL void ts3plugin_onMenuItemEvent(uint64 serverConnectionHandlerID, enum PluginMenuType type, int menuItemID, uint64 selectedItemID); 149 | PLUGINS_EXPORTDLL void ts3plugin_onHotkeyEvent(const char* keyword); 150 | PLUGINS_EXPORTDLL void ts3plugin_onHotkeyRecordedEvent(const char* keyword, const char* key); 151 | PLUGINS_EXPORTDLL void ts3plugin_onClientDisplayNameChanged(uint64 serverConnectionHandlerID, anyID clientID, const char* displayName, const char* uniqueClientIdentifier); 152 | PLUGINS_EXPORTDLL const char* ts3plugin_keyDeviceName(const char* keyIdentifier); 153 | PLUGINS_EXPORTDLL const char* ts3plugin_displayKeyText(const char* keyIdentifier); 154 | PLUGINS_EXPORTDLL const char* ts3plugin_keyPrefix(); 155 | 156 | #ifdef __cplusplus 157 | } 158 | #endif 159 | 160 | #endif 161 | --------------------------------------------------------------------------------