Thread Tools Display Modes
02-18-20, 09:24 AM   #1
Zax
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 147
Party members with server name?

Hello,

Is there a way to retreive party members' name with realm name (something like "Leroy-KirinTor")?
API GetHomePartyInfo() only returns names.

Thanks.
  Reply With Quote
02-18-20, 09:47 AM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
UnitName
If the realm return is nil then they are on your realm (GetRealmName)
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
02-18-20, 10:08 AM   #3
Zax
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 147
OK, so if I well understand, the only way is to loop on GetHomePartyInfo() result?
I can't check right now but what happen if, let's say, "Leroy" from Kirin Tor, and "Leroy" from Aggramar are in the same party?

Last edited by Zax : 02-18-20 at 10:11 AM.
  Reply With Quote
02-18-20, 12:09 PM   #4
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
A general idea.
Code:
local unit = "player"
local name = UnitName(unit)
local realm = GetRealmName()
print(unit, name, "from", realm)
for i=1, 4 do
	unit = "party"..i
	if UnitExists(unit) then
		name, realm = UnitName(unit)
		if not realm then
			realm = GetRealmName()
		end
		print(unit, name, "from", realm)
	end
end
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 02-18-20 at 02:07 PM.
  Reply With Quote
02-18-20, 02:37 PM   #5
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
If you want the normalized name for your realm (used for whisper targets), you can use GetNormalizedRealmName(). Normalized realm names generally have spaces removed. I don't know if special characters like hyphens and apostrophes are removed as well.
__________________
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
02-19-20, 07:29 AM   #6
Zax
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 147
Thank you for your answers

I finally use: name, realm = UnitFullName(unit), in order to have the "condensed" form of server name, without space.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Party members with server name?

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