Search Unity

Third Party Turn Based Multiplayer Rejoin issue using Photon(exitgames)

Discussion in 'Multiplayer' started by Ankush Arora, Oct 6, 2014.

  1. Ankush Arora

    Ankush Arora

    Joined:
    May 29, 2014
    Posts:
    3
    Hello all,

    I am Developing one MultiPlayer Turn Based Game using Photon. My Game is near about to end but i am facing a problem in one issue related to Rejoin the room. I need some help as i am not able to achieve the success on this issue from last 2 weeks. I can explain the flow of the Game.

    Flow of my Game is:-

    Initially first player create a room on Photon server and send request to the second player. Second player receive the Notification and when second player open the game with notification information related to room is appeared with a button to play. when second player press the play button the player join the room. in that situation if both players are playing the game and after sometime if any player left the game and then come back again and tried to join the game again then the player is unable to join the room again. Sometime player join the room and sometime it failed and blank screen appears.

    Please give a solution to solve this issue.

    Thanks in Advance.
     
  2. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    From the description, I can't make out yet where you fail to re-join the room.
    Usually, we log some warning or error to the console. Anything in there?

    You need to take care that you don't "abandon" a game if you want to come back later. Else you can't re-join. The demo uses 2 separate buttons for "leave" and "abandon". Check the code they call. Again, this should show up in the log.
    Add the message in DebugReturn() to the log, if you didn't so far.
     
  3. Ankush Arora

    Ankush Arora

    Joined:
    May 29, 2014
    Posts:
    3




    Hello,

    First of all thanks for your reply.

    I am not using any code of Abandon and Leave while i quit the Game.

    I noticed the Error in the Xcode when player fails to Re-Join the Game. The Error is:-

    Join failed on Game Server. Changing back to MasterServer photon unity

    When this error comes it loads the whole scene but unable to load the Objects in the room whose Keys are saved on the Server. Please tell me the solution what i can do? If you need any more information then please let me know.

    I have also received this Issue:-

    Receive issue. State: Connected Exception: System.Net.Sockets.SocketException: Network is unreachable

    at System.Net.Sockets.Socket.Receive (System.Byte[] buffer) [0x00000] in <filename unknown>:0

    at ExitGames.Client.Photon.SocketUdp.ReceiveLoop () [0x00000] in <filename unknown>:0

    Thanks,
     
  4. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    The "SocketException: Network is unreachable" looks like your device doesn't have reliable network connection at that moment. Or the app is in the background or something? Can you reliably reproduce this error?

    I don't think this is related to the other issue, which is "Join failed on Game Server". This error means that for some reason the game can't be joined on the actual Game Server. Maybe the game got closed since you tried to join it.
    You should not load the game scene in that case. You can implement OnPhotonJoinRoomFailed(object[] codeAndMsg) as described in enum PhotonNetworkingMessage to react to this error and check what went wrong in the first place.

    I hope that helps you analyze the issue. Let me know what the message is in the error case.