I have a 2 player board game where one client is the master client and creates a room which the second client then joins via JoinRandomRoom
.
My intention is that once a game has ended, if both players choose to they can have a rematch, but if either player chooses not to rematch they are both removed from the room and sent back to the menu.
If either player hits Menu an RPC call is sent that tells the network manager to run this method:
public void LeaveRoom()
{
PhotonNetwork.LeaveRoom();
}
Every time I run it however, the nonmaster client gets an error after a few seconds saying
Cannot send to: wss://GCASH1025.exitgames.com:443/game. The current state of the connection is not Open.
OnLeftRoom is never called by the nonmaster client (which is how the menu transition is handled) and if I try to just join a new random room after "leaving" I get a new error:
JoinRandomRoom failed. Client is on GameServer (must be Master Server for matchmaking) but not ready for operations (State: Leaving). Wait for callback: OnJoinedLobby or OnConnectedToMaster.
When I check the CurrentRoom
and IsConnected
values for the nonmaster client, they both say that it is still in the room and still connected.
Any suggestions?