WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   When is Battle.net information available? (https://www.wowinterface.com/forums/showthread.php?t=41349)

Ailae 09-04-11 10:30 AM

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?

Xrystal 09-04-11 11:14 AM

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();

Starinnia 09-04-11 11:39 AM

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.

Ailae 09-04-11 11:53 AM

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

Haleth 09-04-11 12:04 PM

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.

Ailae 09-05-11 03:58 PM

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.


All times are GMT -6. The time now is 12:53 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI