Leave room ignoring TTL

Options
I am using a photon room with a PlayerTtl set to several minutes to support rejoining games. There are some situations, however where the player chooses to leave (for example before the game starts) where I want to be able to actually have them leave the room and be removed from the player list.
Currently the player calls PhotonNetwork.LeaveRoom() but they appear to remain in the player list and if they happen to try to join that same game again they get an error saying their ID is already in the room. (and that they should be Rejoining instead of Joining)

Is it possible to totally leave a room?

side question: How can you tell if a room can be Rejoined by a player? The player list is not available outside the room so I can't tell if it's rejoinable until I try and get an error.

Thank you for your time.

Best Answer

Answers

  • ScottS
    Options
    When I posted the question, upon exiting the room I was disconnecting and reconnecting to photon because I though I had to. I'm noticing that if I only leave the room and return to the lobby and do NOT disconnect from photon, I can simply JoinRoom and it works. Does the "TTL inactive ID" stuff only happen when you disconnect?

    When you said "I can give you the code for this." is the code you're referring to: "loadBalancingClient.OpLeaveRoom(false)" Or is there something else?
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Does the "TTL inactive ID" stuff only happen when you disconnect?
    I don't understand.

    When you said "I can give you the code for this." is the code you're referring to: "loadBalancingClient.OpLeaveRoom(false)" Or is there something else?
    If you need to leave the room for good (actor will be removed from actors list no matter what the PlayerTTL value is and you will not be able to rejoin but you can still try to join with a new actor number) I can give you the code to add to PUN which is the same as what is available in Unity Realtime SDK and can be called using it with loadBalancingClient.OpLeaveRoom(false).
  • ScottS
    Options
    By "TTL inactive ID" I mean, if I properly call LeaveRoom then the player seems to get removed from the player list and they don't linger as an inactive player.
    But if I instead call Disconnect They become an inactive player that remains in the roomlist. Is this correct?
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Yes that should be correct.