AceComm-3.0

From WowAce Wiki

Jump to: navigation, search

Handles addon communication and message splitting. It requires ChatThrottleLib and CallbackHandler

Contents

API

: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.

: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"

:UnregsiterComm(prefix)

prefix (string) 
A printable character (\032-\255) classification of the message to unregister

Unregisters the associated handler for the passed in prefix.

:UnregisterAllComm()

Unregisters all associated handlers from the known prefixes.

Private API

These methods are only used internally but are documented here for completeness.

: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

: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.

: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.

Personal tools
Support the Site