From 24e89bbb2c656224d06aed084b952bbc885e3914 Mon Sep 17 00:00:00 2001 From: Samuel Barney Date: Mon, 18 Jul 2016 14:39:11 -0600 Subject: Feature: Channel Management with Lua API Allows lua plugins to register handles for channel messages. * Only one handle can be registered for one channel at a time. * Plugins can also add and remove clients from channels, sending the appropriate packet to the client. --- Server/Plugins/APIDump/APIDesc.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'Server/Plugins/APIDump/APIDesc.lua') diff --git a/Server/Plugins/APIDump/APIDesc.lua b/Server/Plugins/APIDump/APIDesc.lua index 40bda49d7..5351b98e9 100644 --- a/Server/Plugins/APIDump/APIDesc.lua +++ b/Server/Plugins/APIDump/APIDesc.lua @@ -437,6 +437,22 @@ return }, }, -- cBlockInfo + cChannelManager = + { + Desc = [[ + This class allows plugins to register handlers for specific plugin channels. + ]], + + Functions = + { + AddClientToChannel = { Params = "{{cClientHandle}}, Channel Name", Notes = "Adds and registers a client on the specified channel." }, + RemoveClientFromChannel = { Params = "{{cClientHandle}}, Channel Name", Notes = "Removes and unregisters a client on the specified channel." }, + RegisterChannel = { Params = "Channel Name, Callback", Return = "bool", Notes = "Registers a handler for a specific channel. Returns true if it was able to be registered." }, + RemoveChannel = { Params = "Channel Name", Return = "bool", Notes = "Removes the handler for the specified channel. Returns true if the handler was removed." }, + BroadcastChannelMessage = { Params = "Channel Name, Message, {{cWorld|World}}", Notes = "Sends the message on the specified channel. Limits the message to the specified world, if provided." } + } + }, -- cChannelManager + cChatColor = { Desc = [[ @@ -2288,6 +2304,7 @@ end Functions = { DoesAllowMultiLogin = { Params = "", Return = "boolean", Notes = "Returns true if players can log in multiple times from the same account (normally used for debugging), false if only one player per name is allowed." }, + GetChannelManager = { Return = "{{cChannelManager}}", Notes = "Returns the {{cChannelManager|Channel Manager}}." }, GetDescription = { Return = "string", Notes = "Returns the server description set in the settings.ini." }, GetMaxPlayers = { Return = "number", Notes = "Returns the max amount of players who can join the server." }, GetNumPlayers = { Return = "number", Notes = "Returns the amount of players online." }, -- cgit v1.2.3