Quantcast SendAddonMessage max length now 255, GetRegisteredAddonMessagePrefixes changed? - WoWInterface
Thread Tools Display Modes
06-30-18, 11:44 AM   #1
nixchecker
A Kobold Labourer
Join Date: Nov 2011
Posts: 1
SendAddonMessage max length now 255, GetRegisteredAddonMessagePrefixes changed?

Hello you all!

I just noticed that on the PTR the maximum message length of SendAddonMessage seems to be 255, regardless of the prefix's length. Checked again on LIVE, and it's 255, too. Has this always been the case or did i miss some patch notes? I thought the maximum length was 255 - prefix length - 1

Code:
[C_ChatInfo.]SendAddonMessage("longprefix12345","123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-","WHISPER",UnitName("player"))
...
CHAT_MSG_ADDON(prefix, msg, channel, from)
-> msg:len() = 255

The other thing is that on the PTR right now, GetRegisteredAddonMessagePrefixes disregards the table argument, and always returns a new table:

Code:
LIVE:
/run local t={}GetRegisteredAddonMessagePrefixes(t)print(#t)
-> 5
/run local t={1,2,3}GetRegisteredAddonMessagePrefixes(t)print(#t,t[1],t[2],t[3],t[4],t[5])
-> 5 prefix1 prefix2 prefix3 prefix4 prefix5
/run print(#GetRegisteredAddonMessagePrefixes())
-> 5

PTR:
/run local t={}C_ChatInfo.GetRegisteredAddonMessagePrefixes(t)print(#t)
-> 0
/run local t={1,2,3}C_ChatInfo.GetRegisteredAddonMessagePrefixes(t)print(#t,t[1],t[2],t[3],t[4],t[5])
-> 3 1 2 3 nil nil
/run print(#C_ChatInfo.GetRegisteredAddonMessagePrefixes())
-> 5
  Reply With Quote
06-30-18, 11:56 AM   #2
Kanegasi
A Frostmaul Preserver
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 284
Originally Posted by nixchecker View Post
The other thing is that on the PTR right now, GetRegisteredAddonMessagePrefixes disregards the table argument, and always returns a new table
I have noticed a somewhat disturbing trend where all these new changes and reorganizations in WoW's Lua have zero regard for memory. Using large amounts of memory is one thing, such as giant tables of data or caching function returns, but dumping large amounts for garbage to constantly collect is ridiculous. Generating a new table every function return can only be the work of someone that doesn't know what they're doing. This prefix function isn't expected to be called that often, but the other thread on map position is something potentially usable in an OnUpdate.
  Reply With Quote
07-02-18, 01:56 AM   #3
Nevcairiel
Premium Member
Premium Member
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 60
Originally Posted by nixchecker View Post
I just noticed that on the PTR the maximum message length of SendAddonMessage seems to be 255, regardless of the prefix's length. Checked again on LIVE, and it's 255, too. Has this always been the case or did i miss some patch notes? I thought the maximum length was 255 - prefix length - 1
This has been the case for quite some time already, at least back to 2011, which was the earlist indication I could find of that.
Supposedly there was a Blizzard post to document the change, but their forum history from back then went kaput.

Last edited by Nevcairiel : 07-02-18 at 02:07 AM.
  Reply With Quote

WoWInterface » PTR » PTR API and Graphics Changes » SendAddonMessage max length now 255, GetRegisteredAddonMessagePrefixes changed?

Thread Tools
Display Modes

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