diff --git a/CMakeLists.txt b/CMakeLists.txt index d261b72..3cb14c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ include(cmake/project-macro.cmake) # Generate global version header file. set(VERSION_MAJOR "0" CACHE INTERNAL "Major software version" FORCE) -set(VERSION_MINOR "13" CACHE INTERNAL "Minor software version" FORCE) +set(VERSION_MINOR "14" CACHE INTERNAL "Minor software version" FORCE) set(VERSION_PATCH "0" CACHE INTERNAL "Patch software version" FORCE) set(VERSION_EXTRA "" CACHE INTERNAL "Additional software version information, e.g.: release, beta, alpha, dev" FORCE) FILE(WRITE $ENV{OCS_BUILD_DIR_PATH}/project-defines.h diff --git a/README.md b/README.md index 5ef120c..d8af6aa 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ Build has been tested on - CMake >= 3.0.0 - Qt 5.4.1 build with OpenGL + - https://download.qt.io/archive/qt/5.5/5.5.1/qt-opensource-windows-x86-msvc2013-5.5.1.exe + - https://download.qt.io/archive/qt/5.5/5.5.1/qt-opensource-windows-x86-msvc2013_64-5.5.1.exe - VC12 (Visual Studio 2013) ### Linux only diff --git a/build-win32-cmake.bat b/build-win32-cmake.bat index 969999a..a013ee7 100644 --- a/build-win32-cmake.bat +++ b/build-win32-cmake.bat @@ -8,5 +8,6 @@ cd %OCS_BUILD_DIR_PATH% rem Configure with CMake. cmake -G "Visual Studio 12 2013" -DCMAKE_INSTALL_PREFIX="%OCS_INSTALL_DIR_PATH%" -DIncludeOpenGLSupport=ON .. +rem cmake -G "Visual Studio 14 2015" -DCMAKE_INSTALL_PREFIX="%OCS_INSTALL_DIR_PATH%" -DIncludeOpenGLSupport=ON .. pause \ No newline at end of file diff --git a/innosetup/all.iss b/innosetup/all.iss index 55a3d99..ffa19f1 100644 --- a/innosetup/all.iss +++ b/innosetup/all.iss @@ -8,7 +8,7 @@ ; Application information #define MyAppURL "https://mfreiholz.de/ts3video" -#define MyAppVersion "0.13" +#define MyAppVersion "0.14" [Setup] AppPublisher={#MyOrgName} @@ -20,7 +20,7 @@ AppVersion={#MyAppVersion} AppSupportURL={#MyAppURL} AppUpdatesURL={#MyAppURL} -DefaultDirName={pf}\{#MyOrgDomain}\{#MyAppName} +DefaultDirName={commonpf}\{#MyOrgDomain}\{#MyAppName} DefaultGroupName={#MyAppName} DisableProgramGroupPage=yes @@ -32,7 +32,7 @@ OutputDir={#OCS_RELEASE_DIR_PATH} OutputBaseFilename={#MyAppName} {#MyAppVersion} Setup ; Comsmetics -AppCopyright=Copyright (C) 2015-2017 {#MyOrgName} +AppCopyright=Copyright (C) 2015-2019 {#MyOrgName} ; Basic registry values for all applications. [Registry] diff --git a/projects/libapp/libapp/ts3video.h b/projects/libapp/libapp/ts3video.h index d2d0966..631994f 100644 --- a/projects/libapp/libapp/ts3video.h +++ b/projects/libapp/libapp/ts3video.h @@ -21,7 +21,7 @@ /////////////////////////////////////////////////////////////////////// /* Comma separated list of client versions, which the current server build supports. */ -#define IFVS_SERVER_SUPPORTED_CLIENT_VERSIONS "0.6,0.7,0.8,0.9,0.10,0.11,0.12,0.13" +#define IFVS_SERVER_SUPPORTED_CLIENT_VERSIONS "0.6,0.7,0.8,0.9,0.10,0.11,0.12,0.13,0.14" #define IFVS_SERVER_ADDRESS "mfreiholz.de" ///< The default server address. Good for testing. #define IFVS_SERVER_CONNECTION_PORT 13370 ///< The default server port to accept connections from clients. @@ -33,7 +33,7 @@ /////////////////////////////////////////////////////////////////////// /* Comma separated list of server versions, which the current client build supports. */ -#define IFVS_CLIENT_SUPPORTED_SERVER_VERSIONS "0.6,0.7,0.8,0.9,0.10,0.11,0.12,0.13" +#define IFVS_CLIENT_SUPPORTED_SERVER_VERSIONS "0.6,0.7,0.8,0.9,0.10,0.11,0.12,0.13,0.14" /////////////////////////////////////////////////////////////////////// // Status Codes diff --git a/projects/ts3plugin/CMakeLists.txt b/projects/ts3plugin/CMakeLists.txt index 6387849..e1ff9bf 100644 --- a/projects/ts3plugin/CMakeLists.txt +++ b/projects/ts3plugin/CMakeLists.txt @@ -4,12 +4,12 @@ project(ts3plugin) cmake_policy(SET CMP0020 NEW) set(headers - plugin_22.h + plugin_23.h impl.h ) set(sources - plugin_22.c + plugin_23.c impl.cpp ) diff --git a/projects/ts3plugin/plugin_23.c b/projects/ts3plugin/plugin_23.c new file mode 100644 index 0000000..5ba40f9 --- /dev/null +++ b/projects/ts3plugin/plugin_23.c @@ -0,0 +1,1080 @@ +/* + TeamSpeak 3 demo plugin + + Copyright (c) 2008-2016 TeamSpeak Systems GmbH +*/ + +#ifdef _WIN32 +#pragma warning (disable : 4100) /* Disable Unreferenced parameter warning */ +#include +#endif + +#include +#include +#include +#include +#include "teamspeak/public_errors.h" +#include "teamspeak/public_errors_rare.h" +#include "teamspeak/public_definitions.h" +#include "teamspeak/public_rare_definitions.h" +#include "teamspeak/clientlib_publicdefinitions.h" +#include "ts3_functions.h" +#include "plugin_23.h" +#include "impl.h" +#include "../libapp/libapp/ts3video.h" + +static struct TS3Functions ts3Functions; + +#ifdef _WIN32 +#define _strcpy(dest, destSize, src) strcpy_s(dest, destSize, src) +#define snprintf sprintf_s +#else +#define _strcpy(dest, destSize, src) { strncpy(dest, src, destSize-1); (dest)[destSize-1] = '\0'; } +#endif + +#define PLUGIN_API_VERSION 23 + +#define PATH_BUFSIZE 512 +#define COMMAND_BUFSIZE 128 +#define INFODATA_BUFSIZE 128 +#define SERVERINFO_BUFSIZE 256 +#define CHANNELINFO_BUFSIZE 512 +#define RETURNCODE_BUFSIZE 128 + +static char* pluginID = NULL; + +#ifdef _WIN32 +/* Helper function to convert wchar_T to Utf-8 encoded strings on Windows */ +static int wcharToUtf8(const wchar_t* str, char** result) +{ + int outlen = WideCharToMultiByte(CP_UTF8, 0, str, -1, 0, 0, 0, 0); + *result = (char*)malloc(outlen); + if (WideCharToMultiByte(CP_UTF8, 0, str, -1, *result, outlen, 0, 0) == 0) + { + *result = NULL; + return -1; + } + return 0; +} +#endif + +/*********************************** OCS STUFF *********************************************/ + +/* + Menu IDs for this plugin. Pass these IDs when creating a menuitem to the TS3 client. When the menu item is triggered, + ts3plugin_onMenuItemEvent will be called passing the menu ID of the triggered menu item. + These IDs are freely choosable by the plugin author. It's not really needed to use an enum, it just looks prettier. +*/ +enum +{ + MENU_ID_CHANNEL_VIDEO_START_PRIVATE = 1, + MENU_ID_CHANNEL_VIDEO_START_PUBLIC = 2 +}; + +static TS3Data* _data = 0; +static int _startRequested = 0; +static int _usedMenuItemID = 0; + +static void startVideoClient() +{ + // Run videoclient.exe. + int f = RUNOPT_DEFAULT; + if (_usedMenuItemID == MENU_ID_CHANNEL_VIDEO_START_PUBLIC) + { + f |= RUNOPT_PUBLIC; + } + if (runClient(_data, f) != 0) + printf("Could not run client."); + + // Reset collected values. + _startRequested = 0; + _usedMenuItemID = 0; + free(_data); + _data = 0; +} + +/*********************************** Required functions ************************************/ +/* + If any of these required functions is not implemented, TS3 will refuse to load the plugin +*/ + +/* Unique name identifying this plugin */ +const char* ts3plugin_name() +{ +#ifdef _WIN32 + /* TeamSpeak expects UTF-8 encoded characters. Following demonstrates a possibility how to convert UTF-16 wchar_t into UTF-8. */ + static char* result = NULL; /* Static variable so it's allocated only once */ + if (!result) + { + const wchar_t* name = L"TS3VIDEO"; + if (wcharToUtf8(name, &result) == + -1) /* Convert name into UTF-8 encoded result */ + { + result = "TS3VIDEO"; /* Conversion failed, fallback here */ + } + } + return result; +#else + return "Test Plugin"; +#endif +} + +/* Plugin version */ +const char* ts3plugin_version() +{ + return IFVS_SOFTWARE_VERSION; +} + +/* Plugin API version. Must be the same as the clients API major version, else the plugin fails to load. */ +int ts3plugin_apiVersion() +{ + return PLUGIN_API_VERSION; +} + +/* Plugin author */ +const char* ts3plugin_author() +{ + /* If you want to use wchar_t, see ts3plugin_name() on how to use */ + return "Manuel Freiholz "; +} + +/* Plugin description */ +const char* ts3plugin_description() +{ + /* If you want to use wchar_t, see ts3plugin_name() on how to use */ + return "This plugin provides video conferencing for Teamspeak 3.\n\nCheckout the plugin's website for more information:\nhttps://mfreiholz.de/ts3video"; +} + +/* Set TeamSpeak 3 callback functions */ +void ts3plugin_setFunctionPointers(const struct TS3Functions funcs) +{ + ts3Functions = funcs; +} + +/* + Custom code called right after loading the plugin. Returns 0 on success, 1 on failure. + If the function returns 1 on failure, the plugin will be unloaded again. +*/ +int ts3plugin_init() +{ + char appPath[PATH_BUFSIZE]; + char resourcesPath[PATH_BUFSIZE]; + char configPath[PATH_BUFSIZE]; + char pluginPath[PATH_BUFSIZE]; + + /* Your plugin init code here */ + printf("PLUGIN: init\n"); + + /* Example on how to query application, resources and configuration paths from client */ + /* Note: Console client returns empty string for app and resources path */ + ts3Functions.getAppPath(appPath, PATH_BUFSIZE); + ts3Functions.getResourcesPath(resourcesPath, PATH_BUFSIZE); + ts3Functions.getConfigPath(configPath, PATH_BUFSIZE); + ts3Functions.getPluginPath(pluginPath, PATH_BUFSIZE, pluginID); + + printf("PLUGIN: App path: %s\nResources path: %s\nConfig path: %s\nPlugin path: %s\n", + appPath, resourcesPath, configPath, pluginPath); + + return 0; /* 0 = success, 1 = failure, -2 = failure but client will not show a "failed to load" warning */ + /* -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 + the plugin again, avoiding the show another dialog by the client telling the user the plugin failed to load. + For normal case, if a plugin really failed to load because of an error, the correct return value is 1. */ +} + +/* Custom code called right before the plugin is unloaded */ +void ts3plugin_shutdown() +{ + /* Your plugin cleanup code here */ + printf("PLUGIN: shutdown\n"); + + /* + Note: + If your plugin implements a settings dialog, it must be closed and deleted here, else the + TeamSpeak client will most likely crash (DLL removed but dialog from DLL code still open). + */ + + /* Free pluginID if we registered it */ + if (pluginID) + { + free(pluginID); + pluginID = NULL; + } +} + +/****************************** Optional functions ********************************/ +/* + Following functions are optional, if not needed you don't need to implement them. +*/ + +/* 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). */ +int ts3plugin_offersConfigure() +{ + printf("PLUGIN: offersConfigure\n"); + /* + Return values: + PLUGIN_OFFERS_NO_CONFIGURE - Plugin does not implement ts3plugin_configure + PLUGIN_OFFERS_CONFIGURE_NEW_THREAD - Plugin does implement ts3plugin_configure and requests to run this function in an own thread + PLUGIN_OFFERS_CONFIGURE_QT_THREAD - Plugin does implement ts3plugin_configure and requests to run this function in the Qt GUI thread + */ + return PLUGIN_OFFERS_NO_CONFIGURE; /* In this case ts3plugin_configure does not need to be implemented */ +} + +/* Plugin might offer a configuration window. If ts3plugin_offersConfigure returns 0, this function does not need to be implemented. */ +void ts3plugin_configure(void* handle, void* qParentWidget) +{ + printf("PLUGIN: configure\n"); +} + +/* + 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 + automatically called after the plugin was initialized. This function is optional. If you don't use these features, this function can be omitted. + Note the passed pluginID parameter is no longer valid after calling this function, so you must copy it and store it in the plugin. +*/ +void ts3plugin_registerPluginID(const char* id) +{ + const size_t sz = strlen(id) + 1; + pluginID = (char*)malloc(sz * sizeof(char)); + _strcpy(pluginID, sz, + id); /* The id buffer will invalidate after exiting this function */ + printf("PLUGIN: registerPluginID: %s\n", pluginID); +} + +/* Plugin command keyword. Return NULL or "" if not used. */ +const char* ts3plugin_commandKeyword() +{ + return NULL; +} + +/* Plugin processes console command. Return 0 if plugin handled the command, 1 if not handled. */ +int ts3plugin_processCommand(uint64 serverConnectionHandlerID, + const char* command) +{ + return 1; +} + +/* Client changed current server connection handler */ +void ts3plugin_currentServerConnectionChanged(uint64 serverConnectionHandlerID) +{ + printf("PLUGIN: currentServerConnectionChanged %llu (%llu)\n", + (long long unsigned int)serverConnectionHandlerID, + (long long unsigned int)ts3Functions.getCurrentServerConnectionHandlerID()); +} + +/* + Implement the following three functions when the plugin should display a line in the server/channel/client info. + If any of ts3plugin_infoTitle, ts3plugin_infoData or ts3plugin_freeMemory is missing, the info text will not be displayed. +*/ + +/* Static title shown in the left column in the info frame */ +const char* ts3plugin_infoTitle() +{ + return "TS3VIDEO"; +} + +/* + Dynamic content shown in the right column in the info frame. Memory for the data string needs to be allocated in this + function. The client will call ts3plugin_freeMemory once done with the string to release the allocated memory again. + Check the parameter "type" if you want to implement this feature only for specific item types. Set the parameter + "data" to NULL to have the client ignore the info data. +*/ +void ts3plugin_infoData(uint64 serverConnectionHandlerID, uint64 id, + enum PluginItemType type, char** data) +{ + data = NULL; +} + +/* Required to release the memory for parameter "data" allocated in ts3plugin_infoData and ts3plugin_initMenus */ +void ts3plugin_freeMemory(void* data) +{ + free(data); +} + +/* + Plugin requests to be always automatically loaded by the TeamSpeak 3 client unless + the user manually disabled it in the plugin dialog. + This function is optional. If missing, no autoload is assumed. +*/ +int ts3plugin_requestAutoload() +{ + return 0; /* 1 = request autoloaded, 0 = do not request autoload */ +} + +/* Helper function to create a menu item */ +static struct PluginMenuItem* createMenuItem(enum PluginMenuType type, int id, + const char* text, const char* icon) +{ + struct PluginMenuItem* menuItem = (struct PluginMenuItem*)malloc(sizeof( + struct PluginMenuItem)); + menuItem->type = type; + menuItem->id = id; + _strcpy(menuItem->text, PLUGIN_MENU_BUFSZ, text); + _strcpy(menuItem->icon, PLUGIN_MENU_BUFSZ, icon); + return menuItem; +} + +/* Some makros to make the code to create menu items a bit more readable */ +#define BEGIN_CREATE_MENUS(x) const size_t sz = x + 1; size_t n = 0; *menuItems = (struct PluginMenuItem**)malloc(sizeof(struct PluginMenuItem*) * sz); +#define CREATE_MENU_ITEM(a, b, c, d) (*menuItems)[n++] = createMenuItem(a, b, c, d); +#define END_CREATE_MENUS (*menuItems)[n++] = NULL; assert(n == sz); + +/* + Menu IDs for this plugin. Pass these IDs when creating a menuitem to the TS3 client. When the menu item is triggered, + ts3plugin_onMenuItemEvent will be called passing the menu ID of the triggered menu item. + These IDs are freely choosable by the plugin author. It's not really needed to use an enum, it just looks prettier. +*/ +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 +}; + +/* + Initialize plugin menus. + This function is called after ts3plugin_init and ts3plugin_registerPluginID. A pluginID is required for plugin menus to work. + Both ts3plugin_registerPluginID and ts3plugin_freeMemory must be implemented to use menus. + If plugin menus are not used by a plugin, do not implement this function or return NULL. +*/ +void ts3plugin_initMenus(struct PluginMenuItem** * menuItems, char** menuIcon) +{ + /* + Create the menus + There are three types of menu items: + - PLUGIN_MENU_TYPE_CLIENT: Client context menu + - PLUGIN_MENU_TYPE_CHANNEL: Channel context menu + - PLUGIN_MENU_TYPE_GLOBAL: "Plugins" menu in menu bar of main window + + Menu IDs are used to identify the menu item when ts3plugin_onMenuItemEvent is called + + The menu text is required, max length is 128 characters + + The icon is optional, max length is 128 characters. When not using icons, just pass an empty string. + Icons are loaded from a subdirectory in the TeamSpeak client plugins folder. The subdirectory must be named like the + plugin filename, without dll/so/dylib suffix + e.g. for "test_plugin.dll", icon "1.png" is loaded from \plugins\test_plugin\1.png + */ + + BEGIN_CREATE_MENUS(2); /* IMPORTANT: Number of menu items must be correct! */ + CREATE_MENU_ITEM(PLUGIN_MENU_TYPE_CHANNEL, MENU_ID_CHANNEL_VIDEO_START_PRIVATE, + "Join now", "join-now.png") + CREATE_MENU_ITEM(PLUGIN_MENU_TYPE_CHANNEL, MENU_ID_CHANNEL_VIDEO_START_PUBLIC, + "Join via public server", "join-public.png") + END_CREATE_MENUS; /* Includes an assert checking if the number of menu items matched */ + + /* + Specify an optional icon for the plugin. This icon is used for the plugins submenu within context and main menus + If unused, set menuIcon to NULL + */ + *menuIcon = (char*)malloc(PLUGIN_MENU_BUFSZ * sizeof(char)); + _strcpy(*menuIcon, PLUGIN_MENU_BUFSZ, "logo.png"); + + /* + Menus can be enabled or disabled with: ts3Functions.setPluginMenuEnabled(pluginID, menuID, 0|1); + Test it with plugin command: /test enablemenu <0|1> + Menus are enabled by default. Please note that shown menus will not automatically enable or disable when calling this function to + ensure Qt menus are not modified by any thread other the UI thread. The enabled or disable state will change the next time a + menu is displayed. + */ + /* For example, this would disable MENU_ID_GLOBAL_2: */ + /* ts3Functions.setPluginMenuEnabled(pluginID, MENU_ID_GLOBAL_2, 0); */ + + /* All memory allocated in this function will be automatically released by the TeamSpeak client later by calling ts3plugin_freeMemory */ +} + +/* Helper function to create a hotkey */ +static struct PluginHotkey* createHotkey(const char* keyword, + const char* description) +{ + struct PluginHotkey* hotkey = (struct PluginHotkey*)malloc(sizeof( + struct PluginHotkey)); + _strcpy(hotkey->keyword, PLUGIN_HOTKEY_BUFSZ, keyword); + _strcpy(hotkey->description, PLUGIN_HOTKEY_BUFSZ, description); + return hotkey; +} + +/* Some makros to make the code to create hotkeys a bit more readable */ +#define BEGIN_CREATE_HOTKEYS(x) const size_t sz = x + 1; size_t n = 0; *hotkeys = (struct PluginHotkey**)malloc(sizeof(struct PluginHotkey*) * sz); +#define CREATE_HOTKEY(a, b) (*hotkeys)[n++] = createHotkey(a, b); +#define END_CREATE_HOTKEYS (*hotkeys)[n++] = NULL; assert(n == sz); + +/* + Initialize plugin hotkeys. If your plugin does not use this feature, this function can be omitted. + Hotkeys require ts3plugin_registerPluginID and ts3plugin_freeMemory to be implemented. + This function is automatically called by the client after ts3plugin_init. +*/ +void ts3plugin_initHotkeys(struct PluginHotkey** * hotkeys) +{ + /* Register hotkeys giving a keyword and a description. + The keyword will be later passed to ts3plugin_onHotkeyEvent to identify which hotkey was triggered. + The description is shown in the clients hotkey dialog. */ + BEGIN_CREATE_HOTKEYS( + 0); /* Create 3 hotkeys. Size must be correct for allocating memory. */ + //CREATE_HOTKEY("keyword_1", "Test hotkey 1"); + //CREATE_HOTKEY("keyword_2", "Test hotkey 2"); + //CREATE_HOTKEY("keyword_3", "Test hotkey 3"); + END_CREATE_HOTKEYS; + + /* The client will call ts3plugin_freeMemory to release all allocated memory */ +} + +/************************** TeamSpeak callbacks ***************************/ +/* + Following functions are optional, feel free to remove unused callbacks. + See the clientlib documentation for details on each function. +*/ + +/* Clientlib */ + +void ts3plugin_onConnectStatusChangeEvent(uint64 serverConnectionHandlerID, + int newStatus, unsigned int errorNumber) +{ +} + +void ts3plugin_onNewChannelEvent(uint64 serverConnectionHandlerID, + uint64 channelID, uint64 channelParentID) +{ +} + +void ts3plugin_onNewChannelCreatedEvent(uint64 serverConnectionHandlerID, + uint64 channelID, uint64 channelParentID, anyID invokerID, + const char* invokerName, const char* invokerUniqueIdentifier) +{ +} + +void ts3plugin_onDelChannelEvent(uint64 serverConnectionHandlerID, + uint64 channelID, anyID invokerID, const char* invokerName, + const char* invokerUniqueIdentifier) +{ +} + +void ts3plugin_onChannelMoveEvent(uint64 serverConnectionHandlerID, + uint64 channelID, uint64 newChannelParentID, anyID invokerID, + const char* invokerName, const char* invokerUniqueIdentifier) +{ +} + +void ts3plugin_onUpdateChannelEvent(uint64 serverConnectionHandlerID, + uint64 channelID) +{ +} + +void ts3plugin_onUpdateChannelEditedEvent(uint64 serverConnectionHandlerID, + uint64 channelID, anyID invokerID, const char* invokerName, + const char* invokerUniqueIdentifier) +{ +} + +void ts3plugin_onUpdateClientEvent(uint64 serverConnectionHandlerID, + anyID clientID, anyID invokerID, const char* invokerName, + const char* invokerUniqueIdentifier) +{ +} + +void ts3plugin_onClientMoveEvent(uint64 serverConnectionHandlerID, + anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility, + const char* moveMessage) +{ +} + +void ts3plugin_onClientMoveSubscriptionEvent(uint64 serverConnectionHandlerID, + anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility) +{ +} + +void ts3plugin_onClientMoveTimeoutEvent(uint64 serverConnectionHandlerID, + anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility, + const char* timeoutMessage) +{ +} + +void ts3plugin_onClientMoveMovedEvent(uint64 serverConnectionHandlerID, + anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility, + anyID moverID, const char* moverName, const char* moverUniqueIdentifier, + const char* moveMessage) +{ +} + +void ts3plugin_onClientKickFromChannelEvent(uint64 serverConnectionHandlerID, + anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility, + anyID kickerID, const char* kickerName, const char* kickerUniqueIdentifier, + const char* kickMessage) +{ +} + +void ts3plugin_onClientKickFromServerEvent(uint64 serverConnectionHandlerID, + anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility, + anyID kickerID, const char* kickerName, const char* kickerUniqueIdentifier, + const char* kickMessage) +{ +} + +void ts3plugin_onClientIDsEvent(uint64 serverConnectionHandlerID, + const char* uniqueClientIdentifier, anyID clientID, const char* clientName) +{ +} + +void ts3plugin_onClientIDsFinishedEvent(uint64 serverConnectionHandlerID) +{ +} + +void ts3plugin_onServerEditedEvent(uint64 serverConnectionHandlerID, + anyID editerID, const char* editerName, const char* editerUniqueIdentifier) +{ +} + +void ts3plugin_onServerUpdatedEvent(uint64 serverConnectionHandlerID) +{ +} + +int ts3plugin_onServerErrorEvent(uint64 serverConnectionHandlerID, + const char* errorMessage, unsigned int error, const char* returnCode, + const char* extraMessage) +{ + printf("PLUGIN: onServerErrorEvent %llu %s %d %s\n", + (long long unsigned int)serverConnectionHandlerID, errorMessage, error, + (returnCode ? returnCode : "")); + if (returnCode) + { + /* A plugin could now check the returnCode with previously (when calling a function) remembered returnCodes and react accordingly */ + /* In case of using a a plugin return code, the plugin can return: + 0: Client will continue handling this error (print to chat tab) + 1: Client will ignore this error, the plugin announces it has handled it */ + return 1; + } + return 0; /* If no plugin return code was used, the return value of this function is ignored */ +} + +void ts3plugin_onServerStopEvent(uint64 serverConnectionHandlerID, + const char* shutdownMessage) +{ +} + +int ts3plugin_onTextMessageEvent(uint64 serverConnectionHandlerID, + anyID targetMode, anyID toID, anyID fromID, const char* fromName, + const char* fromUniqueIdentifier, const char* message, int ffIgnored) +{ + return 0; /* 0 = handle normally, 1 = client will ignore the text message */ +} + +void ts3plugin_onTalkStatusChangeEvent(uint64 serverConnectionHandlerID, + int status, int isReceivedWhisper, anyID clientID) +{ +} + +void ts3plugin_onConnectionInfoEvent(uint64 serverConnectionHandlerID, + anyID clientID) +{ +} + +void ts3plugin_onServerConnectionInfoEvent(uint64 serverConnectionHandlerID) +{ +} + +void ts3plugin_onChannelSubscribeEvent(uint64 serverConnectionHandlerID, + uint64 channelID) +{ +} + +void ts3plugin_onChannelSubscribeFinishedEvent(uint64 serverConnectionHandlerID) +{ +} + +void ts3plugin_onChannelUnsubscribeEvent(uint64 serverConnectionHandlerID, + uint64 channelID) +{ +} + +void ts3plugin_onChannelUnsubscribeFinishedEvent(uint64 + serverConnectionHandlerID) +{ +} + +void ts3plugin_onChannelDescriptionUpdateEvent(uint64 serverConnectionHandlerID, + uint64 channelID) +{ +} + +void ts3plugin_onChannelPasswordChangedEvent(uint64 serverConnectionHandlerID, + uint64 channelID) +{ +} + +void ts3plugin_onPlaybackShutdownCompleteEvent(uint64 serverConnectionHandlerID) +{ +} + +void ts3plugin_onSoundDeviceListChangedEvent(const char* modeID, int playOrCap) +{ +} + +void ts3plugin_onEditPlaybackVoiceDataEvent(uint64 serverConnectionHandlerID, + anyID clientID, short* samples, int sampleCount, int channels) +{ +} + +void ts3plugin_onEditPostProcessVoiceDataEvent(uint64 serverConnectionHandlerID, + anyID clientID, short* samples, int sampleCount, int channels, + const unsigned int* channelSpeakerArray, unsigned int* channelFillMask) +{ +} + +void ts3plugin_onEditMixedPlaybackVoiceDataEvent(uint64 + serverConnectionHandlerID, short* samples, int sampleCount, int channels, + const unsigned int* channelSpeakerArray, unsigned int* channelFillMask) +{ +} + +void ts3plugin_onEditCapturedVoiceDataEvent(uint64 serverConnectionHandlerID, + short* samples, int sampleCount, int channels, int* edited) +{ +} + +void ts3plugin_onCustom3dRolloffCalculationClientEvent(uint64 + serverConnectionHandlerID, anyID clientID, float distance, float* volume) +{ +} + +void ts3plugin_onCustom3dRolloffCalculationWaveEvent(uint64 + serverConnectionHandlerID, uint64 waveHandle, float distance, float* volume) +{ +} + +void ts3plugin_onUserLoggingMessageEvent(const char* logMessage, int logLevel, + const char* logChannel, uint64 logID, const char* logTime, + const char* completeLogString) +{ +} + +/* Clientlib rare */ + +void ts3plugin_onClientBanFromServerEvent(uint64 serverConnectionHandlerID, + anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility, + anyID kickerID, const char* kickerName, const char* kickerUniqueIdentifier, + uint64 time, const char* kickMessage) +{ +} + +int ts3plugin_onClientPokeEvent(uint64 serverConnectionHandlerID, + anyID fromClientID, const char* pokerName, const char* pokerUniqueIdentity, + const char* message, int ffIgnored) +{ + return 0; /* 0 = handle normally, 1 = client will ignore the poke */ +} + +void ts3plugin_onClientSelfVariableUpdateEvent(uint64 serverConnectionHandlerID, + int flag, const char* oldValue, const char* newValue) +{ +} + +void ts3plugin_onFileListEvent(uint64 serverConnectionHandlerID, + uint64 channelID, const char* path, const char* name, uint64 size, + uint64 datetime, int type, uint64 incompletesize, const char* returnCode) +{ +} + +void ts3plugin_onFileListFinishedEvent(uint64 serverConnectionHandlerID, + uint64 channelID, const char* path) +{ +} + +void ts3plugin_onFileInfoEvent(uint64 serverConnectionHandlerID, + uint64 channelID, const char* name, uint64 size, uint64 datetime) +{ +} + +void ts3plugin_onServerGroupListEvent(uint64 serverConnectionHandlerID, + uint64 serverGroupID, const char* name, int type, int iconID, int saveDB) +{ +} + +void ts3plugin_onServerGroupListFinishedEvent(uint64 serverConnectionHandlerID) +{ +} + +void ts3plugin_onServerGroupByClientIDEvent(uint64 serverConnectionHandlerID, + const char* name, uint64 serverGroupList, uint64 clientDatabaseID) +{ +} + +void ts3plugin_onServerGroupPermListEvent(uint64 serverConnectionHandlerID, + uint64 serverGroupID, unsigned int permissionID, int permissionValue, + int permissionNegated, int permissionSkip) +{ +} + +void ts3plugin_onServerGroupPermListFinishedEvent(uint64 + serverConnectionHandlerID, uint64 serverGroupID) +{ +} + +void ts3plugin_onServerGroupClientListEvent(uint64 serverConnectionHandlerID, + uint64 serverGroupID, uint64 clientDatabaseID, const char* clientNameIdentifier, + const char* clientUniqueID) +{ +} + +void ts3plugin_onChannelGroupListEvent(uint64 serverConnectionHandlerID, + uint64 channelGroupID, const char* name, int type, int iconID, int saveDB) +{ +} + +void ts3plugin_onChannelGroupListFinishedEvent(uint64 serverConnectionHandlerID) +{ +} + +void ts3plugin_onChannelGroupPermListEvent(uint64 serverConnectionHandlerID, + uint64 channelGroupID, unsigned int permissionID, int permissionValue, + int permissionNegated, int permissionSkip) +{ +} + +void ts3plugin_onChannelGroupPermListFinishedEvent(uint64 + serverConnectionHandlerID, uint64 channelGroupID) +{ +} + +void ts3plugin_onChannelPermListEvent(uint64 serverConnectionHandlerID, + uint64 channelID, unsigned int permissionID, int permissionValue, + int permissionNegated, int permissionSkip) +{ +} + +void ts3plugin_onChannelPermListFinishedEvent(uint64 serverConnectionHandlerID, + uint64 channelID) +{ +} + +void ts3plugin_onClientPermListEvent(uint64 serverConnectionHandlerID, + uint64 clientDatabaseID, unsigned int permissionID, int permissionValue, + int permissionNegated, int permissionSkip) +{ +} + +void ts3plugin_onClientPermListFinishedEvent(uint64 serverConnectionHandlerID, + uint64 clientDatabaseID) +{ +} + +void ts3plugin_onChannelClientPermListEvent(uint64 serverConnectionHandlerID, + uint64 channelID, uint64 clientDatabaseID, unsigned int permissionID, + int permissionValue, int permissionNegated, int permissionSkip) +{ +} + +void ts3plugin_onChannelClientPermListFinishedEvent(uint64 + serverConnectionHandlerID, uint64 channelID, uint64 clientDatabaseID) +{ +} + +void ts3plugin_onClientChannelGroupChangedEvent(uint64 + serverConnectionHandlerID, uint64 channelGroupID, uint64 channelID, + anyID clientID, anyID invokerClientID, const char* invokerName, + const char* invokerUniqueIdentity) +{ +} + +int ts3plugin_onServerPermissionErrorEvent(uint64 serverConnectionHandlerID, + const char* errorMessage, unsigned int error, const char* returnCode, + unsigned int failedPermissionID) +{ + return 0; /* See onServerErrorEvent for return code description */ +} + +void ts3plugin_onPermissionListGroupEndIDEvent(uint64 serverConnectionHandlerID, + unsigned int groupEndID) +{ +} + +void ts3plugin_onPermissionListEvent(uint64 serverConnectionHandlerID, + unsigned int permissionID, const char* permissionName, + const char* permissionDescription) +{ +} + +void ts3plugin_onPermissionListFinishedEvent(uint64 serverConnectionHandlerID) +{ +} + +void ts3plugin_onPermissionOverviewEvent(uint64 serverConnectionHandlerID, + uint64 clientDatabaseID, uint64 channelID, int overviewType, uint64 overviewID1, + uint64 overviewID2, unsigned int permissionID, int permissionValue, + int permissionNegated, int permissionSkip) +{ +} + +void ts3plugin_onPermissionOverviewFinishedEvent(uint64 + serverConnectionHandlerID) +{ +} + +void ts3plugin_onServerGroupClientAddedEvent(uint64 serverConnectionHandlerID, + anyID clientID, const char* clientName, const char* clientUniqueIdentity, + uint64 serverGroupID, anyID invokerClientID, const char* invokerName, + const char* invokerUniqueIdentity) +{ +} + +void ts3plugin_onServerGroupClientDeletedEvent(uint64 serverConnectionHandlerID, + anyID clientID, const char* clientName, const char* clientUniqueIdentity, + uint64 serverGroupID, anyID invokerClientID, const char* invokerName, + const char* invokerUniqueIdentity) +{ +} + +void ts3plugin_onClientNeededPermissionsEvent(uint64 serverConnectionHandlerID, + unsigned int permissionID, int permissionValue) +{ +} + +void ts3plugin_onClientNeededPermissionsFinishedEvent(uint64 + serverConnectionHandlerID) +{ +} + +void ts3plugin_onFileTransferStatusEvent(anyID transferID, unsigned int status, + const char* statusMessage, uint64 remotefileSize, + uint64 serverConnectionHandlerID) +{ +} + +void ts3plugin_onClientChatClosedEvent(uint64 serverConnectionHandlerID, + anyID clientID, const char* clientUniqueIdentity) +{ +} + +void ts3plugin_onClientChatComposingEvent(uint64 serverConnectionHandlerID, + anyID clientID, const char* clientUniqueIdentity) +{ +} + +void ts3plugin_onServerLogEvent(uint64 serverConnectionHandlerID, + const char* logMsg) +{ +} + +void ts3plugin_onServerLogFinishedEvent(uint64 serverConnectionHandlerID, + uint64 lastPos, uint64 fileSize) +{ +} + +void ts3plugin_onMessageListEvent(uint64 serverConnectionHandlerID, + uint64 messageID, const char* fromClientUniqueIdentity, const char* subject, + uint64 timestamp, int flagRead) +{ +} + +void ts3plugin_onMessageGetEvent(uint64 serverConnectionHandlerID, + uint64 messageID, const char* fromClientUniqueIdentity, const char* subject, + const char* message, uint64 timestamp) +{ +} + +void ts3plugin_onClientDBIDfromUIDEvent(uint64 serverConnectionHandlerID, + const char* uniqueClientIdentifier, uint64 clientDatabaseID) +{ + if (!_startRequested || !_data) + return; + _data->clientDatabaseId = clientDatabaseID; + startVideoClient(); +} + +void ts3plugin_onClientNamefromUIDEvent(uint64 serverConnectionHandlerID, + const char* uniqueClientIdentifier, uint64 clientDatabaseID, + const char* clientNickName) +{ +} + +void ts3plugin_onClientNamefromDBIDEvent(uint64 serverConnectionHandlerID, + const char* uniqueClientIdentifier, uint64 clientDatabaseID, + const char* clientNickName) +{ +} + +void ts3plugin_onComplainListEvent(uint64 serverConnectionHandlerID, + uint64 targetClientDatabaseID, const char* targetClientNickName, + uint64 fromClientDatabaseID, const char* fromClientNickName, + const char* complainReason, uint64 timestamp) +{ +} + +void ts3plugin_onBanListEvent(uint64 serverConnectionHandlerID, uint64 banid, + const char* ip, const char* name, const char* uid, uint64 creationTime, + uint64 durationTime, const char* invokerName, + uint64 invokercldbid, const char* invokeruid, const char* reason, + int numberOfEnforcements, const char* lastNickName) +{ +} + +void ts3plugin_onClientServerQueryLoginPasswordEvent(uint64 + serverConnectionHandlerID, const char* loginPassword) +{ +} + +void ts3plugin_onPluginCommandEvent(uint64 serverConnectionHandlerID, + const char* pluginName, const char* pluginCommand) +{ +} + +void ts3plugin_onIncomingClientQueryEvent(uint64 serverConnectionHandlerID, + const char* commandText) +{ +} + +void ts3plugin_onServerTemporaryPasswordListEvent(uint64 + serverConnectionHandlerID, const char* clientNickname, + const char* uniqueClientIdentifier, const char* description, + const char* password, uint64 timestampStart, uint64 timestampEnd, + uint64 targetChannelID, const char* targetChannelPW) +{ +} + +/* Client UI callbacks */ + +/* + Called from client when an avatar image has been downloaded to or deleted from cache. + This callback can be called spontaneously or in response to ts3Functions.getAvatar() +*/ +void ts3plugin_onAvatarUpdated(uint64 serverConnectionHandlerID, anyID clientID, + const char* avatarPath) +{ +} + +/* + Called when a plugin menu item (see ts3plugin_initMenus) is triggered. Optional function, when not using plugin menus, do not implement this. + + Parameters: + - serverConnectionHandlerID: ID of the current server tab + - type: Type of the menu (PLUGIN_MENU_TYPE_CHANNEL, PLUGIN_MENU_TYPE_CLIENT or PLUGIN_MENU_TYPE_GLOBAL) + - menuItemID: Id used when creating the menu item + - selectedItemID: Channel or Client ID in the case of PLUGIN_MENU_TYPE_CHANNEL and PLUGIN_MENU_TYPE_CLIENT. 0 for PLUGIN_MENU_TYPE_GLOBAL. +*/ +void ts3plugin_onMenuItemEvent(uint64 serverConnectionHandlerID, + enum PluginMenuType type, int menuItemID, uint64 selectedItemID) +{ + printf("PLUGIN: onMenuItemEvent: serverConnectionHandlerID=%llu, type=%d, menuItemID=%d, selectedItemID=%llu\n", + (long long unsigned int)serverConnectionHandlerID, type, menuItemID, + (long long unsigned int)selectedItemID); + switch (type) + { + case PLUGIN_MENU_TYPE_GLOBAL: + /* Global menu item was triggered. selectedItemID is unused and set to zero. */ + switch (menuItemID) + { + default: + break; + } + break; + case PLUGIN_MENU_TYPE_CHANNEL: + /* Channel contextmenu item was triggered. selectedItemID is the channelID of the selected channel */ + switch (menuItemID) + { + case MENU_ID_CHANNEL_VIDEO_START_PRIVATE: + case MENU_ID_CHANNEL_VIDEO_START_PUBLIC: + { + // Collect required information. + anyID clientId = 0; + char clientName[255]; + uint64 channelOfClient = 0; + char* serverAddress = NULL; + uint64 serverPort = 0; + uint64 targetChannelId = selectedItemID; + const char* uniqueIdentifier = 0; + + if (ts3Functions.getClientID(serverConnectionHandlerID, &clientId) == ERROR_ok + && ts3Functions.getClientDisplayName(serverConnectionHandlerID, clientId, + clientName, 255) == ERROR_ok + && ts3Functions.getChannelOfClient(serverConnectionHandlerID, clientId, + &channelOfClient) == ERROR_ok + && ts3Functions.getConnectionVariableAsString(serverConnectionHandlerID, + clientId, CONNECTION_SERVER_IP, &serverAddress) == ERROR_ok + && ts3Functions.getConnectionVariableAsUInt64(serverConnectionHandlerID, + clientId, CONNECTION_SERVER_PORT, &serverPort) == ERROR_ok + && ts3Functions.getClientSelfVariableAsString(serverConnectionHandlerID, + CLIENT_UNIQUE_IDENTIFIER, &uniqueIdentifier) == ERROR_ok) + { + if (_data) + { + free(_data); + _data = 0; + } + + TS3Data* data = malloc(sizeof(TS3Data)); + data->funcs = &ts3Functions; + data->clientId = clientId; + strcpy(&data->clientUniqueIdentifier, uniqueIdentifier); + data->clientDatabaseId = 0; + strcpy(&data->clientName, clientName); + data->channelId = channelOfClient; + strcpy(&data->serverAddress, serverAddress); + data->serverPort = serverPort; + data->targetChannelId = targetChannelId; + + _data = data; + _usedMenuItemID = menuItemID; + _startRequested = 1; + + const char* returnCode = NULL; + unsigned int ret = ts3Functions.requestClientDBIDfromUID( + serverConnectionHandlerID, uniqueIdentifier, returnCode); + } + ts3Functions.freeMemory(serverAddress); + break; + } + default: + break; + } + break; + case PLUGIN_MENU_TYPE_CLIENT: + /* Client contextmenu item was triggered. selectedItemID is the clientID of the selected client */ + switch (menuItemID) + { + default: + break; + } + break; + default: + break; + } +} + +/* This function is called if a plugin hotkey was pressed. Omit if hotkeys are unused. */ +void ts3plugin_onHotkeyEvent(const char* keyword) +{ + printf("PLUGIN: Hotkey event: %s\n", keyword); + /* Identify the hotkey by keyword ("keyword_1", "keyword_2" or "keyword_3" in this example) and handle here... */ +} + +/* Called when recording a hotkey has finished after calling ts3Functions.requestHotkeyInputDialog */ +void ts3plugin_onHotkeyRecordedEvent(const char* keyword, const char* key) +{ +} + +/* Called when client custom nickname changed */ +void ts3plugin_onClientDisplayNameChanged(uint64 serverConnectionHandlerID, + anyID clientID, const char* displayName, const char* uniqueClientIdentifier) +{ +} + +// This function receives your key Identifier you send to notifyKeyEvent and should return +// the friendly device name of the device this hotkey originates from. Used for display in UI. +const char* ts3plugin_keyDeviceName(const char* keyIdentifier) +{ + return NULL; +} + +// This function translates the given key identifier to a friendly key name for display in the UI +const char* ts3plugin_displayKeyText(const char* keyIdentifier) +{ + return NULL; +} + +// This is used internally as a prefix for hotkeys so we can store them without collisions. +// Should be unique across plugins. +const char* ts3plugin_keyPrefix() +{ + return NULL; +} \ No newline at end of file diff --git a/projects/ts3plugin/plugin_23.h b/projects/ts3plugin/plugin_23.h new file mode 100644 index 0000000..a390134 --- /dev/null +++ b/projects/ts3plugin/plugin_23.h @@ -0,0 +1,328 @@ +/* + TeamSpeak 3 demo plugin + + Copyright (c) 2008-2017 TeamSpeak Systems GmbH +*/ + +#ifndef PLUGIN_H +#define PLUGIN_H + +#ifdef WIN32 +#define PLUGINS_EXPORTDLL __declspec(dllexport) +#else +#define PLUGINS_EXPORTDLL __attribute__ ((visibility("default"))) +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Required functions */ +PLUGINS_EXPORTDLL const char* ts3plugin_name(); +PLUGINS_EXPORTDLL const char* ts3plugin_version(); +PLUGINS_EXPORTDLL int ts3plugin_apiVersion(); +PLUGINS_EXPORTDLL const char* ts3plugin_author(); +PLUGINS_EXPORTDLL const char* ts3plugin_description(); +PLUGINS_EXPORTDLL void ts3plugin_setFunctionPointers(const struct TS3Functions + funcs); +PLUGINS_EXPORTDLL int ts3plugin_init(); +PLUGINS_EXPORTDLL void ts3plugin_shutdown(); + +/* Optional functions */ +PLUGINS_EXPORTDLL int ts3plugin_offersConfigure(); +PLUGINS_EXPORTDLL void ts3plugin_configure(void* handle, void* qParentWidget); +PLUGINS_EXPORTDLL void ts3plugin_registerPluginID(const char* id); +PLUGINS_EXPORTDLL const char* ts3plugin_commandKeyword(); +PLUGINS_EXPORTDLL int ts3plugin_processCommand(uint64 serverConnectionHandlerID, + const char* command); +PLUGINS_EXPORTDLL void ts3plugin_currentServerConnectionChanged( + uint64 serverConnectionHandlerID); +PLUGINS_EXPORTDLL const char* ts3plugin_infoTitle(); +PLUGINS_EXPORTDLL void ts3plugin_infoData(uint64 serverConnectionHandlerID, + uint64 id, enum PluginItemType type, char** data); +PLUGINS_EXPORTDLL void ts3plugin_freeMemory(void* data); +PLUGINS_EXPORTDLL int ts3plugin_requestAutoload(); +PLUGINS_EXPORTDLL void ts3plugin_initMenus(struct PluginMenuItem** * menuItems, + char** menuIcon); +PLUGINS_EXPORTDLL void ts3plugin_initHotkeys(struct PluginHotkey** * hotkeys); + +/* Clientlib */ +PLUGINS_EXPORTDLL void ts3plugin_onConnectStatusChangeEvent( + uint64 serverConnectionHandlerID, int newStatus, unsigned int errorNumber); +PLUGINS_EXPORTDLL void ts3plugin_onNewChannelEvent(uint64 + serverConnectionHandlerID, uint64 channelID, uint64 channelParentID); +PLUGINS_EXPORTDLL void ts3plugin_onNewChannelCreatedEvent( + uint64 serverConnectionHandlerID, uint64 channelID, uint64 channelParentID, + anyID invokerID, const char* invokerName, const char* invokerUniqueIdentifier); +PLUGINS_EXPORTDLL void ts3plugin_onDelChannelEvent(uint64 + serverConnectionHandlerID, uint64 channelID, anyID invokerID, + const char* invokerName, const char* invokerUniqueIdentifier); +PLUGINS_EXPORTDLL void ts3plugin_onChannelMoveEvent(uint64 + serverConnectionHandlerID, uint64 channelID, uint64 newChannelParentID, + anyID invokerID, const char* invokerName, const char* invokerUniqueIdentifier); +PLUGINS_EXPORTDLL void ts3plugin_onUpdateChannelEvent(uint64 + serverConnectionHandlerID, uint64 channelID); +PLUGINS_EXPORTDLL void ts3plugin_onUpdateChannelEditedEvent( + uint64 serverConnectionHandlerID, uint64 channelID, anyID invokerID, + const char* invokerName, const char* invokerUniqueIdentifier); +PLUGINS_EXPORTDLL void ts3plugin_onUpdateClientEvent(uint64 + serverConnectionHandlerID, anyID clientID, anyID invokerID, + const char* invokerName, const char* invokerUniqueIdentifier); +PLUGINS_EXPORTDLL void ts3plugin_onClientMoveEvent(uint64 + serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, + uint64 newChannelID, int visibility, const char* moveMessage); +PLUGINS_EXPORTDLL void ts3plugin_onClientMoveSubscriptionEvent( + uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, + uint64 newChannelID, int visibility); +PLUGINS_EXPORTDLL void ts3plugin_onClientMoveTimeoutEvent( + uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, + uint64 newChannelID, int visibility, const char* timeoutMessage); +PLUGINS_EXPORTDLL void ts3plugin_onClientMoveMovedEvent( + uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, + uint64 newChannelID, int visibility, anyID moverID, const char* moverName, + const char* moverUniqueIdentifier, const char* moveMessage); +PLUGINS_EXPORTDLL void ts3plugin_onClientKickFromChannelEvent( + uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, + uint64 newChannelID, int visibility, anyID kickerID, const char* kickerName, + const char* kickerUniqueIdentifier, const char* kickMessage); +PLUGINS_EXPORTDLL void ts3plugin_onClientKickFromServerEvent( + uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, + uint64 newChannelID, int visibility, anyID kickerID, const char* kickerName, + const char* kickerUniqueIdentifier, const char* kickMessage); +PLUGINS_EXPORTDLL void ts3plugin_onClientIDsEvent(uint64 + serverConnectionHandlerID, const char* uniqueClientIdentifier, anyID clientID, + const char* clientName); +PLUGINS_EXPORTDLL void ts3plugin_onClientIDsFinishedEvent( + uint64 serverConnectionHandlerID); +PLUGINS_EXPORTDLL void ts3plugin_onServerEditedEvent(uint64 + serverConnectionHandlerID, anyID editerID, const char* editerName, + const char* editerUniqueIdentifier); +PLUGINS_EXPORTDLL void ts3plugin_onServerUpdatedEvent(uint64 + serverConnectionHandlerID); +PLUGINS_EXPORTDLL int ts3plugin_onServerErrorEvent(uint64 + serverConnectionHandlerID, const char* errorMessage, unsigned int error, + const char* returnCode, const char* extraMessage); +PLUGINS_EXPORTDLL void ts3plugin_onServerStopEvent(uint64 + serverConnectionHandlerID, const char* shutdownMessage); +PLUGINS_EXPORTDLL int ts3plugin_onTextMessageEvent(uint64 + serverConnectionHandlerID, anyID targetMode, anyID toID, anyID fromID, + const char* fromName, const char* fromUniqueIdentifier, const char* message, + int ffIgnored); +PLUGINS_EXPORTDLL void ts3plugin_onTalkStatusChangeEvent( + uint64 serverConnectionHandlerID, int status, int isReceivedWhisper, + anyID clientID); +PLUGINS_EXPORTDLL void ts3plugin_onConnectionInfoEvent(uint64 + serverConnectionHandlerID, anyID clientID); +PLUGINS_EXPORTDLL void ts3plugin_onServerConnectionInfoEvent( + uint64 serverConnectionHandlerID); +PLUGINS_EXPORTDLL void ts3plugin_onChannelSubscribeEvent( + uint64 serverConnectionHandlerID, uint64 channelID); +PLUGINS_EXPORTDLL void ts3plugin_onChannelSubscribeFinishedEvent( + uint64 serverConnectionHandlerID); +PLUGINS_EXPORTDLL void ts3plugin_onChannelUnsubscribeEvent( + uint64 serverConnectionHandlerID, uint64 channelID); +PLUGINS_EXPORTDLL void ts3plugin_onChannelUnsubscribeFinishedEvent( + uint64 serverConnectionHandlerID); +PLUGINS_EXPORTDLL void ts3plugin_onChannelDescriptionUpdateEvent( + uint64 serverConnectionHandlerID, uint64 channelID); +PLUGINS_EXPORTDLL void ts3plugin_onChannelPasswordChangedEvent( + uint64 serverConnectionHandlerID, uint64 channelID); +PLUGINS_EXPORTDLL void ts3plugin_onPlaybackShutdownCompleteEvent( + uint64 serverConnectionHandlerID); +PLUGINS_EXPORTDLL void ts3plugin_onSoundDeviceListChangedEvent( + const char* modeID, int playOrCap); +PLUGINS_EXPORTDLL void ts3plugin_onEditPlaybackVoiceDataEvent( + uint64 serverConnectionHandlerID, anyID clientID, short* samples, + int sampleCount, int channels); +PLUGINS_EXPORTDLL void ts3plugin_onEditPostProcessVoiceDataEvent( + uint64 serverConnectionHandlerID, anyID clientID, short* samples, + int sampleCount, int channels, const unsigned int* channelSpeakerArray, + unsigned int* channelFillMask); +PLUGINS_EXPORTDLL void ts3plugin_onEditMixedPlaybackVoiceDataEvent( + uint64 serverConnectionHandlerID, short* samples, int sampleCount, int channels, + const unsigned int* channelSpeakerArray, unsigned int* channelFillMask); +PLUGINS_EXPORTDLL void ts3plugin_onEditCapturedVoiceDataEvent( + uint64 serverConnectionHandlerID, short* samples, int sampleCount, int channels, + int* edited); +PLUGINS_EXPORTDLL void ts3plugin_onCustom3dRolloffCalculationClientEvent( + uint64 serverConnectionHandlerID, anyID clientID, float distance, + float* volume); +PLUGINS_EXPORTDLL void ts3plugin_onCustom3dRolloffCalculationWaveEvent( + uint64 serverConnectionHandlerID, uint64 waveHandle, float distance, + float* volume); +PLUGINS_EXPORTDLL void ts3plugin_onUserLoggingMessageEvent( + const char* logMessage, int logLevel, const char* logChannel, uint64 logID, + const char* logTime, const char* completeLogString); + +/* Clientlib rare */ +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, const char* kickMessage); +PLUGINS_EXPORTDLL int ts3plugin_onClientPokeEvent(uint64 + serverConnectionHandlerID, anyID fromClientID, const char* pokerName, + const char* pokerUniqueIdentity, const char* message, int ffIgnored); +PLUGINS_EXPORTDLL void ts3plugin_onClientSelfVariableUpdateEvent( + uint64 serverConnectionHandlerID, int flag, const char* oldValue, + const char* newValue); +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); +PLUGINS_EXPORTDLL void ts3plugin_onFileListFinishedEvent( + uint64 serverConnectionHandlerID, uint64 channelID, const char* path); +PLUGINS_EXPORTDLL void ts3plugin_onFileInfoEvent(uint64 + serverConnectionHandlerID, uint64 channelID, const char* name, uint64 size, + uint64 datetime); +PLUGINS_EXPORTDLL void ts3plugin_onServerGroupListEvent( + uint64 serverConnectionHandlerID, uint64 serverGroupID, const char* name, + int type, int iconID, int saveDB); +PLUGINS_EXPORTDLL void ts3plugin_onServerGroupListFinishedEvent( + uint64 serverConnectionHandlerID); +PLUGINS_EXPORTDLL void ts3plugin_onServerGroupByClientIDEvent( + uint64 serverConnectionHandlerID, const char* name, uint64 serverGroupList, + uint64 clientDatabaseID); +PLUGINS_EXPORTDLL void ts3plugin_onServerGroupPermListEvent( + uint64 serverConnectionHandlerID, uint64 serverGroupID, + unsigned int permissionID, int permissionValue, int permissionNegated, + int permissionSkip); +PLUGINS_EXPORTDLL void ts3plugin_onServerGroupPermListFinishedEvent( + uint64 serverConnectionHandlerID, uint64 serverGroupID); +PLUGINS_EXPORTDLL void ts3plugin_onServerGroupClientListEvent( + uint64 serverConnectionHandlerID, uint64 serverGroupID, uint64 clientDatabaseID, + const char* clientNameIdentifier, const char* clientUniqueID); +PLUGINS_EXPORTDLL void ts3plugin_onChannelGroupListEvent( + uint64 serverConnectionHandlerID, uint64 channelGroupID, const char* name, + int type, int iconID, int saveDB); +PLUGINS_EXPORTDLL void ts3plugin_onChannelGroupListFinishedEvent( + uint64 serverConnectionHandlerID); +PLUGINS_EXPORTDLL void ts3plugin_onChannelGroupPermListEvent( + uint64 serverConnectionHandlerID, uint64 channelGroupID, + unsigned int permissionID, int permissionValue, int permissionNegated, + int permissionSkip); +PLUGINS_EXPORTDLL void ts3plugin_onChannelGroupPermListFinishedEvent( + uint64 serverConnectionHandlerID, uint64 channelGroupID); +PLUGINS_EXPORTDLL void ts3plugin_onChannelPermListEvent( + uint64 serverConnectionHandlerID, uint64 channelID, unsigned int permissionID, + int permissionValue, int permissionNegated, int permissionSkip); +PLUGINS_EXPORTDLL void ts3plugin_onChannelPermListFinishedEvent( + uint64 serverConnectionHandlerID, uint64 channelID); +PLUGINS_EXPORTDLL void ts3plugin_onClientPermListEvent(uint64 + serverConnectionHandlerID, uint64 clientDatabaseID, unsigned int permissionID, + int permissionValue, int permissionNegated, int permissionSkip); +PLUGINS_EXPORTDLL void ts3plugin_onClientPermListFinishedEvent( + uint64 serverConnectionHandlerID, uint64 clientDatabaseID); +PLUGINS_EXPORTDLL void ts3plugin_onChannelClientPermListEvent( + uint64 serverConnectionHandlerID, uint64 channelID, uint64 clientDatabaseID, + unsigned int permissionID, int permissionValue, int permissionNegated, + int permissionSkip); +PLUGINS_EXPORTDLL void ts3plugin_onChannelClientPermListFinishedEvent( + uint64 serverConnectionHandlerID, uint64 channelID, uint64 clientDatabaseID); +PLUGINS_EXPORTDLL void ts3plugin_onClientChannelGroupChangedEvent( + uint64 serverConnectionHandlerID, uint64 channelGroupID, uint64 channelID, + anyID clientID, anyID invokerClientID, const char* invokerName, + const char* invokerUniqueIdentity); +PLUGINS_EXPORTDLL int ts3plugin_onServerPermissionErrorEvent( + uint64 serverConnectionHandlerID, const char* errorMessage, unsigned int error, + const char* returnCode, unsigned int failedPermissionID); +PLUGINS_EXPORTDLL void ts3plugin_onPermissionListGroupEndIDEvent( + uint64 serverConnectionHandlerID, unsigned int groupEndID); +PLUGINS_EXPORTDLL void ts3plugin_onPermissionListEvent(uint64 + serverConnectionHandlerID, unsigned int permissionID, + const char* permissionName, const char* permissionDescription); +PLUGINS_EXPORTDLL void ts3plugin_onPermissionListFinishedEvent( + uint64 serverConnectionHandlerID); +PLUGINS_EXPORTDLL void ts3plugin_onPermissionOverviewEvent( + uint64 serverConnectionHandlerID, uint64 clientDatabaseID, uint64 channelID, + int overviewType, uint64 overviewID1, uint64 overviewID2, + unsigned int permissionID, int permissionValue, int permissionNegated, + int permissionSkip); +PLUGINS_EXPORTDLL void ts3plugin_onPermissionOverviewFinishedEvent( + uint64 serverConnectionHandlerID); +PLUGINS_EXPORTDLL void ts3plugin_onServerGroupClientAddedEvent( + uint64 serverConnectionHandlerID, anyID clientID, const char* clientName, + const char* clientUniqueIdentity, uint64 serverGroupID, anyID invokerClientID, + const char* invokerName, const char* invokerUniqueIdentity); +PLUGINS_EXPORTDLL void ts3plugin_onServerGroupClientDeletedEvent( + uint64 serverConnectionHandlerID, anyID clientID, const char* clientName, + const char* clientUniqueIdentity, uint64 serverGroupID, anyID invokerClientID, + const char* invokerName, const char* invokerUniqueIdentity); +PLUGINS_EXPORTDLL void ts3plugin_onClientNeededPermissionsEvent( + uint64 serverConnectionHandlerID, unsigned int permissionID, + int permissionValue); +PLUGINS_EXPORTDLL void ts3plugin_onClientNeededPermissionsFinishedEvent( + uint64 serverConnectionHandlerID); +PLUGINS_EXPORTDLL void ts3plugin_onFileTransferStatusEvent(anyID transferID, + unsigned int status, const char* statusMessage, uint64 remotefileSize, + uint64 serverConnectionHandlerID); +PLUGINS_EXPORTDLL void ts3plugin_onClientChatClosedEvent( + uint64 serverConnectionHandlerID, anyID clientID, + const char* clientUniqueIdentity); +PLUGINS_EXPORTDLL void ts3plugin_onClientChatComposingEvent( + uint64 serverConnectionHandlerID, anyID clientID, + const char* clientUniqueIdentity); +PLUGINS_EXPORTDLL void ts3plugin_onServerLogEvent(uint64 + serverConnectionHandlerID, const char* logMsg); +PLUGINS_EXPORTDLL void ts3plugin_onServerLogFinishedEvent( + uint64 serverConnectionHandlerID, uint64 lastPos, uint64 fileSize); +PLUGINS_EXPORTDLL void ts3plugin_onMessageListEvent(uint64 + serverConnectionHandlerID, uint64 messageID, + const char* fromClientUniqueIdentity, const char* subject, uint64 timestamp, + int flagRead); +PLUGINS_EXPORTDLL void ts3plugin_onMessageGetEvent(uint64 + serverConnectionHandlerID, uint64 messageID, + const char* fromClientUniqueIdentity, const char* subject, const char* message, + uint64 timestamp); +PLUGINS_EXPORTDLL void ts3plugin_onClientDBIDfromUIDEvent( + uint64 serverConnectionHandlerID, const char* uniqueClientIdentifier, + uint64 clientDatabaseID); +PLUGINS_EXPORTDLL void ts3plugin_onClientNamefromUIDEvent( + uint64 serverConnectionHandlerID, const char* uniqueClientIdentifier, + uint64 clientDatabaseID, const char* clientNickName); +PLUGINS_EXPORTDLL void ts3plugin_onClientNamefromDBIDEvent( + uint64 serverConnectionHandlerID, const char* uniqueClientIdentifier, + uint64 clientDatabaseID, const char* clientNickName); +PLUGINS_EXPORTDLL void ts3plugin_onComplainListEvent(uint64 + serverConnectionHandlerID, uint64 targetClientDatabaseID, + const char* targetClientNickName, uint64 fromClientDatabaseID, + const char* fromClientNickName, const char* complainReason, uint64 timestamp); +PLUGINS_EXPORTDLL void ts3plugin_onBanListEvent(uint64 + serverConnectionHandlerID, uint64 banid, const char* ip, const char* name, + const char* uid, uint64 creationTime, uint64 durationTime, + const char* invokerName, uint64 invokercldbid, const char* invokeruid, + const char* reason, int numberOfEnforcements, const char* lastNickName); +PLUGINS_EXPORTDLL void ts3plugin_onClientServerQueryLoginPasswordEvent( + uint64 serverConnectionHandlerID, const char* loginPassword); +PLUGINS_EXPORTDLL void ts3plugin_onPluginCommandEvent(uint64 + serverConnectionHandlerID, const char* pluginName, const char* pluginCommand); +PLUGINS_EXPORTDLL void ts3plugin_onIncomingClientQueryEvent( + uint64 serverConnectionHandlerID, const char* commandText); +PLUGINS_EXPORTDLL void ts3plugin_onServerTemporaryPasswordListEvent( + uint64 serverConnectionHandlerID, const char* clientNickname, + const char* uniqueClientIdentifier, const char* description, + const char* password, uint64 timestampStart, uint64 timestampEnd, + uint64 targetChannelID, const char* targetChannelPW); + +/* Client UI callbacks */ +PLUGINS_EXPORTDLL void ts3plugin_onAvatarUpdated(uint64 + serverConnectionHandlerID, anyID clientID, const char* avatarPath); +PLUGINS_EXPORTDLL void ts3plugin_onMenuItemEvent(uint64 + serverConnectionHandlerID, enum PluginMenuType type, int menuItemID, + uint64 selectedItemID); +PLUGINS_EXPORTDLL void ts3plugin_onHotkeyEvent(const char* keyword); +PLUGINS_EXPORTDLL void ts3plugin_onHotkeyRecordedEvent(const char* keyword, + const char* key); +PLUGINS_EXPORTDLL void ts3plugin_onClientDisplayNameChanged( + uint64 serverConnectionHandlerID, anyID clientID, const char* displayName, + const char* uniqueClientIdentifier); +PLUGINS_EXPORTDLL const char* ts3plugin_keyDeviceName(const char* + keyIdentifier); +PLUGINS_EXPORTDLL const char* ts3plugin_displayKeyText(const char* + keyIdentifier); +PLUGINS_EXPORTDLL const char* ts3plugin_keyPrefix(); + +#ifdef __cplusplus +} +#endif + +#endif