WoWInterface

WoWInterface (http://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (http://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   Event Processing (http://www.wowinterface.com/forums/showthread.php?t=45430)

Elderin 12-11-12 01:39 PM

Event Processing
 
If I want to use the information from GetGuildRosterInfo(index) I understand that for the information to be available I must first query the server with a call to GuildRoster() and then wait until the server issues the GUILD_ROSTER_UPDATE event.

A similar situation exists for GetGuildEventInfo(index) making a call to QueryGuildEventLog() and waiting for the server to issue a GUILD_EVENT_LOG_UPDATE event.

Assuming that my addon is properly registering for appropriate events to happen then

1) What is an expected wait time once a query has been submitted and the corresponding event happens so that the desired data-gathering function can be called? (Obviously, lag time would be a consideration, but assuming lag is negligible, how quick can the server be expected to have data ready?)

2) Once the addon has registered for the event, will the server continue to notify it that fresh information is available by reissuing the event when the server "sees" that something has changed until either the addon unregisters the event or the addon itself is terminated when I log out of WoW? Or do I need to continue to make the query call in order for the server to accumulate fresh info and fire off the event to my addon?

Haleth 12-11-12 03:39 PM

1) Call GetTime() after you call your query function, then call it again first thing in your OnEvent function. Substract the first return from the second. This is the time elapsed in milliseconds.

2) I believe the query only has to be called once. It's also called by the default UI when you open the guild frame, I think. I'm not entirely sure on that though.

Seerah 12-11-12 03:48 PM

1. You don't have to worry about that. Set a script for your frame to respond to the event and your function will be run automatically. http://wowprogramming.com/docs/widge...ject/SetScript

2. I'm not sure if they fire on new information or not. According to http://wowprogramming.com/docs/event..._ROSTER_UPDATE that one should. Not sure on the other. Type /eventtrace and experiment. :p

SDPhantom 12-11-12 05:13 PM

Quote:

Originally Posted by Elderin (Post 270580)
1) What is an expected wait time once a query has been submitted and the corresponding event happens so that the desired data-gathering function can be called? (Obviously, lag time would be a consideration, but assuming lag is negligible, how quick can the server be expected to have data ready?)

When dealing with retrieving data from the server, latency is pretty much 99% of the delay.



Quote:

Originally Posted by Elderin (Post 270580)
2) Once the addon has registered for the event, will the server continue to notify it that fresh information is available by reissuing the event when the server "sees" that something has changed until either the addon unregisters the event or the addon itself is terminated when I log out of WoW? Or do I need to continue to make the query call in order for the server to accumulate fresh info and fire off the event to my addon?

Short answer, no. All data requests that require to be queried are on a respond-reply model. The whole purpose of this is because information like the entire roster of a large guild can end up being a lot of data to transmit. In order to cut down on bandwidth usage, this information is only sent when requested and not automatically. If there is any change to related information an addon may need, the server will only tell the game to fire a different event and require the addon to requery the server.

Jarod24 12-12-12 07:11 AM

Also note. Its not guarateed that the event will ever fire after GetGuildRosterInfo() has been called.


All times are GMT -6. The time now is 03:13 AM.

vBulletin © 2014, Jelsoft Enterprises Ltd
©2012 ZAM Network LLC