WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   PTR API and Graphics Changes (https://www.wowinterface.com/forums/forumdisplay.php?f=175)
-   -   SendAddonMessage max length now 255, GetRegisteredAddonMessagePrefixes changed? (https://www.wowinterface.com/forums/showthread.php?t=56317)

nixchecker 06-30-18 11:44 AM

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


Kanegasi 06-30-18 11:56 AM

Quote:

Originally Posted by nixchecker (Post 328475)
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.

Nevcairiel 07-02-18 01:56 AM

Quote:

Originally Posted by nixchecker (Post 328475)
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.


All times are GMT -6. The time now is 10:51 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI