JoinRoom failed. Client is on MasterServer but not ready for operations
The whole answer can be found below.
Try Our
Documentation
Please check if you can find an answer in our extensive documentation on PUN.
Join Us
on Discord
Meet and talk to our staff and the entire Photon-Community via Discord.
Read More on
Stack Overflow
Find more information on Stack Overflow (for Circle members only).
JoinRoom failed. Client is on MasterServer but not ready for operations
Mozzz
2020-09-27 17:14:03
Hi, I am really new at this. Would really appreciate if anyone could help. I am getting this error message when a client joins a room. So what I can understand is that the client is not IsConnectedAndReady. How can I make sure it is connected and ready so I can avoid this error??
I am able to connect after this error message though. Thanks.
Comments
Hi @Mozzz,
Thank you for choosing Photon!
What PUN version do you use?
What is the exact error message?
As it already hints/suggests, you probably need to wait for the OnConnectedToMaster callback to be able to call JoinRoom.
Hi @JohnTube,
Thank you for your response.
I am using Photon version 2.7.
The complete error message is as follows:
JoinRoom failed. Client is on MasterServer (must be Master Server for matchmaking)but not ready for operations (State: Joining). Wait for callback: OnJoinedLobby or OnConnectedToMaster.
UnityEngine.Debug:LogError(Object)
Photon.Pun.PhotonNetwork:JoinRoom(String, String[]) (at Assets/Photon/PhotonUnityNetworking/Code/PhotonNetwork.cs:1742)
Launcher:joinRoom(String, Action1) (at Assets/Scripts/Launcher.cs:235) Launcher:JoinRoom(String, Action
1) (at Assets/Scripts/Launcher.cs:214)
RoomChoiceByNumberAction:
RoomChoiceByNumberPanel:JoinRoom() (at Assets/Scripts/UIPanels/RoomChoiceByNumberPanel.cs:105)
UnityEngine.EventSystems.EventSystem:Update()
I dont really understand that I need to wait for OnConnectedToMaster callback? OnConnectedToMaster has already been called in my case. I am trying to join the room now by pressing the join room button.
And also, how am I able to join the room after getting this error?
Hi @Mozzz,
So the client state is "Joining" which means the client is already in the process of joining a room.
So most likely you are hitting the Join button more than once.*
Try to add a flag or UI dialog or disable button while the client is trying to join the first time.
Hi @JohnTube ,
Thank you for your help, I managed to fix it. You were right in some way and set me on the right track. I was actually calling the join room function twice somehow. Thanks.
Back to top