It looks like this has been brought up a few times in the past. I couldn't find a recent post so I apologize if this is a repost or has been discussed recently.

Summary:
Being the nerds that we are - I'm sure I'm not alone in having a desire for very accurate timestamp data. Many people would be able to immediately use it as it relates to the combat log. I've got some ideas where it would be great for chat events. And I'm sure people will find lots of uses for the data.

The sharding changes with Legion have been great from a gameplay point of view - but they make managing time stamps even more difficult than before as the actual server time has all but become useless.

Request:

1) Additional EVENT parameter containing Server UTC time in ms

2) Function to return current Server Time, in UTC, to ms accuracy

I realize that doing this perfectly increases server bandwidth, however I think the impact can be minimized via intelligent local maintenance of the current server time.

I believe by doing three things accurate data could be available.

First, maintain a variable locally containing the millisecond offset from local UTC time to server UTC time.

Second, periodically check with the server for large differences in local PC time and server time.

Third, with each event a 2-byte value containing a value of 0-59999 representing the second and millisecond the event occurred on the server.

Using item 1 would allow for a function call to return Server UTC Time any time it is needed. This will of course never be perfect, but the longer you are connected the more accurate it would become.

Using item 3 would allow for 100% accurate synchronization for >99% of events fired. The edge case here would be a 60s+ latency followed by a catch-up where event timing is overlaps due to only sharing the 2-byte code.

Using items 2 and 3, in combination with latency tracking would allow for a simple algorithm to keep the local server time as accurate as possible.

Minimal beneficial change:
With strictly the addition of the 2-byte value above, I believe the community could create on our own the rest of the necessary API to good accuracy, though slightly less-so than would be available from a Blizzard implementation.

Comment Requests:

Would love to have a Blue response on the subject - even if it's as simple as one of "Likely never to happen", "Will investigate for the future", "On the todo list, but not prioritized", or "Coming soon"

It sounds like what you want is a function that returns a timestamp from a single time server, because different servers aren't necessarily going to be in sync.

You can actually produce a UTC timestamp from the server using time(date('!*t', GetServerTime())), assuming the timezone on the player's computer is set correctly.

Milliseconds can be calculated as accurately as possible using an OnUpdate script and tracking elapsed time since GetServerTime() changed seconds.

In the interest of efficiency, once you've converted the server time to UTC it would be best to get the difference between that and GetServerTime() or time() and use that to avoid having to repeatedly convert it using date() because of the substantial overhead.

This method may or may not work for your project, but I figured I'd mention it here anyway.

It sounds like the problem is more that the client receives events in a different order than the server generated them sometimes.

Having the server ensure that events are well-ordered when received by the client seems hard -- it would imply needing some sort of ACK for each event, which implicitly doubles network traffic.

Putting a server timestamp on each event would at least allow for clients to reorder events, but don't you run into other problems like detecting when an event has arrived out of order without having to buffer events in a window and delay processing them?

The game server doesn't necessarily generate events like you see in the UI. The server and client exchange information constantly and it's up to the game client to generate events when it deems necessary. The server has nothing to do with it and doesn't care in the slightest.

__________________

"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."