AceComm-3.0
From WowAce Wiki
Handles addon communication and message splitting. It requires ChatThrottleLib and CallbackHandler
Contents |
[edit]
API
[edit]
:RegisterComm(prefix, handler)
- prefix (string)
- A printable character (\032-\255) classification of the message (typically AddonName or AddonNameEvent)
- handler (function or string)
- function reference or method name to call on self, defaults to "OnCommReceived". Called when a message is received.
Call the handler whenever a message is received for the passed in prefix.
[edit]
:SendCommMessage(prefix, text, distribution, target [, prio])
- prefix (string)
- A printable character (\032-\255) classification of the message (typically AddonName or AddonNameEvent)
- text (string)
- Data to send, nils (\000) not allowed and can be any length.
- distribution (string)
- Addon channel, e.g. "RAID", "GUILD", etc; see SendAddonMessage API
- target (string)
- Destination for some distributions; see SendAddonMessage API
- prio (string)
- OPTIONAL: ChatThrottleLib priority, "BULK", "NORMAL", or "ALERT". Defaults to "NORMAL"
[edit]
:UnregsiterComm(prefix)
- prefix (string)
- A printable character (\032-\255) classification of the message to unregister
Unregisters the associated handler for the passed in prefix.
[edit]
:UnregisterAllComm()
Unregisters all associated handlers from the known prefixes.
[edit]
Private API
These methods are only used internally but are documented here for completeness.
[edit]
:OnReceiveMultipartFirst(prefix, message, distribution, sender)
- prefix (string)
- The prefix from CHAT_MSG_ADDON
- message (string)
- The message from CHAT_MSG_ADDON
- distribution (string)
- The distribution from CHAT_MSG_ADDON
- sender (string)
- The sender from CHAT_MSG_ADDON
Sets up processing of a multi-part message
[edit]
:OnReceiveMultipartNext(prefix, message, distribution, sender)
- prefix (string)
- The prefix from CHAT_MSG_ADDON
- message (string)
- The message from CHAT_MSG_ADDON
- distribution (string)
- The distribution from CHAT_MSG_ADDON
- sender (string)
- The sender from CHAT_MSG_ADDON
Appends the received data to the previously set up spool.
[edit]
:OnReceiveMultipartLast(prefix, message, distribution, sender)
- prefix (string)
- The prefix from CHAT_MSG_ADDON
- message (string)
- The message from CHAT_MSG_ADDON
- distribution (string)
- The distribution from CHAT_MSG_ADDON
- sender (string)
- The sender from CHAT_MSG_ADDON
Completes the spool and passes it off to the handlers.

