10.2 always send the realm name even if the unit is from the player's realm, this patch fixes the issues caused by the change

This commit is contained in:
Tercio Jose
2023-10-28 16:03:01 -03:00
parent b304b3bbe4
commit f870036f06
8 changed files with 125 additions and 234 deletions
+19
View File
@@ -101,6 +101,10 @@ do
CONTAINER_ENEMYDEBUFFTARGET_CLASS = 11
}
local UnitName = UnitName
local GetRealmName = GetRealmName
local initialSpecListOverride = {
[1455] = 251, --dk
[1456] = 577, --demon hunter
@@ -170,6 +174,21 @@ do
end
end
function Details:GetFullName(unitId)
local playerName, realmName = UnitName(unitId)
if (not realmName) then
realmName = GetRealmName()
end
return playerName .. "-" .. realmName
end
local _, _, _, toc = GetBuildInfo() --check game version to know which version of GetFullName to use
if (toc < 100200) then
Details.GetFullName = Details.GetCLName
end
function Details:Class(actor)
return self.classe or actor and actor.classe
end
+1 -22
View File
@@ -418,27 +418,6 @@ function SlashCmdList.DETAILS (msg, editbox)
end
print(nome, realm)
elseif (msg == "raid") then
local player, realm = "Ditador", "Azralon"
local actorName
if (realm ~= GetRealmName()) then
actorName = player.."-"..realm
else
actorName = player
end
print(actorName)
local guid = Details:FindGUIDFromName ("Ditador")
print(guid)
for i = 1, GetNumGroupMembers()-1, 1 do
local name, realm = UnitName ("party"..i)
print(name, " -- ", realm)
end
elseif (msg == "cacheparser") then
Details:PrintParserCacheIndexes()
elseif (msg == "parsercache") then
@@ -2221,7 +2200,7 @@ if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
local guildUsers = {}
local totalMembers, onlineMembers, onlineAndMobileMembers = GetNumGuildMembers()
local realmName = GetRealmName()
--create a string to use into the gsub call when removing the realm name from the player name, by default all player names returned from GetGuildRosterInfo() has PlayerName-RealmName format
local realmNameGsub = "%-.*"
local guildName = GetGuildInfo("player")