[Time] Getting the server-synced time?
The whole answer can be found below.
Try Our
Documentation
Please check if you can find an answer in our extensive documentation.
Join Us
on Discord
Meet and talk to our staff and the entire Photon-Community via Discord.
Read More on
Stack Overflow
Find more information on Stack Overflow (for Circle members only).
[Time] Getting the server-synced time?
wiseone
2022-03-15 20:23:28
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.
Comments
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
Hello,
Those are exactly the features I needed, thank you!
Back to top