JoinRoom fail with options?

Options
Hi, I am trying to set up an friendly option in my game in which a user can set up a private room with a specific name/code and then pass this code to friends.

Lets say I create a room like this:
RoomOptions newRoomOptions = new RoomOptions ();
newRoomOptions.isVisible = false;
newRoomOptions.maxPlayers = 8;

PhotonNetwork.JoinOrCreateRoom ("1234", newRoomOptions, null); 
When a friend then want to join the room they will type the name of the room and that part works, but... What if a friend type in a wrong name/code?

I do not want that friend to create a new room, but simply get the message that the room does not exists!

I have tried this but it fails:
PhotonNetwork.JoinRoom ("2134");

As you can see, the room name is wrong and I would like to tell that to the user, but I get this error:
Operation failed: OperationResponse 226: ReturnCode: 32758 (Game does not exists). Parameters: {} Server: MasterServer

Can this be accomplished?

Hoping for help and thanks in advance :-)

Comments

  • OneManArmy
    OneManArmy ✭✭✭
    edited January 2017
    Options
    private void OnPhotonJoinRoomFailed(object[] codeAndMsg) { 
    		
        short code = (short)codeAndMsg[0];
        if(code == 32758){
             // show message that game does not exists
        }
    }
  • jmansa
    Options
    Perfect... Works like a charm. Thanks :-)