Fix missing BNet-Function for Burning Crusade Classic

This commit is contained in:
robin 2021-05-23 11:44:49 +02:00
parent 19b83d1b2b
commit 1d2b189e2e
1 changed files with 20 additions and 2 deletions

View File

@ -24,13 +24,31 @@ local function count(v)
end
return c
end
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)
return {
['gameAccountInfo'] = {
['clientProgram'] = client,
['realmName'] = charRealm,
['characterName'] = charName,
['isOnline'] = isOnline
}
}
end
end
end
local function checkRoster(self, dummy, event, ...)
local newroster = {}
local rostername, online, _
local dontShow = false
if(event == "GUILD_ROSTER_UPDATE") then
for i=1,GetNumGuildMembers() do
for i = 1, GetNumGuildMembers() do
rostername, _, _, _, _, _, _, _, online = GetGuildRosterInfo(i)
if(online and rostername) then
newroster[rostername]=true
@ -51,7 +69,7 @@ local function checkRoster(self, dummy, event, ...)
local _, numOnline = BNGetNumFriends()
local presenceID, isFriend,client,accid
for i = 1, numOnline do
local res = C_BattleNet.GetFriendAccountInfo(i)
local res = getBNFI(i)
if(res) then
local aci = res['gameAccountInfo']
dontShow = false