[Time] Getting the server-synced time?

Hi there,
How do I go about getting the actual time from the server? I cannot seem to find any timing references in the Photon Realtime's JavaScript API.
I need this to get the game room's start time to get the room's end time. And, also to synchronize object movements that have deterministic patterns, and the best way is to use time, to avoid having to broadcast it when we already have possible issues with suspending master actors.
I also need it for pinging, although this is optional since I can work around this. However, I cannot work around the time for when the game room will globally end, or for when setting the object's movement based on time.
I'm baffled, I cannot imagine making any network games without timing features, is this possible? Am I missing something?
Please let me know.
Thank you.
Best Answer
-
Hi,
I just updated the SDK to version 4.1.1.3
The update includes new methods we introduced recently : getServerTimeMs(), syncServerTime(), getRtt(), updateRtt(). See documentation https://doc-api.photonengine.com/en/javascript/current/Photon.LoadBalancing.LoadBalancingClient.html
1
Answers
-
Hi,
I just updated the SDK to version 4.1.1.3
The update includes new methods we introduced recently : getServerTimeMs(), syncServerTime(), getRtt(), updateRtt(). See documentation https://doc-api.photonengine.com/en/javascript/current/Photon.LoadBalancing.LoadBalancingClient.html
1 -
Hello,
Those are exactly the features I needed, thank you!
0