Quantcast WoWInterface - View Single Post - Faction from GetPlayerInfoByGUID()
View Single Post
12-01-12, 10:31 AM   #9
A Pyroguard Emberseer
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 1,920
Originally Posted by Phanx View Post
Can't you use ChatFrame_AddMessageEventFilter and just catch the language argument (arg3) passed with the chat message? I can't recall the last time I saw anyone /say or /yell anything in a language other than their faction's default language, so just checking for Orcish or Common should catch 99% of cases.
As mentioned, even with the slim chance of it ever happening, the language passed isn't specific enough when dealing with the Pandaren racial language. This was one of the first solutions I checked out previously.

Originally Posted by Phanx View Post
Another option would be to do what BadBoy_Levels does to check levels, and attempt to add the player to your friends list and catch the result message. If it's successful, the player is part of your faction; if it failed, the player is of the opposing faction. This wouldn't work for cross-realm players, but I think the chances of someone of the opposite faction from another server /saying or /yelling anything in a non-default language are pretty slim.
This method is similar to what GAOA does to check if a player is online, the only difference is it uses the addon channel to ping the chat server (not the player, resulting in an addon that works one-sided). If the server comes back with a player offline message, the addon reacts accordingly. Otherwise, it waits a timeout period before assuming the player is online. There may be better methods for that addon, but that's irrelevant at this moment.

As for the other addon examples, this may be an option, but for ChatLinkIcons, requesting additional data from the servers costs additional time that doesn't fit the time restraint I feel is appropriate.

Originally Posted by Phanx View Post
Finally, SendAddonMessage doesn't need a return value, as it's trivial to catch the message printed to the chat frame when sending fails, and hide it from the user.
Did this get posted on the wrong thread?
ESOUI AddOns | WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote