B1uscr34m

ts3events.lua

Nov 26th, 2014
166
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --
  2. -- TeamSpeak 3 events
  3. --
  4. -- This file is automatically loaded by the Lua plugin. All files loaded from this script via 'require' will
  5. -- be automatically loaded as well.
  6. --
  7. -- You should not modify this file to hook into the callback functions and load your script via require, as
  8. -- this file will be overwritten and restored to the original state by the updater. Instead you should create
  9. -- a new directory inside the lua_plugin folder and put your Lua code there. A file init.lua must exist for
  10. -- the autoload mechanism to load your scripts. See the testmodule code as an example.
  11. --
  12. -- Scripts not load via the autoload mechanism can be loaded at runtime from the TeamSpeak 3 client by typing
  13. -- "/lua load <filename>" from in the chat input.
  14. --
  15.  
  16. require("ts3defs")      -- Required
  17. require("ts3errors")    -- Required
  18. require("ts3init")      -- Required
  19. require("ts3autoload")  -- Required
  20.  
  21. -- Common print function to be able to disable print output by commenting out just one line
  22. -- Enable to read debug output for each callback in the console (Pass "-console" commandline parameter to TS3 client)
  23. local function debugPrint(msg)
  24.     --print(msg)
  25. end
  26.  
  27. function currentServerConnectionChanged(serverConnectionHandlerID)
  28.     debugPrint("Lua: currentServerConnectionChanged: " .. serverConnectionHandlerID)
  29. end
  30.  
  31. -- Clientlib
  32.  
  33. function onConnectStatusChangeEvent(serverConnectionHandlerID, status, errorNumber)
  34.     debugPrint("Lua: onConnectStatusChangeEvent: " .. serverConnectionHandlerID .. " " .. status .. " " .. errorNumber)
  35.     for script,events in pairs(ts3RegisteredModules) do
  36.         if events.onConnectStatusChangeEvent ~= nil then
  37.             events.onConnectStatusChangeEvent(serverConnectionHandlerID, status, errorNumber)
  38.         end
  39.     end
  40. end
  41.  
  42. function onNewChannelEvent(serverConnectionHandlerID, channelID, channelParentID)
  43.     debugPrint("Lua: onNewChannelEvent: " .. serverConnectionHandlerID .. " " .. channelID .. " " .. channelParentID)
  44.     for script,events in pairs(ts3RegisteredModules) do
  45.         if events.onNewChannelEvent ~= nil then
  46.             events.onNewChannelEvent(serverConnectionHandlerID, channelID, channelParentID)
  47.         end
  48.     end
  49. end
  50.  
  51. function onNewChannelCreatedEvent(serverConnectionHandlerID, channelID, channelParentID, invokerID, invokerName, invokerUniqueIdentifier)
  52.     debugPrint("Lua: onNewChannelCreatedEvent: " .. serverConnectionHandlerID .. " " .. channelID .. " " .. channelParentID .. " " .. invokerID .. " " .. invokerName .. " " .. invokerUniqueIdentifier)
  53.     for script,events in pairs(ts3RegisteredModules) do
  54.         if events.onNewChannelCreatedEvent ~= nil then
  55.             events.onNewChannelCreatedEvent(serverConnectionHandlerID, channelID, channelParentID, invokerID, invokerName, invokerUniqueIdentifier)
  56.         end
  57.     end
  58. end
  59.  
  60. function onDelChannelEvent(serverConnectionHandlerID, channelID, invokerID, invokerName, invokerUniqueIdentifier)
  61.     debugPrint("Lua: onDelChannelEvent: " .. serverConnectionHandlerID .. " " .. channelID .. " " .. invokerID .. " " .. invokerName .. " " .. invokerUniqueIdentifier)
  62.     for script,events in pairs(ts3RegisteredModules) do
  63.         if events.onDelChannelEvent ~= nil then
  64.             events.onDelChannelEvent(serverConnectionHandlerID, channelID, invokerID, invokerName, invokerUniqueIdentifier)
  65.         end
  66.     end
  67. end
  68.  
  69. function onChannelMoveEvent(serverConnectionHandlerID, channelID, newParentChannelID, invokerID, invokerName, invokerUniqueIdentifier)
  70.     debugPrint("Lua: onChannelMoveEvent: " .. serverConnectionHandlerID .. " " .. channelID .. " " .. newParentChannelID .. " " .. invokerID .. " " .. invokerName .. " " .. invokerUniqueIdentifier)
  71.     for script,events in pairs(ts3RegisteredModules) do
  72.         if events.onChannelMoveEvent ~= nil then
  73.             events.onChannelMoveEvent(serverConnectionHandlerID, channelID, newParentChannelID, invokerID, invokerName, invokerUniqueIdentifier)
  74.         end
  75.     end
  76. end
  77.  
  78. function onUpdateChannelEvent(serverConnectionHandlerID, channelID)
  79.     debugPrint("Lua: onUpdateChannelEvent: " .. serverConnectionHandlerID .. " " .. channelID)
  80.     for script,events in pairs(ts3RegisteredModules) do
  81.         if events.onUpdateChannelEvent ~= nil then
  82.             events.onUpdateChannelEvent(serverConnectionHandlerID, channelID)
  83.         end
  84.     end
  85. end
  86.  
  87. function onUpdateChannelEditedEvent(serverConnectionHandlerID, channelID, invokerID, invokerName, invokerUniqueIdentifier)
  88.     debugPrint("Lua: onUpdateChannelEditedEvent: " .. serverConnectionHandlerID .. " " ..  channelID .. " " .. invokerID .. " " .. invokerName .. " " .. invokerUniqueIdentifier)
  89.     for script,events in pairs(ts3RegisteredModules) do
  90.         if events.onUpdateChannelEditedEvent ~= nil then
  91.             events.onUpdateChannelEditedEvent(serverConnectionHandlerID, channelID, invokerID, invokerName, invokerUniqueIdentifier)
  92.         end
  93.     end
  94. end
  95.  
  96. function onUpdateClientEvent(serverConnectionHandlerID, clientID, invokerID, invokerName, invokerUniqueIdentifier)
  97.     debugPrint("Lua: onUpdateClientEvent: " .. serverConnectionHandlerID .. " " .. clientID .. " " .. invokerID .. " " .. invokerName .. " " .. invokerUniqueIdentifier)
  98.     for script,events in pairs(ts3RegisteredModules) do
  99.         if events.onUpdateClientEvent ~= nil then
  100.             events.onUpdateClientEvent(serverConnectionHandlerID, clientID, invokerID, invokerName, invokerUniqueIdentifier)
  101.         end
  102.     end
  103. end
  104.  
  105. function onClientMoveEvent(serverConnectionHandlerID, clientID, oldChannelID, newChannelID, visibility, moveMessage)
  106.     debugPrint("Lua: onClientMoveEvent: " .. serverConnectionHandlerID .. " " .. clientID .. " " .. oldChannelID .. " " .. newChannelID .. " " .. visibility .. " " .. moveMessage)
  107.     for script,events in pairs(ts3RegisteredModules) do
  108.         if events.onClientMoveEvent ~= nil then
  109.             events.onClientMoveEvent(serverConnectionHandlerID, clientID, oldChannelID, newChannelID, visibility, moveMessage)
  110.         end
  111.     end
  112. end
  113.  
  114. function onClientMoveSubscriptionEvent(serverConnectionHandlerID, clientID, oldChannelID, newChannelID, visibility)
  115.     debugPrint("Lua: onClientMoveSubscriptionEvent: " .. serverConnectionHandlerID .. " " .. clientID .. " " .. oldChannelID .. " " .. newChannelID .. " " .. visibility)
  116.     for script,events in pairs(ts3RegisteredModules) do
  117.         if events.onClientMoveSubscriptionEvent ~= nil then
  118.             events.onClientMoveSubscriptionEvent(serverConnectionHandlerID, clientID, oldChannelID, newChannelID, visibility)
  119.         end
  120.     end
  121. end
  122.  
  123. function onClientMoveTimeoutEvent(serverConnectionHandlerID, clientID, oldChannelID, newChannelID, visibility, timeoutMessage)
  124.     debugPrint("Lua: onClientMoveTimeoutEvent: " .. serverConnectionHandlerID .. " " .. clientID .. " " .. oldChannelID .. " " .. newChannelID .. " " .. visibility .. " " .. timeoutMessage)
  125.     for script,events in pairs(ts3RegisteredModules) do
  126.         if events.onClientMoveTimeoutEvent ~= nil then
  127.             events.onClientMoveTimeoutEvent(serverConnectionHandlerID, clientID, oldChannelID, newChannelID, visibility, timeoutMessage)
  128.         end
  129.     end
  130. end
  131.  
  132. function onClientMoveMovedEvent(serverConnectionHandlerID, clientID, oldChannelID, newChannelID, visibility, moverID, moverName, moverUniqueIdentifier, moveMessage)
  133.     debugPrint("Lua: onClientMoveMovedEvent: " .. serverConnectionHandlerID .. " " .. clientID .. " " .. oldChannelID .. " " .. newChannelID .. " " .. visibility .. " " .. moverID .. " " .. moverName .. " " .. moverUniqueIdentifier .. " " .. moveMessage)
  134.     for script,events in pairs(ts3RegisteredModules) do
  135.         if events.onClientMoveMovedEvent ~= nil then
  136.             events.onClientMoveMovedEvent(serverConnectionHandlerID, clientID, oldChannelID, newChannelID, visibility, moverID, moverName, moverUniqueIdentifier, moveMessage)
  137.         end
  138.     end
  139. end
  140.  
  141. function onClientKickFromChannelEvent(serverConnectionHandlerID, clientID, oldChannelID, newChannelID, visibility, kickerID, kickerName, kickerUniqueIdentifier, kickMessage)
  142.     debugPrint("Lua: onClientKickFromChannelEvent: " .. serverConnectionHandlerID .. " " .. clientID .. " " .. oldChannelID .. " " .. newChannelID .. " " .. visibility .. " " .. kickerID .. " " .. kickerName .. " " .. kickerUniqueIdentifier .. " " .. kickMessage)
  143.     for script,events in pairs(ts3RegisteredModules) do
  144.         if events.onClientKickFromChannelEvent ~= nil then
  145.             events.onClientKickFromChannelEvent(serverConnectionHandlerID, clientID, oldChannelID, newChannelID, visibility, kickerID, kickerName, kickerUniqueIdentifier, kickMessage)
  146.         end
  147.     end
  148. end
  149.  
  150. function onClientKickFromServerEvent(serverConnectionHandlerID, clientID, oldChannelID, newChannelID, visibility, kickerID, kickerName, kickerUniqueIdentifier, kickMessage)
  151.     debugPrint("Lua: onClientKickFromServerEvent: " .. serverConnectionHandlerID .. " " .. clientID .. " " .. oldChannelID .. " " .. newChannelID .. " " .. visibility .. " " .. kickerID .. " " .. kickerName .. " " .. kickerUniqueIdentifier .. " " .. kickMessage)
  152.     for script,events in pairs(ts3RegisteredModules) do
  153.         if events.onClientKickFromServerEvent ~= nil then
  154.             events.onClientKickFromServerEvent(serverConnectionHandlerID, clientID, oldChannelID, newChannelID, visibility, kickerID, kickerName, kickerUniqueIdentifier, kickMessage)
  155.         end
  156.     end
  157. end
  158.  
  159. function onServerEditedEvent(serverConnectionHandlerID, editerID, editerName, editerUniqueIdentifier)
  160.     debugPrint("Lua: onServerEditedEvent: " .. serverConnectionHandlerID .. " " .. editerID .. " " .. editerName .. " " .. editerUniqueIdentifier)
  161.     for script,events in pairs(ts3RegisteredModules) do
  162.         if events.onServerEditedEvent ~= nil then
  163.             events.onServerEditedEvent(serverConnectionHandlerID, editerID, editerName, editerUniqueIdentifier)
  164.         end
  165.     end
  166. end
  167.  
  168. function onServerUpdatedEvent(serverConnectionHandlerID)
  169.     debugPrint("Lua: onServerUpdatedEvent: " .. serverConnectionHandlerID)
  170.     for script,events in pairs(ts3RegisteredModules) do
  171.         if events.onServerUpdatedEvent ~= nil then
  172.             events.onServerUpdatedEvent(serverConnectionHandlerID)
  173.         end
  174.     end
  175. end
  176.  
  177. function onServerErrorEvent(serverConnectionHandlerID, errorMessage, errorCode, extraMessage)
  178.     debugPrint("Lua: onServerErrorEvent: " .. serverConnectionHandlerID .. " " .. errorMessage .. " " .. errorCode)
  179.     for script,events in pairs(ts3RegisteredModules) do
  180.         if events.onServerErrorEvent ~= nil then
  181.             events.onServerErrorEvent(serverConnectionHandlerID, errorMessage, errorCode, extraMessage)
  182.         end
  183.     end
  184. end
  185.  
  186. function onServerStopEvent(serverConnectionHandlerID, shutdownMessage)
  187.     debugPrint("Lua: onServerStopEvent: serverConnectionHandlerID = " .. serverConnectionHandlerID .. ", shutdownMessage = " .. shutdownMessage)
  188.     for script,events in pairs(ts3RegisteredModules) do
  189.         if events.onServerStopEvent ~= nil then
  190.             events.onServerStopEvent(serverConnectionHandlerID, shutdownMessage)
  191.         end
  192.     end
  193. end
  194.  
  195. function onTextMessageEvent(serverConnectionHandlerID, targetMode, toID, fromID, fromName, fromUniqueIdentifier, message, ffIgnored)
  196.     debugPrint("Lua: onTextMessageEvent: " .. serverConnectionHandlerID .. " " .. targetMode .. " " .. toID .. " " .. fromID .. " " .. fromName .. " " .. fromUniqueIdentifier .. " " .. message .. " " .. ffIgnored)
  197.     local retVal = 0
  198.     for script,events in pairs(ts3RegisteredModules) do
  199.         if events.onTextMessageEvent ~= nil then
  200.             local result = events.onTextMessageEvent(serverConnectionHandlerID, targetMode, toID, fromID, fromName, fromUniqueIdentifier, message, ffIgnored)
  201.             if result > 0 then
  202.                 retVal = 1  -- If at least one Lua module returns 1, this function will also return 1 and let the client ignore the text message
  203.             end
  204.         end
  205.     end
  206.     return retVal  -- Return 0: Client will handle the text message as usual. Return 1: Client will ignore the test message.
  207. end
  208.  
  209. function onTalkStatusChangeEvent(serverConnectionHandlerID, status, isReceivedWhisper, clientID)
  210.     debugPrint("Lua: onTalkStatusChangeEvent: " .. serverConnectionHandlerID .. " " .. status .. " " .. isReceivedWhisper .. " " .. clientID)
  211.     for script,events in pairs(ts3RegisteredModules) do
  212.         if events.onTalkStatusChangeEvent ~= nil then
  213.             events.onTalkStatusChangeEvent(serverConnectionHandlerID, status, isReceivedWhisper, clientID)
  214.         end
  215.     end
  216. end
  217.  
  218. function onConnectionInfoEvent(serverConnectionHandlerID, clientID)
  219.     debugPrint("Lua: onConnectionInfoEvent: " .. serverConnectionHandlerID .. " " .. clientID)
  220.     for script,events in pairs(ts3RegisteredModules) do
  221.         if events.onConnectionInfoEvent ~= nil then
  222.             events.onConnectionInfoEvent(serverConnectionHandlerID, clientID)
  223.         end
  224.     end
  225. end
  226.  
  227. function onServerConnectionInfoEvent(serverConnectionHandlerID)
  228.     debugPrint("Lua: onServerConnectionInfoEvent: " .. serverConnectionHandlerID)
  229.     for script,events in pairs(ts3RegisteredModules) do
  230.         if events.onServerConnectionInfoEvent ~= nil then
  231.             events.onServerConnectionInfoEvent(serverConnectionHandlerID)
  232.         end
  233.     end
  234. end
  235.  
  236. function onChannelSubscribeEvent(serverConnectionHandlerID, channelID)
  237.     debugPrint("Lua: onChannelSubscribeEvent: " .. serverConnectionHandlerID .. " " .. channelID)
  238.     for script,events in pairs(ts3RegisteredModules) do
  239.         if events.onChannelSubscribeEvent ~= nil then
  240.             events.onChannelSubscribeEvent(serverConnectionHandlerID, channelID)
  241.         end
  242.     end
  243. end
  244.  
  245. function onChannelSubscribeFinishedEvent(serverConnectionHandlerID)
  246.     debugPrint("Lua: onChannelSubscribeFinishedEvent: " .. serverConnectionHandlerID)
  247.     for script,events in pairs(ts3RegisteredModules) do
  248.         if events.onChannelSubscribeFinishedEvent ~= nil then
  249.             events.onChannelSubscribeFinishedEvent(serverConnectionHandlerID)
  250.         end
  251.     end
  252. end
  253.  
  254. function onChannelUnsubscribeEvent(serverConnectionHandlerID, channelID)
  255.     debugPrint("Lua: onChannelUnsubscribeEvent: " .. serverConnectionHandlerID .. " " .. channelID)
  256.     for script,events in pairs(ts3RegisteredModules) do
  257.         if events.onChannelUnsubscribeEvent ~= nil then
  258.             events.onChannelUnsubscribeEvent(serverConnectionHandlerID, channelID)
  259.         end
  260.     end
  261. end
  262.  
  263. function onChannelUnsubscribeFinishedEvent(serverConnectionHandlerID)
  264.     debugPrint("Lua: onChannelUnsubscribeFinishedEvent: " .. serverConnectionHandlerID)
  265.     for script,events in pairs(ts3RegisteredModules) do
  266.         if events.onChannelUnsubscribeFinishedEvent ~= nil then
  267.             events.onChannelUnsubscribeFinishedEvent(serverConnectionHandlerID)
  268.         end
  269.     end
  270. end
  271.  
  272. function onChannelDescriptionUpdateEvent(serverConnectionHandlerID, channelID)
  273.     debugPrint("Lua: onChannelDescriptionUpdateEvent: " .. serverConnectionHandlerID .. " " .. channelID)
  274.     for script,events in pairs(ts3RegisteredModules) do
  275.         if events.onChannelDescriptionUpdateEvent ~= nil then
  276.             events.onChannelDescriptionUpdateEvent(serverConnectionHandlerID, channelID)
  277.         end
  278.     end
  279. end
  280.  
  281. function onChannelPasswordChangedEvent(serverConnectionHandlerID, channelID)
  282.     debugPrint("Lua: onChannelPasswordChangedEvent: " .. serverConnectionHandlerID .. " " .. channelID)
  283.     for script,events in pairs(ts3RegisteredModules) do
  284.         if events.onChannelPasswordChangedEvent ~= nil then
  285.             events.onChannelPasswordChangedEvent(serverConnectionHandlerID, channelID)
  286.         end
  287.     end
  288. end
  289.  
  290. function onPlaybackShutdownCompleteEvent(serverConnectionHandlerID)
  291.     debugPrint("Lua: onPlaybackShutdownCompleteEvent: " .. serverConnectionHandlerID)
  292.     for script,events in pairs(ts3RegisteredModules) do
  293.         if events.onPlaybackShutdownCompleteEvent ~= nil then
  294.             events.onPlaybackShutdownCompleteEvent(serverConnectionHandlerID)
  295.         end
  296.     end
  297. end
  298.  
  299. -- Clientlib rare
  300.  
  301. function onClientBanFromServerEvent(serverConnectionHandlerID, clientID, oldChannelID, newChannelID, visibility, kickerID, kickerName, kickerUniqueIdentifier, kickTime, kickMessage)
  302.     debugPrint("Lua: onClientBanFromServerEvent: " .. serverConnectionHandlerID .. " " .. clientID .. " " .. oldChannelID .. " " .. newChannelID .. " " .. visibility .. " " .. kickerID .. " " .. kickerName .. " " .. kickerUniqueIdentifier .. " " .. kickTime .. " " .. kickMessage)
  303.     for script,events in pairs(ts3RegisteredModules) do
  304.         if events.XXX ~= nil then
  305.             events.XXX()
  306.         end
  307.     end
  308. end
  309.  
  310. function onClientPokeEvent(serverConnectionHandlerID, pokerID, pokerName, message, ffIgnored)
  311.     debugPrint("Lua: onClientPokeEvent: " .. serverConnectionHandlerID .. " " .. pokerID .. " " .. pokerName .. " " .. message .. " " .. ffIgnored)
  312.     local retVal = 0
  313.     for script,events in pairs(ts3RegisteredModules) do
  314.         if events.onClientPokeEvent ~= nil then
  315.             local result = events.onClientPokeEvent(serverConnectionHandlerID, pokerID, pokerName, message, ffIgnored)
  316.             if result > 0 then
  317.                 retVal = 1  -- If at least one Lua module returns 1, this function will also return 1 and let the client ignore the poke
  318.             end
  319.         end
  320.     end
  321.     return retVal  -- Return 0: Client will handle the poke as usual. Return 1: Client will ignore the poke.
  322. end
  323.  
  324. function onClientSelfVariableUpdateEvent(serverConnectionHandlerID, flag, oldValue, newValue)
  325.     debugPrint("Lua: onClientSelfVariableUpdateEvent: " .. serverConnectionHandlerID .. " " .. flag .. " " .. oldValue .. " " .. newValue)
  326.     for script,events in pairs(ts3RegisteredModules) do
  327.         if events.onClientSelfVariableUpdateEvent ~= nil then
  328.             events.onClientSelfVariableUpdateEvent(serverConnectionHandlerID, flag, oldValue, newValue)
  329.         end
  330.     end
  331. end
  332.  
  333. function onServerGroupListEvent(serverConnectionHandlerID, serverGroupID, name, groupType, iconID, saveDB)
  334.     debugPrint("Lua: onServerGroupListEvent: " .. serverConnectionHandlerID .. " " .. serverGroupID .. " " .. name .. " " .. groupType .. " " .. iconID .. " " .. saveDB)
  335.     for script,events in pairs(ts3RegisteredModules) do
  336.         if events.onServerGroupListEvent ~= nil then
  337.             events.onServerGroupListEvent(serverConnectionHandlerID, serverGroupID, name, groupType, iconID, saveDB)
  338.         end
  339.     end
  340. end
  341.  
  342. function onServerGroupListFinishedEvent(serverConnectionHandlerID)
  343.     debugPrint("Lua: onServerGroupListFinishedEvent: " .. serverConnectionHandlerID)
  344.     for script,events in pairs(ts3RegisteredModules) do
  345.         if events.onServerGroupListFinishedEvent ~= nil then
  346.             events.onServerGroupListFinishedEvent(serverConnectionHandlerID)
  347.         end
  348.     end
  349. end
  350.  
  351. function onServerGroupByClientIDEvent(serverConnectionHandlerID, name, serverGroupList, clientDatabaseID)
  352.     debugPrint("Lua: onServerGroupByClientIDEvent: " .. serverConnectionHandlerID .. " " .. name .. " " .. serverGroupList .. " " .. clientDatabaseID)
  353.     for script,events in pairs(ts3RegisteredModules) do
  354.         if events.onServerGroupByClientIDEvent ~= nil then
  355.             events.onServerGroupByClientIDEvent(serverConnectionHandlerID, name, serverGroupList, clientDatabaseID)
  356.         end
  357.     end
  358. end
  359.  
  360. function onServerGroupPermListEvent(serverConnectionHandlerID, serverGroupID, permissionID, permissionValue, permissionNegated, permissionSkip)
  361.     debugPrint("Lua: onServerGroupPermListEvent: " .. serverConnectionHandlerID .. " " .. serverGroupID .. " " .. permissionID .. " " .. permissionValue .. " " .. permissionNegated .. " " .. permissionSkip)
  362.     for script,events in pairs(ts3RegisteredModules) do
  363.         if events.onServerGroupPermListEvent ~= nil then
  364.             events.onServerGroupPermListEvent(serverConnectionHandlerID, serverGroupID, permissionID, permissionValue, permissionNegated, permissionSkip)
  365.         end
  366.     end
  367. end
  368.  
  369. function onServerGroupClientListEvent(serverConnectionHandlerID, serverGroupID, clientDatabaseID, clientNameIdentifier, clientUniqueID)
  370.     debugPrint("Lua: onServerGroupClientListEvent: " .. serverConnectionHandlerID .. " " .. serverGroupID .. " " .. clientDatabaseID .. " " .. clientNameIdentifier .. " " .. clientUniqueID)
  371.     for script,events in pairs(ts3RegisteredModules) do
  372.         if events.onServerGroupClientListEvent ~= nil then
  373.             events.onServerGroupClientListEvent(serverConnectionHandlerID, serverGroupID, clientDatabaseID, clientNameIdentifier, clientUniqueID)
  374.         end
  375.     end
  376. end
  377.  
  378. function onChannelGroupListEvent(serverConnectionHandlerID, channelGroupID, name, groupType, iconID, saveDB)
  379.     debugPrint("Lua: onChannelGroupListEvent: " .. serverConnectionHandlerID .. " " .. channelGroupID .. " " .. name .. " " .. groupType .. " " .. iconID .. " " .. saveDB)
  380.     for script,events in pairs(ts3RegisteredModules) do
  381.         if events.onChannelGroupListEvent ~= nil then
  382.             events.onChannelGroupListEvent(serverConnectionHandlerID, channelGroupID, name, groupType, iconID, saveDB)
  383.         end
  384.     end
  385. end
  386.  
  387. function onChannelGroupListFinishedEvent(serverConnectionHandlerID)
  388.     debugPrint("Lua: onChannelGroupListFinishedEvent: " .. serverConnectionHandlerID)
  389.     for script,events in pairs(ts3RegisteredModules) do
  390.         if events.onChannelGroupListFinishedEvent ~= nil then
  391.             events.onChannelGroupListFinishedEvent(serverConnectionHandlerID)
  392.         end
  393.     end
  394. end
  395.  
  396. function onChannelGroupPermListEvent(serverConnectionHandlerID, channelGroupID, permissionID, permissionValue, permissionNegated, permissionSkip)
  397.     debugPrint("Lua: onChannelGroupPermListEvent: " .. serverConnectionHandlerID .. " " .. channelGroupID .. " " .. permissionID .. " " .. permissionValue .. " " .. permissionNegated .. " " .. permissionSkip)
  398.     for script,events in pairs(ts3RegisteredModules) do
  399.         if events.onChannelGroupPermListEvent ~= nil then
  400.             events.onChannelGroupPermListEvent(serverConnectionHandlerID, channelGroupID, permissionID, permissionValue, permissionNegated, permissionSkip)
  401.         end
  402.     end
  403. end
  404.  
  405. function onChannelPermListEvent(serverConnectionHandlerID, channelID, permissionID, permissionValue, permissionNegated, permissionSkip)
  406.     debugPrint("Lua: onChannelPermListEvent: " .. serverConnectionHandlerID .. " " .. channelID .. " " .. permissionID .. " " .. permissionValue .. " " .. permissionNegated .. " " .. permissionSkip)
  407.     for script,events in pairs(ts3RegisteredModules) do
  408.         if events.onChannelPermListEvent ~= nil then
  409.             events.onChannelPermListEvent(serverConnectionHandlerID, channelID, permissionID, permissionValue, permissionNegated, permissionSkip)
  410.         end
  411.     end
  412. end
  413.  
  414. function onClientChannelGroupChangedEvent(serverConnectionHandlerID, channelGroupID, channelID, clientID, invokerClientID, invokerName, invokerUniqueIdentity)
  415.     debugPrint("Lua: onClientChannelGroupChangedEvent: " .. serverConnectionHandlerID .. " " .. channelGroupID .. " " .. channelID .. " " .. clientID .. " " .. invokerClientID .. " " .. invokerName .. " " .. invokerUniqueIdentity)
  416.     for script,events in pairs(ts3RegisteredModules) do
  417.         if events.onClientChannelGroupChangedEvent ~= nil then
  418.             events.onClientChannelGroupChangedEvent(serverConnectionHandlerID, channelGroupID, channelID, clientID, invokerClientID, invokerName, invokerUniqueIdentity)
  419.         end
  420.     end
  421. end
  422.  
  423. function onServerPermissionErrorEvent(serverConnectionHandlerID, errorMessage, errorCode, failedPermissionID)
  424.     debugPrint("Lua: onServerPermissionErrorEvent: " .. serverConnectionHandlerID .. " " .. errorMessage .. " " .. errorCode .. " " .. failedPermissionID)
  425.     for script,events in pairs(ts3RegisteredModules) do
  426.         if events.onServerPermissionErrorEvent ~= nil then
  427.             events.onServerPermissionErrorEvent(serverConnectionHandlerID, errorMessage, errorCode, failedPermissionID)
  428.         end
  429.     end
  430. end
  431.  
  432. function onPermissionListGroupEndIDEvent(serverConnectionHandlerID, groupEndID)
  433.     debugPrint("Lua: onPermissionListGroupEndIDEvent: " .. serverConnectionHandlerID .. " " .. groupEndID)
  434.     for script,events in pairs(ts3RegisteredModules) do
  435.         if events.onPermissionListGroupEndIDEvent ~= nil then
  436.             events.onPermissionListGroupEndIDEvent(serverConnectionHandlerID, groupEndID)
  437.         end
  438.     end
  439. end
  440.  
  441. function onPermissionListEvent(serverConnectionHandlerID, permissionID, permissionName, permissionDescription)
  442.     debugPrint("Lua: onPermissionListEvent: " .. serverConnectionHandlerID .. " " .. permissionID .. " " .. permissionName .. " " .. permissionDescription)
  443.     for script,events in pairs(ts3RegisteredModules) do
  444.         if events.onPermissionListEvent ~= nil then
  445.             events.onPermissionListEvent(serverConnectionHandlerID, permissionID, permissionName, permissionDescription)
  446.         end
  447.     end
  448. end
  449.  
  450. function onPermissionListFinishedEvent(serverConnectionHandlerID)
  451.     debugPrint("Lua: onPermissionListFinishedEvent: " .. serverConnectionHandlerID)
  452.     for script,events in pairs(ts3RegisteredModules) do
  453.         if events.onPermissionListFinishedEvent ~= nil then
  454.             events.onPermissionListFinishedEvent(serverConnectionHandlerID)
  455.         end
  456.     end
  457. end
  458.  
  459. function onPermissionOverviewEvent(serverConnectionHandlerID, clientDatabaseID, channelID, overviewType, overviewID1, overviewID2, permissionID, permissionValue, permissionNegated, permissionSkip)
  460.     debugPrint("Lua: onPermissionOverviewEvent: " .. serverConnectionHandlerID .. " " .. clientDatabaseID .. " " .. channelID .. " " .. overviewType .. " " .. overviewID1 .. " " .. overviewID2 .. " " .. permissionID .. " " .. permissionValue .. " " .. permissionNegated .. " " .. permissionSkip)
  461.     for script,events in pairs(ts3RegisteredModules) do
  462.         if events.onPermissionOverviewEvent ~= nil then
  463.             events.onPermissionOverviewEvent(serverConnectionHandlerID, clientDatabaseID, channelID, overviewType, overviewID1, overviewID2, permissionID, permissionValue, permissionNegated, permissionSkip)
  464.         end
  465.     end
  466. end
  467.  
  468. function onPermissionOverviewFinishedEvent(serverConnectionHandlerID)
  469.     debugPrint("Lua: onPermissionOverviewFinishedEvent: " .. serverConnectionHandlerID)
  470.     for script,events in pairs(ts3RegisteredModules) do
  471.         if events.onPermissionOverviewFinishedEvent ~= nil then
  472.             events.onPermissionOverviewFinishedEvent(serverConnectionHandlerID)
  473.         end
  474.     end
  475. end
  476.  
  477. function onServerGroupClientAddedEvent(serverConnectionHandlerID, clientID, clientName, clientUniqueIdentity, serverGroupID, invokerClientID, invokerName, invokerUniqueIdentity)
  478.     debugPrint("Lua: onServerGroupClientAddedEvent: " .. serverConnectionHandlerID .. " " .. clientID .. " " .. clientName .. " " .. clientUniqueIdentity .. " " .. serverGroupID .. " " .. invokerClientID .. " " .. invokerName .. " " .. invokerUniqueIdentity)
  479.     for script,events in pairs(ts3RegisteredModules) do
  480.         if events.onServerGroupClientAddedEvent ~= nil then
  481.             events.onServerGroupClientAddedEvent(serverConnectionHandlerID, clientID, clientName, clientUniqueIdentity, serverGroupID, invokerClientID, invokerName, invokerUniqueIdentity)
  482.         end
  483.     end
  484. end
  485.  
  486. function onServerGroupClientDeletedEvent(serverConnectionHandlerID, clientID, clientName, clientUniqueIdentity, serverGroupID, invokerClientID, invokerName, invokerUniqueIdentity)
  487.     debugPrint("Lua: onServerGroupClientDeletedEvent: " .. serverConnectionHandlerID .. " " .. clientID .. " " .. clientName .. " " .. clientUniqueIdentity .. " " .. serverGroupID .. " " .. invokerClientID .. " " .. invokerName .. " " .. invokerUniqueIdentity)
  488.     for script,events in pairs(ts3RegisteredModules) do
  489.         if events.onServerGroupClientDeletedEvent ~= nil then
  490.             events.onServerGroupClientDeletedEvent(serverConnectionHandlerID, clientID, clientName, clientUniqueIdentity, serverGroupID, invokerClientID, invokerName, invokerUniqueIdentity)
  491.         end
  492.     end
  493. end
  494.  
  495. function onClientNeededPermissionsEvent(serverConnectionHandlerID, permissionID, permissionValue)
  496.     debugPrint("Lua: onClientNeededPermissionsEvent: " .. serverConnectionHandlerID .. " " .. permissionID .. " " .. permissionValue)
  497.     for script,events in pairs(ts3RegisteredModules) do
  498.         if events.onClientNeededPermissionsEvent ~= nil then
  499.             events.onClientNeededPermissionsEvent(serverConnectionHandlerID, permissionID, permissionValue)
  500.         end
  501.     end
  502. end
  503.  
  504. function onClientNeededPermissionsFinishedEvent(serverConnectionHandlerID)
  505.     debugPrint("Lua: onClientNeededPermissionsFinishedEvent: " .. serverConnectionHandlerID)
  506.     for script,events in pairs(ts3RegisteredModules) do
  507.         if events.onClientNeededPermissionsFinishedEvent ~= nil then
  508.             events.onClientNeededPermissionsFinishedEvent(serverConnectionHandlerID)
  509.         end
  510.     end
  511. end
  512.  
  513. function onClientChatClosedEvent(serverConnectionHandlerID, clientID, clientUniqueIdentity)
  514.     debugPrint("Lua: onClientChatClosedEvent: " .. serverConnectionHandlerID .. " " .. clientID .. " " .. clientUniqueIdentity)
  515.     for script,events in pairs(ts3RegisteredModules) do
  516.         if events.onClientChatClosedEvent ~= nil then
  517.             events.onClientChatClosedEvent(serverConnectionHandlerID, clientID, clientUniqueIdentity)
  518.         end
  519.     end
  520. end
  521.  
  522. function onClientChatComposingEvent(serverConnectionHandlerID, clientID, clientUniqueIdentity)
  523.     debugPrint("Lua: onClientChatComposingEvent: " .. serverConnectionHandlerID .. " " .. clientID .. " " .. clientUniqueIdentity)
  524.     for script,events in pairs(ts3RegisteredModules) do
  525.         if events.onClientChatComposingEvent ~= nil then
  526.             events.onClientChatComposingEvent(serverConnectionHandlerID, clientID, clientUniqueIdentity)
  527.         end
  528.     end
  529. end
  530.  
  531. function onServerLogEvent(serverConnectionHandlerID, logMsg)
  532.     debugPrint("Lua: onServerLogEvent: " .. serverConnectionHandlerID .. " " .. logMsg)
  533.     for script,events in pairs(ts3RegisteredModules) do
  534.         if events.onServerLogEvent ~= nil then
  535.             events.onServerLogEvent(serverConnectionHandlerID, logMsg)
  536.         end
  537.     end
  538. end
  539.  
  540. function onServerLogFinishedEvent(serverConnectionHandlerID, lastPos, fileSize)
  541.     debugPrint("Lua: onServerLogFinishedEvent: " .. serverConnectionHandlerID .. " " .. lastPos .. " " .. fileSize)
  542.     for script,events in pairs(ts3RegisteredModules) do
  543.         if events.onServerLogFinishedEvent ~= nil then
  544.             events.onServerLogFinishedEvent(serverConnectionHandlerID, lastPos, fileSize)
  545.         end
  546.     end
  547. end
  548.  
  549. function onMessageListEvent(serverConnectionHandlerID, messageID, fromClientUniqueIdentity, subject, timestamp, flagRead)
  550.     debugPrint("Lua: onMessageListEvent: " .. serverConnectionHandlerID .. " " .. messageID .. " " .. fromClientUniqueIdentity .. " " .. subject .. " " .. timestamp .. " " .. flagRead)
  551.     for script,events in pairs(ts3RegisteredModules) do
  552.         if events.onMessageListEvent ~= nil then
  553.             events.onMessageListEvent(serverConnectionHandlerID, messageID, fromClientUniqueIdentity, subject, timestamp, flagRead)()
  554.         end
  555.     end
  556. end
  557.  
  558. function onMessageGetEvent(serverConnectionHandlerID, messageID, fromClientUniqueIdentity, subject, message, timestamp)
  559.     debugPrint("Lua: onMessageGetEvent: " .. serverConnectionHandlerID .. " " .. messageID .. " " .. fromClientUniqueIdentity .. " " .. subject .. " " .. message .. " " .. timestamp)
  560.     for script,events in pairs(ts3RegisteredModules) do
  561.         if events.onMessageGetEvent ~= nil then
  562.             events.onMessageG
RAW Paste Data