well in the block i provided i defined the comms table at the top with the addon's main table for sanity, as the dispatch dives into that table it should be there even if empty. Down below that code in the file you'd do something like this..
function addon.comms[<"command">](event, distro, sender, ...)
--Do Something with data
and yes, if all of your comms traffic is encoded via AceSerilzer then if something dosent decode properly it shouldn't be dispatched.
also the on decode check, could this be if say you recive an unsterilized comm message from another addon? (IE An addon directs a message at your addon but the message isn't seralized..kinda a hypothetical thing here)
That's what the "ok" return is about. If AceSerializer can't deserialize the string, it returns false. The second return value will be an error message.
the 5th arg sent to AceComm-3.0 is the priority level as used by ChatThrottle Lib to describe where in the plethora of data to send stuff out in.
IE, (back in the day) Threat-2.0 data for tanks was prolly sent with a Hight Priority dispatch, so that threat messages did queue up for another frame. "BULK" says that if there is a queue then this traffic can wait till more bandwidth is available. TBH, it is not something used often.
I copyed and pasted that out of my own addon Guild Craft, and i figured that it's traffic is not entirely important so BULK works :D
A lot of addons think that their traffic is too high value.
ALERT = This needs to get through pronto - should only ever be used for small infrequent messages. Example: something crucial to properly syncing bossmods for an encounter
NORMAL = Probably a single message where a human is waiting to see a response
BULK = Anything more than a single message, really
Heh, it's like those annoying folks at the office who always ALWAYS set their email to "high importance"
In MultiTool, I tend to send my quest gossip and taxi choices as ALERT on the grounds that I don't want there to be any artificial delay of the traffic... the whole point is to have all the toons in the party with the addon make the same choice as each other at the same time.
Will try to send other info at lower levels though.