Removed realmName and related functions

This commit is contained in:
robin 2021-05-24 10:34:10 +02:00
parent 3d1e5ba5c5
commit cc5e2e51eb
1 changed files with 8 additions and 13 deletions

View File

@ -2,7 +2,7 @@ local addonName, addon = ...
local childName = addon['childName']
local child = addon[childName]
local events = child['events']
local db, crealm
local db
local fmt = "|c0000ff00%i|r/|c0000ffff%i|r|c00ff0000%s|r"
local roster,friendroster,bnetroster = {}, {}, {}
local GuildRoster = GuildRoster
@ -28,14 +28,12 @@ local function getBNFI(friendIndex)
if(C_BattleNet and C_BattleNet.GetFriendAccountInfo) then
return C_BattleNet.GetFriendAccountInfo(friendIndex)
else
local bnetIDAccount, accountName, battleTag, isBattleTagPresence, characterName, bnetIDGameAccount, client, isOnline, lastOnline, isAFK, isDND, messageText, noteText, isRIDFriend, messageTime, canSoR, isReferAFriend, canSummonFriend = BNGetFriendInfo(friendIndex)
if(characterName) then
local charName, charRealm = strsplit('-', characterName, 2)
local _, _, _, _, characterName, _, client, isOnline = BNGetFriendInfo(friendIndex)
if(characterName and isOnline and client == BNET_CLIENT_WOW) then
return {
['gameAccountInfo'] = {
['clientProgram'] = client,
['realmName'] = charRealm,
['characterName'] = charName,
['characterName'] = characterName,
['isOnline'] = isOnline
}
}
@ -75,7 +73,7 @@ local function checkRoster(self, dummy, event, ...)
dontShow = false
if(aci) then
if(aci['clientProgram'] == BNET_CLIENT_WOW) then
if(aci['realmName'] == crealm and friendroster[aci['characterName']]) then
if(friendroster[aci['characterName']]) then
dontShow = true
end
end
@ -115,11 +113,8 @@ child['specs'] = {
}
}
function events:PLAYER_ENTERING_WORLD(event)
crealm = GetRealmName()
if(crealm) then
child:UnregisterEvent('PLAYER_ENTERING_WORLD')
child:RegisterEvent({"GUILD_ROSTER_UPDATE","FRIENDLIST_UPDATE","CHAT_MSG_CHANNEL_JOIN","CHAT_MSG_CHANNEL_LEAVE","PLAYER_FLAGS_CHANGED","UNIT_FLAGS","BN_FRIEND_INFO_CHANGED"}, checkRoster)
OnUpdate()
end
child:UnregisterEvent('PLAYER_ENTERING_WORLD')
child:RegisterEvent({"GUILD_ROSTER_UPDATE","FRIENDLIST_UPDATE","CHAT_MSG_CHANNEL_JOIN","CHAT_MSG_CHANNEL_LEAVE","PLAYER_FLAGS_CHANGED","UNIT_FLAGS","BN_FRIEND_INFO_CHANGED"}, checkRoster)
OnUpdate()
end
child:NewAddOn(...)