OnPlayerLeftRoom is delayed

Hello Everyone,
I have a room that PlayerTTL!=0. I am dealing with recover connection things. Problem is that when ClientA leaves room(becomes Inactive), on ClientB OnPlayerLeftRoom callback is called 5, 6 seconds later. What is the reason of it??

Answers

  • Player TTL is how long after a client soft disconnects that they are allowed to rejoin and resume, without needing to reconnect as a new actor.

    https://doc.photonengine.com/zh-tw/pun/current/gameplay/ownershipandcontrol#soft_disconnect

    If a player times out rather than explicitly telling the server it is leaving, that doesn't happen instantly, as the server isn't getting a disconnect message from the departing player. Unless they gracefully disconnect, the server only will see that they have gone silent, and will eventually (10 seconds later?) Drop that client and dispatch a disconnect notification to all.

    PlayerTTL only starts counting after this soft disconnect occurs, and the player has that much time to rejoin before being hard disconnected.

  • Hi @emotitron

    So, I want to show a waiting screen and stop game timer when one of the players has become inactive(soft disconnect). So you basically say that there is no way to understand instantly remote player became inactive? So, I can understand remote player is inactive after 5 ,6 seconds delay right?