Fallout and proposed workaround to the recent SendWho() restrictions in Classic
Blizzard placed a restriction on scripts using SendWho() and got rid of SendWhoToUI(), to kill the use of Who in scripts like LFG addons for classic and perhaps this is good thing. But one thing needs to come back (or be unbroken) is basic information request about players... Finding basic player information { Class, Race, Sex, Level } if the player's name is known. Addons that color names in channels by class is an example of when then this information is needed.
If all the devs with addons that need this information implement the exact same protocol for querying the information, we can get this information request ability back... Using whisper addon messages, an online player has the option (by having or not having the addon installed) to give information about themselves; it's a simple request / respond protocol. Click here for the most recent version of the proposed workaround (pastebin)... |
You don't need an addon to color names by class:
/run SetCVar("chatClassColorOverride",0) Also, race and sex are available in GetPlayerInfoByGUID(). Most, if not all, chat events that have a player name also give a GUID. The only thing chat-related affected by the SendWho restriction is level. |
Don't worry, you're fine. I wasn't attacking you, just informing you. You don't need UnitGUID to get a player's GUID from chat, it comes in the 12th argument in chat event payloads. It's how that cvar I mentioned works in the UI code.
Lua Code:
GetColoredName is called every single time ChatFrame_MessageEventHandler is called. Also, as long as any event gives you the GUID, it will return usable values, no matter who the player is. It's a universal solution for every player your UI interacts with. You're right about the cache thing, but there's no point in asking for info about an offline player or a player you don't see anywhere in the UI anyways. |
Quote:
Thanks! :) |
All times are GMT -6. The time now is 05:30 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI