Thread Tools Display Modes
12-11-12, 02:39 PM   #1
Elderin
A Deviate Faerie Dragon
Join Date: Nov 2012
Posts: 17
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?
  Reply With Quote
12-11-12, 04:39 PM   #2
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
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.
  Reply With Quote
12-11-12, 04:48 PM   #3
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
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.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
12-11-12, 06:13 PM   #4
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
Originally Posted by Elderin View Post
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.



Originally Posted by Elderin View Post
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.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
12-12-12, 08:11 AM   #5
Jarod24
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Jul 2012
Posts: 66
Also note. Its not guarateed that the event will ever fire after GetGuildRosterInfo() has been called.
__________________
Author of IfThen, Links in Chat
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Event Processing

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