Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
WoW
Talk
English
Views
Read
Edit
History
More
Search
Navigation
Home
Random page
Help using wiki
Editions
for WoW
for WildStar
for Solar2D
Documentation
for WoW
for WildStar
Reference
WoW
⦁ FrameXML
⦁ AddOns
⦁ API
⦁ WoW Lua
WildStar
⦁ AddOns
⦁ API
⦁ WildStar Lua
Engine
Tools
What links here
Related changes
Special pages
Page information
Site
Recent Changes
Editing
WoW:API GetGameTime
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Compensating for inter-player differences === Even though the "server time" would be the generally better API for relating time between users, the "instance server not same time as login server" problem suddenly makes the server time much less valuable for consistency. A third choice for consistent times is to mix the two and run a timer correction update event in the background, where you get a base time difference between local and server time as to correct local time to server time, and base seconds (plus diff) purely off of local time. So: # seed a base time variable to a reconciled current server time + local time # use local time + saved base as a time value in AddOn (server time with second precision) # continue every fraction of second or so to see if server time has rolled over to next minute # reconcile and update base # and so on... The update event basically corrects the base difference over time to keep it accurate with server time. The base correction update is necessary because users computers can drift dramatically depending on the computer, and because users can choose to change their time zone or clock at any time. Also doing time diffs and adds is not as simple as it sounds; its a bit contrived to get it right. What you end up with however is as near second accuracy universal server time across all clients. This depends on how accurate minute rollovers form server time are and using the clients seconds counter should not drift any perceptible amount inside a minute. It appears the WoW client itself is basing the server time minute rollovers on local client time as well, just not shared with us through this function. Its unclear which communication from the server carries the time update, or how often or what triggers the actual server time updates to the client. But in practice this combination approach appears to work very very well, where recorded AddOn raid item and other DKP statistics can show to be with in the same second or so, across multiple clients who are also hopping in and out of zones and instances, sometimes constantly.
Summary:
Please note that all contributions to AddOn Studio are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
AddOn Studio Wiki:Copyrights
for details).
Submissions must be written by you, or copied from a public domain or similar free resource (see
AddOn Studio Wiki:Copyrights
for details).
Cancel
Editing help
(opens in new window)