How can I get room creation time
Best Answer
-
I should try using NTP server to set my 'room start time'0
Answers
-
Hi @THE_LINE_IO,
what do you mean exactly when saying that PhotonNetwork.time is incorrect sometimes?
You can try fetching the ServerTimestamp again manually before creating and / or joining the room by callingPhotonNetwork.FetchServerTimestamp()
. This can be done e.g. in a Coroutine because you have to wait for the result. Afterwards you can use PhotonNetwork.ServerTimestamp in order to access this value.0 -
Not working.
The issue is thatPhotonNetwork.ServerTimestamp
andPhotonNetwork.time
are getting changed when i join room
so i get diffrent values.
1 -
I should try using NTP server to set my 'room start time'0
-
yes this is ridicoluousTHE_LINE_IO said:
Not working.
The issue is thatPhotonNetwork.ServerTimestamp
andPhotonNetwork.time
are getting changed when i join room
so i get diffrent values.0 -
Hi @0xhex,
this is a wanted behaviour. When the client joins the room, the time gets synchronized with the server's time. PhotonNetwork.ServerTimestamp and PhotonNetwork.time are basically returning the same value whereat ServerTimestamp is an int value and time is a double value.0