How to Rejoin a room after leaving?

Options

Hello, I'm very new to Photon, and I have big troubles to rejoin a room after leaving.

I'm using "PhotonNetwork.LeaveRoom();" to leave the room,

but when I use "PhotonNetwork.RejoinRoom(roomName);"

I get this error: "RejoinRoom failed. Client is on MasterServer (must be Master Server for matchmaking)but not ready for operations (State: Joining). Wait for callback: OnJoinedLobby or OnConnectedToMaster."

What does it mean? Why can't I connect again to the room if I'm already connected (PhotonNetwork.IsConnected = true) ??

Many thanks for your help!

Answers

  • Tobias
    Options

    but not ready for operations (State: Joining)

    This likely means you called RejoinRoom (or any Join) more than once. The client's state is "Joining" already, so it will block another call to RejoinRoom.

    When you leave a room, wait for the callback OnConnectedToMasterServer.