--
-- TeamSpeak 3 events
--
-- This file is automatically loaded by the Lua plugin. All files loaded from this script via 'require' will
-- be automatically loaded as well. If you want to load any other Lua script in the scripts folder, call
-- "/lua load <filename>" from the TeamSpeak 3 client.
--

require("ts3defs")    -- Required
require("ts3errors")  -- Required
require("custom")     -- Demonstration and testing. Load this here to avoid having to "/lua load custom.lua" in the client.

function currentServerConnectionChanged(serverConnectionHandlerID)
	print("Lua: currentServerConnectionChanged: " .. serverConnectionHandlerID)
end

-- Clientlib

function onConnectStatusChangeEvent(serverConnectionHandlerID, status, errorNumber)
    print("Lua: onConnectStatusChangeEvent: " .. serverConnectionHandlerID .. " " .. status .. " " .. errorNumber)
end

function onNewChannelEvent(serverConnectionHandlerID, channelID, channelParentID)
    print("Lua: onNewChannelEvent: " .. serverConnectionHandlerID .. " " .. channelID .. " " .. channelParentID)
end

function onNewChannelCreatedEvent(serverConnectionHandlerID, channelID, channelParentID, invokerID, invokerName, invokerUniqueIdentifier)
    print("Lua: onNewChannelCreatedEvent: " .. serverConnectionHandlerID .. " " .. channelID .. " " .. channelParentID .. " " .. invokerID .. " " .. invokerName .. " " .. invokerUniqueIdentifier)
end

function onDelChannelEvent(serverConnectionHandlerID, channelID, invokerID, invokerName, invokerUniqueIdentifier)
    print("Lua: onDelChannelEvent: " .. serverConnectionHandlerID .. " " .. channelID .. " " .. invokerID .. " " .. invokerName .. " " .. invokerUniqueIdentifier)
end

function onChannelMoveEvent(serverConnectionHandlerID, channelID, newParentChannelID, invokerID, invokerName, invokerUniqueIdentifier)
    print("Lua: onChannelMoveEvent: " .. serverConnectionHandlerID .. " " .. channelID .. " " .. newParentChannelID .. " " .. invokerID .. " " .. invokerName .. " " .. invokerUniqueIdentifier)
end

function onUpdateChannelEvent(serverConnectionHandlerID, channelID)
	print("Lua: onUpdateChannelEvent: " .. serverConnectionHandlerID .. " " .. channelID)
end

function onUpdateChannelEditedEvent(serverConnectionHandlerID, channelID, invokerID, invokerName, invokerUniqueIdentifier)
	print("Lua: onUpdateChannelEditedEvent: " .. serverConnectionHandlerID .. " " ..  channelID .. " " .. invokerID .. " " .. invokerName .. " " .. invokerUniqueIdentifier)
end

function onUpdateClientEvent(serverConnectionHandlerID, clientID)
	print("Lua: onUpdateClientEvent: " .. serverConnectionHandlerID .. " " .. clientID)
end

function onClientMoveEvent(serverConnectionHandlerID, clientID, oldChannelID, newChannelID, visibility, moveMessage)
    print("Lua: onClientMoveEvent: " .. serverConnectionHandlerID .. " " .. clientID .. " " .. oldChannelID .. " " .. newChannelID .. " " .. visibility .. " " .. moveMessage)
end

function onClientMoveSubscriptionEvent(serverConnectionHandlerID, clientID, oldChannelID, newChannelID, visibility)
    print("Lua: onClientMoveSubscriptionEvent: " .. serverConnectionHandlerID .. " " .. clientID .. " " .. oldChannelID .. " " .. newChannelID .. " " .. visibility)
end

function onClientMoveTimeoutEvent(serverConnectionHandlerID, clientID, oldChannelID, newChannelID, visibility, timeoutMessage)
    print("Lua: onClientMoveTimeoutEvent: " .. serverConnectionHandlerID .. " " .. clientID .. " " .. oldChannelID .. " " .. newChannelID .. " " .. visibility .. " " .. timeoutMessage)
end

function onClientMoveMovedEvent(serverConnectionHandlerID, clientID, oldChannelID, newChannelID, visibility, moverID, moverName, moverUniqueIdentifier, moveMessage)
    print("Lua: onClientMoveMovedEvent: " .. serverConnectionHandlerID .. " " .. clientID .. " " .. oldChannelID .. " " .. newChannelID .. " " .. visibility .. " " .. moverID .. " " .. moverName .. " " .. moverUniqueIdentifier .. " " .. moveMessage)
end

function onClientKickFromChannelEvent(serverConnectionHandlerID, clientID, oldChannelID, newChannelID, visibility, kickerID, kickerName, kickerUniqueIdentifier, kickMessage)
    print("Lua: onClientKickFromChannelEvent: " .. serverConnectionHandlerID .. " " .. clientID .. " " .. oldChannelID .. " " .. newChannelID .. " " .. visibility .. " " .. kickerID .. " " .. kickerName .. " " .. kickerUniqueIdentifier .. " " .. kickMessage)
end

function onClientKickFromServerEvent(serverConnectionHandlerID, clientID, oldChannelID, newChannelID, visibility, kickerID, kickerName, kickerUniqueIdentifier, kickMessage)
    print("Lua: onClientKickFromServerEvent: " .. serverConnectionHandlerID .. " " .. clientID .. " " .. oldChannelID .. " " .. newChannelID .. " " .. visibility .. " " .. kickerID .. " " .. kickerName .. " " .. kickerUniqueIdentifier .. " " .. kickMessage)
end

function onServerEditedEvent(serverConnectionHandlerID, editerID, editerName, editerUniqueIdentifier)
    print("Lua: onServerEditedEvent: " .. serverConnectionHandlerID .. " " .. editerID .. " " .. editerName .. " " .. editerUniqueIdentifier)
end

function onServerUpdatedEvent(serverConnectionHandlerID)
	print("Lua: onServerUpdatedEvent: " .. serverConnectionHandlerID)
end

function onServerErrorEvent(serverConnectionHandlerID, errorMessage, errorCode, extraMessage)
    print("Lua: onServerErrorEvent: " .. serverConnectionHandlerID .. " " .. errorMessage .. " " .. errorCode)
end

function onServerStopEvent(serverConnectionHandlerID, shutdownMessage)
    print("Lua: onServerStopEvent: serverConnectionHandlerID = " .. serverConnectionHandlerID .. ", shutdownMessage = " .. shutdownMessage)
end

function onTextMessageEvent(serverConnectionHandlerID, targetMode, toID, fromID, fromName, fromUniqueIdentifier, message, ffIgnored)
    print("Lua: onTextMessageEvent: " .. serverConnectionHandlerID .. " " .. targetMode .. " " .. toID .. " " .. fromID .. " " .. fromName .. " " .. fromUniqueIdentifier .. " " .. message .. " " .. ffIgnored)
    return 0  -- Client will handle the chat as usual. Return 1 to let the client ignore the chat.
end

function onTalkStatusChangeEvent(serverConnectionHandlerID, status, isReceivedWhisper, clientID)
    print("Lua: onTalkStatusChangeEvent: " .. serverConnectionHandlerID .. " " .. status .. " " .. isReceivedWhisper .. " " .. clientID)
end

function onConnectionInfoEvent(serverConnectionHandlerID, clientID)
	print("Lua: onConnectionInfoEvent: " .. serverConnectionHandlerID .. " " .. clientID)
end

function onServerConnectionInfoEvent(serverConnectionHandlerID)
	print("Lua: onServerConnectionInfoEvent: " .. serverConnectionHandlerID)
end

function onChannelSubscribeEvent(serverConnectionHandlerID, channelID)
    print("Lua: onChannelSubscribeEvent: " .. serverConnectionHandlerID .. " " .. channelID)
end

function onChannelSubscribeFinishedEvent(serverConnectionHandlerID)
	print("Lua: onChannelSubscribeFinishedEvent: " .. serverConnectionHandlerID)
end

function onChannelUnsubscribeEvent(serverConnectionHandlerID, channelID)
    print("Lua: onChannelUnsubscribeEvent: " .. serverConnectionHandlerID .. " " .. channelID)
end

function onChannelUnsubscribeFinishedEvent(serverConnectionHandlerID)
	print("Lua: onChannelUnsubscribeFinishedEvent: " .. serverConnectionHandlerID)
end

function onChannelDescriptionUpdateEvent(serverConnectionHandlerID, channelID)
	print("Lua: onChannelDescriptionUpdateEvent: " .. serverConnectionHandlerID .. " " .. channelID)
end

function onChannelPasswordChangedEvent(serverConnectionHandlerID, channelID)
	print("Lua: onChannelPasswordChangedEvent: " .. serverConnectionHandlerID .. " " .. channelID)
end

function onPlaybackShutdownCompleteEvent(serverConnectionHandlerID)
	print("Lua: onPlaybackShutdownCompleteEvent: " .. serverConnectionHandlerID)
end

function onUserLoggingMessageEvent(logMessage, logLevel, logChannel, logID, logTime, completeLogString)
	--print("Lua: onUserLoggingMessageEvent: " .. logMessage .. " " .. logLevel .. " " .. logChannel .. " " .. logID .. " " .. logTime .. " " .. completeLogString)
	print("Lua: onUserLoggingMessageEvent: " .. completeLogString)  -- Less spam than above
end

-- Clientlib rare

function onClientBanFromServerEvent(serverConnectionHandlerID, clientID, oldChannelID, newChannelID, visibility, kickerID, kickerName, kickerUniqueIdentifier, kickTime, kickMessage)
	print("Lua: onClientBanFromServerEvent: " .. serverConnectionHandlerID .. " " .. clientID .. " " .. oldChannelID .. " " .. newChannelID .. " " .. visibility .. " " .. kickerID .. " " .. kickerName .. " " .. kickerUniqueIdentifier .. " " .. kickTime .. " " .. kickMessage)
end

function onClientPokeEvent(serverConnectionHandlerID, pokerID, pokerName, message, ffIgnored)
    print("Lua: onClientPokeEvent: " .. serverConnectionHandlerID .. " " .. pokerID .. " " .. pokerName .. " " .. message .. " " .. ffIgnored)
    return 0  -- Client will handle the poke as usual. Return 1 to let the client ignore the poke.
end

function onClientSelfVariableUpdateEvent(serverConnectionHandlerID, flag, oldValue, newValue)
	print("Lua: onClientSelfVariableUpdateEvent: " .. serverConnectionHandlerID .. " " .. flag .. " " .. oldValue .. " " .. newValue)
end

function onFileListEvent(serverConnectionHandlerID, channelID, path, name, size, datetime, type)
	print("Lua: onFileListEvent: " .. serverConnectionHandlerID .. " " .. channelID .. " " .. path .. " " .. name .. " " .. size .. " " .. datetime .. " " .. type)
end

function onFileListFinishedEvent(serverConnectionHandlerID, channelID, path)
	print("Lua: onFileListEvent: " .. serverConnectionHandlerID .. " " .. channelID .. " " .. path)
end

function onFileInfoEvent(serverConnectionHandlerID, channelID, name, size, datetime)
	print("Lua: onFileInfoEvent: " .. serverConnectionHandlerID .. " " .. channelID .. " " .. name .. " " .. size .. " " .. datetime)
end

function onServerGroupListEvent(serverConnectionHandlerID, serverGroupID, name, groupType, iconID, saveDB)
	print("Lua: onServerGroupListEvent: " .. serverConnectionHandlerID .. " " .. serverGroupID .. " " .. name .. " " .. groupType .. " " .. iconID .. " " .. saveDB)
end

function onServerGroupListFinishedEvent(serverConnectionHandlerID)
	print("Lua: onServerGroupListFinishedEvent: " .. serverConnectionHandlerID)
end

function onServerGroupByClientIDEvent(serverConnectionHandlerID, name, serverGroupList, clientDatabaseID)
	print("Lua: onServerGroupByClientIDEvent: " .. serverConnectionHandlerID .. " " .. name .. " " .. serverGroupList .. " " .. clientDatabaseID)
end

function onServerGroupPermListEvent(serverConnectionHandlerID, serverGroupID, permissionID, permissionValue, permissionNegated, permissionSkip)
	print("Lua: onServerGroupPermListEvent: " .. serverConnectionHandlerID .. " " .. serverGroupID .. " " .. permissionID .. " " .. permissionValue .. " " .. permissionNegated .. " " .. permissionSkip)
end

function onServerGroupClientListEvent(serverConnectionHandlerID, serverGroupID, clientDatabaseID, clientNameIdentifier, clientUniqueID)
	print("Lua: onServerGroupClientListEvent: " .. serverConnectionHandlerID .. " " .. serverGroupID .. " " .. clientDatabaseID .. " " .. clientNameIdentifier .. " " .. clientUniqueID)
end

function onChannelGroupListEvent(serverConnectionHandlerID, channelGroupID, name, groupType, iconID, saveDB)
	print("Lua: onChannelGroupListEvent: " .. serverConnectionHandlerID .. " " .. channelGroupID .. " " .. name .. " " .. groupType .. " " .. iconID .. " " .. saveDB)
end

function onChannelGroupListFinishedEvent(serverConnectionHandlerID)
	print("Lua: onChannelGroupListFinishedEvent: " .. serverConnectionHandlerID)
end

function onChannelGroupPermListEvent(serverConnectionHandlerID, channelGroupID, permissionID, permissionValue, permissionNegated, permissionSkip)
	print("Lua: onChannelGroupPermListEvent: " .. serverConnectionHandlerID .. " " .. channelGroupID .. " " .. permissionID .. " " .. permissionValue .. " " .. permissionNegated .. " " .. permissionSkip)
end

function onChannelPermListEvent(serverConnectionHandlerID, channelID, permissionID, permissionValue, permissionNegated, permissionSkip)
	print("Lua: onChannelPermListEvent: " .. serverConnectionHandlerID .. " " .. channelID .. " " .. permissionID .. " " .. permissionValue .. " " .. permissionNegated .. " " .. permissionSkip)
end

function onClientChannelGroupChangedEvent(serverConnectionHandlerID, channelGroupID, channelID, clientID, invokerClientID, invokerName, invokerUniqueIdentity)
	print("Lua: onClientChannelGroupChangedEvent: " .. serverConnectionHandlerID .. " " .. channelGroupID .. " " .. channelID .. " " .. clientID .. " " .. invokerClientID .. " " .. invokerName .. " " .. invokerUniqueIdentity)
end

function onServerPermissionErrorEvent(serverConnectionHandlerID, errorMessage, errorCode, failedPermissionID)
	print("Lua: onServerPermissionErrorEvent: " .. serverConnectionHandlerID .. " " .. errorMessage .. " " .. errorCode .. " " .. failedPermissionID)
end

function onPermissionListEvent(serverConnectionHandlerID, permissionID, permissionName, permissionDescription)
	print("Lua: onPermissionListEvent: " .. serverConnectionHandlerID .. " " .. permissionID .. " " .. permissionName .. " " .. permissionDescription)
end

function onPermissionListFinishedEvent(serverConnectionHandlerID)
	print("Lua: onPermissionListFinishedEvent: " .. serverConnectionHandlerID)
end

function onPermissionOverviewEvent(serverConnectionHandlerID, clientDatabaseID, channelID, overviewType, overviewID1, overviewID2, permissionID, permissionValue, permissionNegated, permissionSkip)
	print("Lua: onPermissionOverviewEvent: " .. serverConnectionHandlerID .. " " .. clientDatabaseID .. " " .. channelID .. " " .. overviewType .. " " .. overviewID1 .. " " .. overviewID2 .. " " .. permissionID .. " " .. permissionValue .. " " .. permissionNegated .. " " .. permissionSkip)
end

function onPermissionOverviewFinishedEvent(serverConnectionHandlerID)
	print("Lua: onPermissionOverviewFinishedEvent: " .. serverConnectionHandlerID)
end

function onServerGroupClientAddedEvent(serverConnectionHandlerID, clientID, clientName, clientUniqueIdentity, serverGroupID, invokerClientID, invokerName, invokerUniqueIdentity)
	print("Lua: onServerGroupClientAddedEvent: " .. serverConnectionHandlerID .. " " .. clientID .. " " .. clientName .. " " .. clientUniqueIdentity .. " " .. serverGroupID .. " " .. invokerClientID .. " " .. invokerName .. " " .. invokerUniqueIdentity)
end

function onServerGroupClientDeletedEvent(serverConnectionHandlerID, clientID, clientName, clientUniqueIdentity, serverGroupID, invokerClientID, invokerName, invokerUniqueIdentity)
	print("Lua: onServerGroupClientDeletedEvent: " .. serverConnectionHandlerID .. " " .. clientID .. " " .. clientName .. " " .. clientUniqueIdentity .. " " .. serverGroupID .. " " .. invokerClientID .. " " .. invokerName .. " " .. invokerUniqueIdentity)
end

function onClientNeededPermissionsEvent(serverConnectionHandlerID, permissionID, permissionValue)
	print("Lua: onClientNeededPermissionsEvent: " .. serverConnectionHandlerID .. " " .. permissionID .. " " .. permissionValue)
end

function onClientNeededPermissionsFinishedEvent(serverConnectionHandlerID)
	print("Lua: onClientNeededPermissionsFinishedEvent: " .. serverConnectionHandlerID)
end

function onFileTransferStatusEvent(transferID, status, statusMessage, remotefileSize, serverConnectionHandlerID)
	print("Lua: onFileTransferStatusEvent: " .. transferID .. " " .. status .. " " .. statusMessage .. " " .. remotefileSize .. " " .. serverConnectionHandlerID)
end

function onClientChatClosedEvent(serverConnectionHandlerID, clientID)
	print("Lua: onClientChatClosedEvent: " .. serverConnectionHandlerID .. " " .. clientID)
end

function onClientChatComposingEvent(serverConnectionHandlerID, clientID)
	print("Lua: onClientChatComposingEvent: " .. serverConnectionHandlerID .. " " .. clientID)
end

function onServerLogEvent(serverConnectionHandlerID, logTimestamp, logChannel, logLevel, logMsg)
	print("Lua: onServerLogEvent: " .. serverConnectionHandlerID .. " " .. logMsg)
end

function onServerLogFinishedEvent(serverConnectionHandlerID)
	print("Lua: onServerLogFinishedEvent: " .. serverConnectionHandlerID)
end

function onServerQueryEvent(serverConnectionHandlerID, result)
	print("Lua: onServerQueryEvent: " .. serverConnectionHandlerID .. " " .. result)
end

function onMessageListEvent(serverConnectionHandlerID, messageID, fromClientUniqueIdentity, subject, timestamp, flagRead)
	print("Lua: onMessageListEvent: " .. serverConnectionHandlerID .. " " .. messageID .. " " .. fromClientUniqueIdentity .. " " .. subject .. " " .. timestamp .. " " .. flagRead)
end

function onMessageGetEvent(serverConnectionHandlerID, messageID, fromClientUniqueIdentity, subject, message, timestamp)
	print("Lua: onMessageGetEvent: " .. serverConnectionHandlerID .. " " .. messageID .. " " .. fromClientUniqueIdentity .. " " .. subject .. " " .. message .. " " .. timestamp)
end

function onClientDBIDfromUIDEvent(serverConnectionHandlerID, uniqueClientIdentifier, clientDatabaseID)
	print("Lua: onClientDBIDfromUIDEvent: " .. serverConnectionHandlerID .. " " .. uniqueClientIdentifier .. " " .. clientDatabaseID)
end

function onClientNamefromUIDEvent(serverConnectionHandlerID, uniqueClientIdentifier, clientDatabaseID, clientNickName)
	print("Lua: onClientNamefromUIDEvent: " .. serverConnectionHandlerID .. " " .. uniqueClientIdentifier .. " " .. clientDatabaseID .. " " .. clientNickName)
end

function onClientNamefromDBIDEvent(serverConnectionHandlerID, uniqueClientIdentifier, clientDatabaseID, clientNickName)
	print("Lua: onClientNamefromDBIDEvent: " .. serverConnectionHandlerID .. " " .. uniqueClientIdentifier .. " " .. clientDatabaseID .. " " .. clientNickName)
end

function onComplainListEvent(serverConnectionHandlerID, targetClientDatabaseID, targetClientNickName, fromClientDatabaseID, fromClientNickName, complainReason, timestamp)
	print("Lua: onComplainListEvent: " .. serverConnectionHandlerID .. " " .. targetClientDatabaseID .. " " .. targetClientNickName .. " " .. fromClientDatabaseID .. " " .. fromClientNickName .. " " .. complainReason .. " " .. timestamp)
end

function onBanListEvent(serverConnectionHandlerID, banid, ip, name, uid, creationTime, durationTime, invokerName, invokercldbid, invokeruid, numberOfEnforcements)
	print("Lua: onBanListEvent: " .. serverConnectionHandlerID .. " " .. banid .. " " .. ip .. " " .. name .. " " .. uid .. " " .. creationTime .. " " .. durationTime .. " " .. invokerName .. " " .. invokercldbid .. " " .. invokeruid .. " " .. numberOfEnforcements)
end

function onClientServerQueryLoginPasswordEvent(serverConnectionHandlerID, loginPassword)
	print("Lua: onClientServerQueryLoginPasswordEvent: " .. serverConnectionHandlerID .. " " .. loginPassword)
end

function onPluginCommandEvent(serverConnectionHandlerID, pluginName, pluginCommand)
	print("Lua: onPluginCommandEvent: " .. serverConnectionHandlerID .. " " .. pluginName .. " " .. pluginCommand)
end

--[[

Currently available TS3 clientlib functions to be called from Lua:

********** Clientlib **********

*** Common ***
ts3.getClientLibVersion() > version, error

*** Error handling ***
ts3.getErrorMessage(errorCode) > errorMessage, error

*** Loggin ***
ts3.logMessage(logMessage, severity, channel, logID) > error

*** Preprocessor ***
ts3.getPreProcessorInfoValueFloat(serverConnectionHandlerID, ident) > result, error
ts3.getPreProcessorConfigValue(serverConnectionHandlerID, ident) > result, error
ts3.setPreProcessorConfigValue(serverConnectionHandlerID, ident, value) > error

*** Encoder ***
ts3.getEncodeConfigValue(serverConnectionHandlerID, ident) > result, error

*** Playback ***
ts3.getPlaybackConfigValueAsFloat(serverConnectionHandlerID, ident) > result, error
ts3.setPlaybackConfigValue(serverConnectionHandlerID, ident, value) > error

*** Interaction with the server
ts3.requestClientMove(serverConnectionHandlerID, clientID, newChannelID, password) > error
ts3.requestClientVariables(serverConnectionHandlerID, clientID) > error
ts3.requestClientKickFromChannel(serverConnectionHandlerID, clientID, kickReason) > error
ts3.requestClientKickFromServer(serverConnectionHandlerID, clientID, kickReason) > error
ts3.requestChannelDelete(serverConnectionHandlerID, channelID, force) > error
ts3.requestChannelMove(serverConnectionHandlerID, channelID, newChannelParentID) > error
ts3.requestSendPrivateTextMsg(serverConnectionHandlerID, message, targetClientID) > error
ts3.requestSendChannelTextMsg(serverConnectionHandlerID, message, targetChannelID) > error
ts3.requestSendServerTextMsg(serverConnectionHandlerID, message) > error
ts3.requestConnectionInfo(serverConnectionHandlerID, clientID) > error
-- requestClientSetWhisperList  TODO
ts3.requestChannelSubscribe(serverConnectionHandlerID, channelID) > error
ts3.requestChannelUnsubscribe(serverConnectionHandlerID, channelID) > error
ts3.requestChannelSubscribeAll(serverConnectionHandlerID) > error
ts3.requestChannelUnsubscribeAll(serverConnectionHandlerID) > error
ts3.requestChannelDescription(serverConnectionHandlerID, channelID) > error
-- requestMuteClients  TODO
-- requestUnmuteClients  TODO

*** Access clientlib information ***
*** Query own client ID ***
ts3.getClientID(serverConnectionHandlerID) > clientID, error

*** Client info ***
ts3.getClientSelfVariableAsInt(serverConnectionHandlerID, flag) > result, error
ts3.getClientSelfVariableAsString(serverConnectionHandlerID, flag) > result, error
ts3.setClientSelfVariableAsInt(serverConnectionHandlerID, flag, value) > error
ts3.setClientSelfVariableAsString(serverConnectionHandlerID, flag, value) > error
ts3.flushClientSelfUpdates(serverConnectionHandlerID) > error
ts3.getClientVariableAsInt(serverConnectionHandlerID, clientID, flag) > result, error
ts3.getClientVariableAsUInt64(serverConnectionHandlerID, clientID, flag) > result, error
ts3.getClientVariableAsString(serverConnectionHandlerID, clientID, flag) > result, error
ts3.getClientList(serverConnectionHandlerID) > clientsList, error
ts3.getChannelOfClient(serverConnectionHandlerID, clientID) > channelID, error

*** Client connection info
ts3.getConnectionStatus(serverConnectionHandlerID) > result, error
getConnectionVariableAsUInt64(serverConnectionHandlerID, clientID, flag) > result, error
getConnectionVariableAsDouble(serverConnectionHandlerID, clientID, flag) > result, error
getConnectionVariableAsString(serverConnectionHandlerID, clientID, flag) > result, error
cleanUpConnectionInfo(serverConnectionHandlerID, clientID) > error

*** Channel info ***
ts3.getChannelVariableAsInt(serverConnectionHandlerID, channelID, flag) > result, error
ts3.getChannelVariableAsString(serverConnectionHandlerID, channelID, flag) > result, error
ts3.getChannelIDFromChannelNames(serverConnectionHandlerID, channelNames) > channelID, error
ts3.setChannelVariableAsInt(serverConnectionHandlerID, channelID, flag, value) > error
ts3.setChannelVariableAsString(serverConnectionHandlerID, channelID, flag, value) > error
ts3.flushChannelUpdates(serverConnectionHandlerID, channelID) > error
ts3.flushChannelCreation(serverConnectionHandlerID, channelParentID) > error
ts3.getChannelList(serverConnectionHandlerID) > channelList, error
ts3.getChannelClientList(serverConnectionHandlerID, channelID) > clientList, error
ts3.getParentChannelOfChannel(serverConnectionHandlerID, channelID) > parentChannelID, error

*** Server info ***
ts3.getServerConnectionHandlerList() > serverConnectionHandlerIDList, error
ts3.getServerVariableAsInt(serverConnectionHandlerID, flag) > result, error
ts3.getServerVariableAsUInt64(serverConnectionHandlerID, flag) > result, error
ts3.getServerVariableAsString(serverConnectionHandlerID, flag) > result, error
ts3.requestServerVariables(serverConnectionHandlerID) > error

********** Clientlib rare **********

*** Sound ***
ts3.playWaveFile(serverConnectionHandlerID, path) > error

*** Interacting with the server - general ***
ts3.requestClientPoke(serverConnectionHandlerID, clientID, message) > error

*** Interacting with the server - banning ***
ts3.banclient(serverConnectionHandlerID, clientID, timeInSeconds, banReason) > error
ts3.banadd(serverConnectionHandlerID, ipRegExp, nameRegexp, uniqueIdentity, timeInSeconds, banReason) > error
ts3.bandel(serverConnectionHandlerID, banID) > error
ts3.bandelall(serverConnectionHandlerID) > error
ts3.requestBanList(serverConnectionHandlerID) > error

*** Interacting with the server - complain ***
requestComplainAdd(serverConnectionHandlerID, targetClientDatabaseID, complainReason) > error
requestComplainDel(serverConnectionHandlerID, targetClientDatabaseID, fromClientDatabaseID) > error
requestComplainDelAll(serverConnectionHandlerID, targetClientDatabaseID) > error
requestComplainList(serverConnectionHandlerID, targetClientDatabaseID) > error
	
********** Client functions **********

ts3.getAppPath() > appPath
ts3.getResourcesPath() > resourcesPath
ts3.getConfigPath() > configPath
ts3.getPluginPath() > pluginPath
ts3.getCurrentServerConnectionHandlerID() > serverConnectionHandlerID
ts3.printMessage(serverConnectionHandlerID, message, pluginMessageTargetMode)
ts3.printMessageToCurrentTab(message)
ts3.urlsToBB(textWithURLs) > bbCodeText

]]--
