room based on round time

Options
hi guys.

i made a game that have an ending time after a room is open, i used the utcnow as the room name then create it
once a player is joined he check the room name for the starting time stamp and subtract to calculate when game is over.

now I'm pretty sure its a wrong way doing that because the only way that it will work is if only 1 room is created each second.

i could buffer an rpc on master client and once he leave and another one is in control, than he buffer a new rpc and so on.
but this method is not very reliable due to connections issues

is there a build in way in photon for doing this time based room?

Comments

  • vadim
    Options
    hi,

    Use room custom properties to store any room information including creation time.
    Make sure that methods you use for getting time return same value on all your clients in the room.
    PhotonNetwork.time can help but be careful with "wraps" - read property comments for details.