Quantcast
When is Battle.net information available? - WoWInterface
Thread Tools Display Modes
09-04-11, 10:30 AM   #1
Ailae
A Rage Talon Dragon Guard
 
Ailae's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 318
When is Battle.net information available?

Does anyone when in the UI loading order information requested via Battle.net is available?

I have an addon that colors name by class they're currently playing and every once in a while (I think it's only when I do a fresh login after a few hours of being away) the class information is not available when requesting it via BNGetToonInfo(presence).

It seems to be there moments later but I haven't figured if there's an event fired in relation to it being available.

I've tried checking at PLAYER_LOGIN and PLAYER_ENTERING_WORLD but without success. It usually works if you log from on character to another.

Any ideas?
__________________
Oh, the simulated horror!
  Reply With Quote
09-04-11, 11:14 AM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,460
Try VARIABLES_LOADED just in case the Battlenet stuff is in its own WoW Addon folder. Or even BN_SELF_ONLINE which I suspect happens when you connect to battlenet.

There also seems to be a function that you can try FriendsFrame_CheckBattlenetStatus() that may return a value. FriendsFrame also uses event BN_CONNECTED.

FriendsFrame EventRoutine
elseif ( event == "PLAYER_ENTERING_WORLD" or event == "BN_CONNECTED" or event == "BN_DISCONNECTED" or event == "BN_SELF_ONLINE" ) then FriendsFrame_CheckBattlenetStatus();
__________________

Last edited by Xrystal : 09-04-11 at 11:22 AM.
  Reply With Quote
09-04-11, 11:39 AM   #3
Starinnia
Ninja Code Monkey
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 84
Actually, sometimes there is lag between the BNet servers and the WoW servers/client. This means that every so often a call to BNGetToonInfo() doesn't return full information.

I've been watching very closely since my addon RealID Toons has this issue. Sometimes the chat events happen faster than the BNet info is available. And there doesn't seem to be a real pattern to it.

As for right after you login, I'd imagine it is similar to that. I don't think the WoW servers handle the information, so there can be delays. This is most likely why the WoW client displays such limited information about RealID friends.
  Reply With Quote
09-04-11, 11:53 AM   #4
Ailae
A Rage Talon Dragon Guard
 
Ailae's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 318
I see, that would "explain" things at least.

Suppose I could register for PLAYER_ENTERING_WORLD and do that once and hope that stuff are ready the next the player zones. :P
__________________
Oh, the simulated horror!
  Reply With Quote
09-04-11, 12:04 PM   #5
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
You could add a check to see if all information you need is available, and if it isn't, start an OnUpdate which stops again very quickly, then try fetching it again.
  Reply With Quote
09-05-11, 03:58 PM   #6
Ailae
A Rage Talon Dragon Guard
 
Ailae's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 318
Managed to somewhat work around it by checking if I have something stored for that presence when I receive/send a whisper. If not, save it. And then update whenever someone logs on. Works well enough.
__________________
Oh, the simulated horror!
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » When is Battle.net information available?

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