View Single Post
03-05-14, 11:13 AM   #3
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
For any unit with a valid unitID UnitRealmRelationship(unitID) will return a constant among LE_REALM_RELATION_SAME|LE_REALM_RELATION_COALESCED|LE_REALM_RELATION_VIRTUAL

For chat you might be able to use name, realm = UnitFullName("player") and compare the realm return (I'm not sure if the realm return here is normalized and can be used for a direct comparison, no access to wow to test atm)

You can also try passing the full name through Ambiguate("name","none") it should strip off the realm if it's same realm as you so you have an indirect way to test.

Edit:Saw GnomeTEC's response, that should work for most cases but it also needs to strip out apostrophes and I'm not sure for the realms with special characters in their name (some French, Italian and Portuguese/Brazilian)
The armory at least does Unicode normalization converting the accented chars to their base equivalent.

Last edited by Dridzt : 03-05-14 at 11:20 AM.
  Reply With Quote