GameFull error while rejoining

Options
I have 2 Unity editor instances, running my PUN2-based code. I do the following sequence:
1. In the first instance, I create a room
2. In the second instance, I do a JoinRandom with matching parameters, which results in finding the room and joining it
3. I exit Play Mode in the second instance, thus killing the app. This results in OnLeftRoom callback in the first instance
4. I enter Play Mode again in the second instance, try joining the room with JoinRoom as well as JoinRandom. JoinRandom gives me error "OnJoinRandomFailed(32760,No match found).". JoinRoom gives me "OnJoinRoomFailed: 32765, Game full".
5. If I repeat steps 3 and 4 now, I get connected to the room. It seems like the room is found and joined alternate times (when I exit and restart the app)
6. If I am in step 4 (without killing the app), and continue trying the join methods multiple times, I sometimes succeed

Some things I tried:
- In OnPlayerLeftRoom callback, I tried deleting the otherPlayer using DestroyPlayerObjects
- In Mohobehaviour OnDestroy, I tried calling LeaveRoom (if InRoom) and Disconnect (If IsConnected)
- While creating game, I had my RoomOptions.PlayerTtl set to 40000 earlier. I tried setting this to 1000 and later to
1.
None of these changes helped. It sounds like there is some timer somewhere that allows the rejoin, but I can't find what that is.

Can someone guide me?

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @Pixel,

    Thank you for choosing Photon!

    With PlayerTTL != 0 the actor remains inactive in the room until PlayerTTL (milliseconds) is expired unless you explicitly call LeaveRoom(false).
    Use RejoinRoom or ReconnectAndRejoin to rejoin rooms or recover from unexpected disconnect while joined to a room.
    Keep the same unique UserId for clients between sessions to allow rejoin as the same actor.