Thread Tools Display Modes
Prev Previous Post   Next Post Next
05-16-19, 10:02 PM   #1
galvin
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 265
BNGetGameAccountInfo() returning nil

This is a weakaura which has been working fine till recently.
So did a test had a friend whisper me thru bnet.
The IDAccount comes back 132.
BNGetFriendInfoByID(132) returns nil
rest blows up

So do I need change something or did blizzard break something?

Code:
function(Event, ...)
    local Msg = nil
    local Sender = nil
    
    if Event == "CHAT_MSG_WHISPER" then
        Msg = select(1, ...)
        Sender = Ambiguate(select(2, ...), 'none')
        
    elseif Event == "CHAT_MSG_BN_WHISPER" then
        Msg = select(1, ...)
        local IDAccount = select(13, ...)
        local IDGameAccount = select(6, BNGetFriendInfoByID(IDAccount))
        local _, ToonName, Client, RealmName = BNGetGameAccountInfo(IDGameAccount)
        
        if Client == 'WoW' and RealmName == GetRealmName() then
            Sender = ToonName
        end
    end
    
    if Sender then
        local Index = 0
        local Found = false
        local Player = nil
        local MaxMembers = GetNumGroupMembers()
        while Index < MaxMembers do
            Index = Index + 1
            Player = GetRaidRosterInfo(Index)
            if  Player and Player ~= '' and Player == Sender then
                Found = true
                aura_env.MessageText = format('%s\n%s', Sender, Msg)
                break
            end
        end
        return Found
    else
        return false
    end
end
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » BNGetGameAccountInfo() returning nil

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