AceComm-3.0 allows you to send messages of unlimited length over the addon comm channels.
It'll automatically split the messages into multiple parts and rebuild them on the receiving end.
ChatThrottleLib is of course being used to avoid being disconnected by the server.
AceComm-3.0 can be embeded into your addon, either explicitly by calling AceComm:Embed(MyAddon) or by
specifying it as an embeded library in your AceAddon. All functions will be available on your addon object
and can be accessed directly, without having to explicitly call AceComm itself.
It is recommended to embed AceComm, otherwise you'll have to specify a custom `self` on all calls you
make into AceComm.
AceComm:RegisterComm(prefix, method)
Register for Addon Traffic on a specified prefix
Parameters
- prefix
- A printable character (\032-\255) classification of the message (typically AddonName or AddonNameEvent)
- method
- Callback to call on message reception: Function reference, or method name (string) to call on self. Defaults to "OnCommReceived"
AceComm:SendCommMessage(prefix, text, distribution, target, prio, callbackFn, callbackArg)
Send a message over the Addon Channel
Parameters
- prefix
- A printable character (\032-\255) classification of the message (typically AddonName or AddonNameEvent)
- text
- Data to send, nils (\000) not allowed. Any length.
- distribution
- Addon channel, e.g. "RAID", "GUILD", etc; see SendAddonMessage API
- target
- Destination for some distributions; see SendAddonMessage API
- prio
- OPTIONAL: ChatThrottleLib priority, "BULK", "NORMAL" or "ALERT". Defaults to "NORMAL".
- callbackFn
- OPTIONAL: callback function to be called as each chunk is sent. receives 3 args: the user supplied arg (see next), the number of bytes sent so far, and the number of bytes total to send.
- callbackArg
- 2 comments
- 2 comments
Facts
- Date created
- 19 Dec 2008
- Last updated
- 11 Aug 2009
- #4
Pharaunmizz Fri, 14 Aug 2009 19:24:35callbackFn, etc is available in the alphas right now off of the repo, and is pretty sweet :)
It's not in beta r820
- #2
cargier Thu, 14 May 2009 03:44:06I've been having all kinds of trouble with my callbacks and discovered that I was only getting 3 arguments passed to my callback function. That is, text, distribution, and sender. However, this is contrary to what I read in the Ace Tutorial. Any ideas on what's happening?