How do I know server room is no longer exist

edited August 2014 in Flash (deprecated)
New comer to Photo cloud, sorry if this question has been repeated but couldn't find it on forums, so here go :)

I am using Photon cloud and load balancing demo. When the game room is left, there is a brief period that it still shows up in the Lobby and a player can join a room that no longer exists. What kind of error message will return to that player who join a game room that no longer exist, and where shall I check this issue? And how should this situation be handled? I like to print that "game room no longer exists" when the player join such room.


  • The response for join will have an error code "GameDoesNotExist" 32758 (signed short max - 9). In general, the error code will be != 0 if something goes wrong.
    This will give you the content of the response:
    (event as JoinResponse).getReturnDebug()
  • Hi Tobias,
    how to access ReturnCode within OnPhotonJoinRoomFailed() method?
    Can you please post sample code?
    Thanks J.
  • Hi,

    Do you mean Unity Photon plugin? I'm asking because this is flash forum.
    Looks like no way to get ReturnCode in OnPhotonJoinRoomFailed() currently in Unity plugin. But you may be sure that if OnPhotonJoinRoomFailed() get called then ReturnCode != 0. That should be usually enough to handle the error.
    Do you really need exact error code value? What are you trying to do?
    You can find OnPhotonJoinRoomFailed sample code in demos provided with plugin (Demos\PUNGuide_M2H\_Tutorial 1)
  • Hi Vadim,
    you are right I mean Unity plugin, sorry :)
    I need to distinguish GameDoesNotExist from any other reason when join the room fails.
    But if GameDoesNotExist is the main (almost one and only) reason, I can live with that.
    Regards J.
  • In fact, there are some other reasons which worth to know. Max players reached for instance. So better have this error code in handler. We will check if it's possible.
  • I just added an optional object[] parameter for OnPhotonRandomJoinFailed, OnPhotonJoinRoomFailed and OnPhotonCreateRoomFailed. It makes debugging in other situations easier, too. When your callback has this parameter, you get ErrorCode and the debug message.

    It will be in PUN 1.26.