JoinRoom() and OnJoinRoomFailed() not working as expected?
Options
So I was working on a code that when the player clicks a button, it would call
When I pressed the button, I would expect it to call OnJoinRoomFailed() because it doesn't exist, which in my code would just Debug.Log("can't join room");
But for some reason, it doesn't call it. When I looked at PhotonNetwork.NetworkClientState, it was at 'JoinedLobby', but after I click the button, it would go back to 'ConnectedToMaser'. So I'm seeing that joining a room that doesn't exist puts you back to the master server, and would have to join back to the lobby again.
Is this how this supposed to work? Or is there something I'm missing.
PhotonNetwork.JoinRoom("myRoom");but in this case, room "myRoom" doesn't exist.
When I pressed the button, I would expect it to call OnJoinRoomFailed() because it doesn't exist, which in my code would just Debug.Log("can't join room");
But for some reason, it doesn't call it. When I looked at PhotonNetwork.NetworkClientState, it was at 'JoinedLobby', but after I click the button, it would go back to 'ConnectedToMaser'. So I'm seeing that joining a room that doesn't exist puts you back to the master server, and would have to join back to the lobby again.
Is this how this supposed to work? Or is there something I'm missing.
0
Comments
-
Hi @Moddwyn,
Thank you for choosing Photon!
What PUN version is this?
About the callback not being called, maybe it's not implemented properly or not registered?
Did you register the class implementing it as a callbacks class like shown in the documentation?
I think when room creation or join fails or if you reconnect you're back to the master server and need to manually rejoin the lobby yes.0 -
@JohnTube Thank you for responding.
I am using PUN 2 and yes I have implemented MonoBehaviourPunCallbacks. I have functions like OnConnectedToMaster() and OnJoinedLobby() working.I think when room creation or join fails or if you reconnect you're back to the master server and need to manually rejoin the lobby yes.0