leaving and joining another room

currently i wasn't successful to leave a room and join a new one.
once a user leave a room the code disconnect him from photon and reconnect him so he will be able to join a different room.

I'm pretty sure its not the proper way and its more time consuming as for waiting time.

when a user leave a game i use the leaveroom() and debug check do show he left the room but cannot join a new room unless he disconnect and reconnect.

what is the proper way of doing this?

Comments

  • Hello,

    From my understanding, you are doing the right thing. In order to connect to a room, you must be in a lobby, so if the player is in a room, he must leave it, and connect to the other room once the callback saying it is connected to the lobby came in. If you try to connect to the other room to fast, that would not work either, I just faced this scenario this week-end.

    Cheers,
    Don T.
  • The disconnect and reconnect is needed, because the Game Servers don't know anything about the other existing games on more servers. That's the task of the Master Server.
    You don't have to be in a lobby to join a room, so you can skip that step if you do random matchmaking and speed up things.