[SOLVED]Game crashed after join failed.

I've try to let player join random room or join by typing room's name.

When they can't find the room I got this error.

Join random
joinrandom failed, client stays on masterserver: OperationResponse 225: ReturnCode: 32760 (No match found). Parameters: {}.

Join by typing room's name.
joinGame failed, client stays on masterserver: OperationResponse 226: ReturnCode: 32758 (Game does not exist). Parameters: {}. State: JoinedLobby

And then game was freeze and can't do anything.

Any idea to fix this problem?

Comments

  • sounds like you try to join an inexistant game / room
  • Yeah I try because I think this kind of mistake will happen and I want to avoid the crash and freeze issue.

    I want to do some try...catch but the error is occur in the PhotonNetwork script soI don't know should I play with it or not.
  • try catch is never an option in networking out of my view.

    You should check the room list on the client and use create if its not found or go with the create and join (if its still available) directly.
  • Thanks for the suggestion!
    Problem now solve by make client checking available room by get room data from PhotonNetwork.GetRoomList() before they start joining.
  • It's a common case that a room you try to join is not existing (or not existing anymore, when all others leave while someone tries to join).
    So you should not run into trouble by that.
    If you know this happens, you can easily use the failed join to create said room by name.
    Again: As anyone in the world could do this at the same time but the room can only be created once, this can fail yet again. Then you join.
    In theory, this could be an endless loop but that's not going to happen in reality.

    Make sure you don't use just one room name and expect this to be available. In best case, do it like in the Marco Polo Tutorial: Join random and create a nameless room if that fails:
    http://doc.exitgames.com/photon-cloud/M ... 0Tutorials