Thread Tools Display Modes
07-12-06, 07:48 AM   #1
Chef_de_Loup
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Apr 2006
Posts: 12
about SendAddonMessage()

As i have read the discussion in the official forums i have think about resolving the sending addon. As slouken said they wil not include an arg to give the identifier of the addon so it looks like we should make that by our own.
There is a suggestion for the identifier:
The first [TBD] bytes hold the identifier of the addon that have send the message. So if you get the message you can cut the identifier by using string.sub(arg1,1,[TBD]) and then compare it with the global ID of your addon.

sample code:
if event == "CHAT_MSG_ADDON" then
local id = string.sub(arg1,1,LENGTH);
if id == MyAddOnID then
local msg = string.sub(arg1,LENGTH+1);
MyAddOn_ParseMessage(msg);
end
end

LENGTH will the count of bytes you need for the identifier.

It will be best, when all addons took an agreement with the length and the type of identifier so it will be more clear to know what is the identifier.


[TBD] - To be defined
  Reply With Quote
07-12-06, 03:41 PM   #2
Esamynn
Featured Artist
Premium Member
Featured
Join Date: Jan 2005
Posts: 395
Actually, the final form of the API function addresses this.

See Iriel's Changes Thread: http://forums.worldofwarcraft.com/th...p=1#post412845
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » about SendAddonMessage()


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off