File API.lua
Functions
GreenWallAPI.AddMessageHandler (handler, addon, priority) | Insert a handler for addon messages from the guild confederation. |
GreenWallAPI.ClearMessageHandlers (addon) | Clear our portions or all of the dispatch table entries. |
GreenWallAPI.RemoveMessageHandler (id) | Remove an addon message handler. |
GreenWallAPI.SendMessage (addon, message) | Send a message to the guild confederation. |
gw.APIDispatcher (addon, sender, message) | The API handler dispatcher |
Functions
- GreenWallAPI.AddMessageHandler (handler, addon, priority)
-
Insert a handler for addon messages from the guild confederation.
Parameters:
-
handler
: A callback function. -
addon
: The name of the addon that you want to receive meaasges from (the same one used for the name of the TOC file). If the value '*' is supplied, messages from all addons will be handled. -
priority
: A signed integer indicating relative priority, lower value is handled first. The default is 0.
Return value:
- The ID that can be used to remove the handler.
-
- GreenWallAPI.ClearMessageHandlers (addon)
-
Clear our portions or all of the dispatch table entries.
Parameters:
-
addon
: Optional identifier for the addon or '*'. If nil, all table entries will be removed. Note: A '*' value passed as addon is not a wildcard in this context, it will only matche instances where the handler was installed with '*' as the addon.
-
- GreenWallAPI.RemoveMessageHandler (id)
-
Remove an addon message handler.
Parameters:
-
id
: The ID of the callback function to remove.
Return value:
- True if a matching handler is found, false otherwise.
-
- GreenWallAPI.SendMessage (addon, message)
-
Send a message to the guild confederation.
Parameters:
-
addon
: The addon name (the same one used for the name of the TOC file). -
message
: The message to send. Accepts 8-bit data.
-
- gw.APIDispatcher (addon, sender, message)
-
The API handler dispatcher
Parameters:
-
addon
: The sending addon -
sender
: The sending player -
message
: The message contents
-