WoW Application Messaging

From Sirikata Wiki
Revision as of 20:02, 11 August 2010 by Jterrace (talk | contribs)
Jump to navigation Jump to search

WoW SendAddonMessage Function

Sends a message to the hidden addon channel.

SendAddonMessage("prefix", "text", "type", "target")

Parameters

  • prefix - String - Message prefix, can be used as your addon identifier.
  • text - String - Text to send.
  • type - String - AddOn channel to send to. Valid types are "PARTY", "RAID", "GUILD", "BATTLEGROUND", "WHISPER".
  • target - String - Used only for "WHISPER" communication - the player to whisper to.

Example

SendAddonMessage( "CTRA", "User Data: XYZ", "RAID" );

Notes

  • Calling this function results in the event CHAT_MSG_ADDON being invoked on:
    • <target>'s client if <type> is "WHISPER" or
    • all clients in the <type> chat channel, otherwise
  • Messages sent to <type> when you are not in the specified community will not be delivered.
  • The message will not be affected by the player's level of drunkenness.
  • The tab character ("\t") is used as a delimiter between the prefix and the message text
    • because of this, \t can not be used as part of prefix
    • The combined length of message and prefix can be at most 254 characters (255th is the tab character used to delimit the two)
    • length above 254 will disconnect you.
  • except NULL (ASCII dec-ID 0) all characters (decimal ID 1-255) are allowed (in opposition to SendChatMessage where many characters are disallowed)

AceComm Library Settings

A commonly used library called AceComm is a wrapper around the above API function because of some of the difficulties in using it. Below are AceComm settings that give you an idea of the hoops that application developers have to jump through to ensure that they play nicely.

ChatThrottleLib.MAX_CPS = 800       -- 2000 seems to be safe if NOTHING ELSE is happening. let's call it 800.
ChatThrottleLib.MSG_OVERHEAD = 40   -- Guesstimate overhead for sending a message; source+dest+chattype+protocolstuff
ChatThrottleLib.BURST = 4000        -- WoW's server buffer seems to be about 32KB. 8KB should be safe, but seen
                                       disconnects on _some_ servers. Using 4KB now.
ChatThrottleLib.MIN_FPS = 20        -- Reduce output CPS to half (and don't burst) if FPS drops below this value