Is OnPlayerLeftRoom called if TLL = -1?

Options
Question is title, if not, is there another way to check? Need to know if a player has disconnected without said player notifying he has disconnected.

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @Oliver123,
    Need to know if a player has disconnected without said player notifying he has disconnected.
    A player disconnecting unexpectedly/unwillingly (i.e. not calling LeaveRoom nor Disconnect) is not related to PlayerTTL.
    OnPlayerLeftRoom is called whenever a player leaves the room.
    It may take up to 10 seconds for the server to notice that a player is gone and send an event to all other joined actors which will trigger OnPlayerLeftRoom.

    PlayerTTL defines how long a player can remain inactive (disconnected but still in the players list to allow a rejoin with same UserId and reclaim same ActorNr/Spot and related data).
    PlayerTTL -1 (negative) or int.MaxValue means the player can remain inactive forever (as long as the room exists ofc).
    Otherwise if PlayerTTL > 0, you will get two OnPlayerLeftRoom, first one has player.IsInactive = true and the second (after PlayerTTL milliseconds) player.IsInactive = false.