PhotonNetwork.ServerTimestamp reads completely different values

Options
I read a discussion that using PhotonNetwork.ServerTimestamp can replace wrapping issues in PhotonNetwork.Time. So after implementing PhotonNetwork.ServerTimestamp I get this value when I am outside the room "187996267", and after joining the room I receive "-1687035466". Both values are completely different, what is the reason for that? anyone, please explain it.

Comments

  • Tobias
    Options
    The value is "per server" and during matchmaking the client will change servers. All players who are in the same room, will use the same server and should get (about) the same value.
  • Vasan_Routh
    edited July 2021
    Options
    Okay, now I got that! Confused because of the negative value that it's returning. But it doesn't mess around with the timer, now it's working fine thanks!
  • steamcore
    Options
    OH CRAP. I am using this value in conjunction with Photon.Chat to save some stats on a match that you can "resume" by re-entering the room. If you do this after all players leave, it still recreates the cached state and lets you back into the photon room. I have been seeing crazy values not explained by wrap-around, and this is it. I guess I'll go to some other authoritative (gmt based) time service.
  • Tobias
    Tobias admin
    edited August 2021
    Options
    Vasan: Negative values are not a problem as such, as long as you calculate the difference between any two timestamps, this will be a positive number (substract the older time from the newer) and the correct delta.

    Steamcore: Right. If you recreate a room, after it was removed, there is no guarantee it will end up on the same server again, so timestamps no longer make sense.