PhotonNetwork.time bad data
Options
Mishaps
✭
Hi, I'm getting negative values from PhotonNetwork.time. This is causing my NetworkRigidbody.cs script to fail. In previous versions of PUN Free I was getting positive values. I saw in the changelog there was a fix for this but possible the bug is still present in 5.0.2p3.
Mac OS X 10.10.3
Unity 5.0.2p3
My project with PUN Free v1.53
PhotonNetwork.time = -1933973.248 (read from the editor)
Older copy of my project with PUN free v1.51
PhotonNetwork.time = 2360323.527 (read from the editor)
As a work-around, tomorrow morning I'll try replacing my NetworkRigidbody.cs with PhotonTransformView and PhotonRigidbodyView.
Mac OS X 10.10.3
Unity 5.0.2p3
My project with PUN Free v1.53
PhotonNetwork.time = -1933973.248 (read from the editor)
Older copy of my project with PUN free v1.51
PhotonNetwork.time = 2360323.527 (read from the editor)
As a work-around, tomorrow morning I'll try replacing my NetworkRigidbody.cs with PhotonTransformView and PhotonRigidbodyView.
0
Comments
-
Sorry, I missed this topic.
The PhotonNetwork.time can be negative. It's not a proper DateTime but a timestamp that can be used for delta times.
If it's negative, depends on the runtime of the server.
You could work around negative values by using a "start time" of the room in the properties. Keep the time when the room "started" and only use the delta to that time.0 -
Well maybe you should make PhotonMessageInfo.timestamp return negative values as well then?
Or how do I go about comparing PhotonMessageInfo.timestamp with PhotonNetwork.time?0 -
PUN+, version 1.54:
When PhotonNetwork.networkingPeer.ServerTimeInMilliSeconds == -115521508
then:
PhotonNetwork.time == -1155215.104
PhotonMessageInfo.timestamp == 3139752.208
Everything worked fine in previous versions of PUN+.
I would really appreciate if someone could explain the reasoning behind making this breaking change in the latest update and what can I do to make it work again. Is it safe for me to revert to the previous implementation of PhotonNetwork.time? Or should I change the implementation of PhotonMessageInfo.timestamp similarly to PhotonNetwork.time? Or what?0 -
Please read the following post. I explain why we attempted the changes and how to fix things.
viewtopic.php?f=17&t=6203&p=23655#p236550 -
Tobias wrote:Please read the following post. I explain why we attempted the changes and how to fix things.
viewtopic.php?f=17&t=6203&p=23655#p23655
cool, thanks for the detailed info on this topic. I'll let you know how we go after upgrading to v1.55. Cheers.0 -
v1.55 has resolved this problem for me. Thanks.0
-
Thanks for letting me know!0