Negative PhotonNetwork.time

Options
PhotonNetwork.time often returns negative values, I'm pretty sure that this is not the intended behavior, right?
On the other hand, PhotonNetworkInfos' timestamps seem to be always positive.

Is this a bug or am I doing something wrong? I'm using the latest PUN+ (1.54)

My current workaround for this is to change:
float t = networkingPeer.ServerTimeInMilliSeconds;

to:
double t = (uint)networkingPeer.ServerTimeInMilliSeconds;

in the PhotonNetwork.time getter.

Comments

  • Mishaps
    Options
    Someone posted a hack-fix here:
    viewtopic.php?f=17&t=6160

    Would have expected photon guys to be fixing this ASAP, not a good sign...
  • radis
    Options
    I've already read that topic, but my problem is certainly not IL2CPP-related, as I'm experiencing the issue even in the editor/Windows build.

    In the previous versions, the code for the time getter was:
    double t = (double)(uint)networkingPeer.ServerTimeInMilliSeconds;
    return t / 1000;
    

    Now it's
    float t = networkingPeer.ServerTimeInMilliSeconds;
    return t / 1000;
    

    and that just can't be right. I mean, it's obvious that just simply taking a 32-bit integer and casting it to a float can result in a negative value...

    Not a good sign indeed. This bug must have broken like every single game using Photon...
  • Jofator
    Options
    Hi guyz,
    I'm dealing with the same issue on iPhone5 using PUN 1.51/Unity4.6.6p2 IL2CPP build.
    Please fix it.
  • Tobias
    Options
    Please update to PUN 1.56. It's in the Asset Store.