Sending information of objects (Day/Night Cycle)

Options
Sending information of objects (Day/Night Cycle)
after the creation of the room, and the beginning of the game.
I have a GameObject (Prefab), which controls the cycle of day and night.
How do I sync the time (day / night cycle) with new players entering after the room?

Thanks!

Comments

  • Merrik
    Options
    One simple way could be to use PhotonNetwork.time, which I believe is synchronized across the network.
  • Please share simple code?!!!!
    Thankkksss..!
  • Tobias
    Options
    All clients know the server's timestamp. If you set a room property that contains the server's timestamp when the initial morning began in this room, any client can compute the current day-cycle by knowing the length of it.
    Let's say: day and night each take 5 minutes. The timestamp says "morning started 5minutes ago in this room, based on the server's timestamp then and yours now", then it's about to become night.

    Don't have code but look at Room class and SetProperties and PhotonNetwork.time
  • I understand the logic, but I'm at a good time with this problem.
    I saved the time of creation of the room SetProperties, called a file. PHP I returned the server time.
    But still can not get the other users have synchronized the cycle.

    Please help me
    Thanks.
  • Tobias
    Options
    You want to synchronize the day/night cycle for all clients via an external PHP webpage?
    Or do you just want to sync time in a single room (basically time since room started)?