Handling Inactive Players and Solutions for Turn Timers

Two questions:

I understand when you leave the game with OpLeaveRoom(false); or OpLeaveRoom(true); you specify if your player is inactive or active. But so far if the player leaves with inactive parameter set to true there is a possibility of another player joining what a good practice to fix that? Also if I am loading rooms properties via a webhook is there a way to check if the player from that game abandoned or should I adjust room properties when a player leaves.

Another question is with a turn timer previously I did this via Unity,Time.DeltaTime and I just sent an event with time every second to all clients but something tells me that's not really the best way of doing this. Does SDK have turn based timer solution like PUN or can you suggest a better approach to this?

Comments

  • Hi @Fiercy,

    But so far if the player leaves with inactive parameter set to true there is a possibility of another player joining what a good practice to fix that?
    There is an important piece of the puzzle missing: PlayerTTL. It's the setting per room that indicates if players can be inactive inside a room or not and for how long.
    Also if I am loading rooms properties via a webhook is there a way to check if the player from that game abandoned or should I adjust room properties when a player leaves.
    I don't understand the question. Which webhook are you referring to? To know if a player abandoned a room or not when leaving implement PathLeave webhook and check the Reason/Type and IsInactive arguments.

    No there is no built-in way to handle timers client side.
    You can adjust PUN's Utility Script to work with Photon Realtime's Unity SDK and use it.
    The timer's period and how to sync. between clients is up to you.
    Maybe let Master Client handle this.
Sign In or Register to comment.