[Simple problem]Cannot join a room again

Options
I used PUN in Unity3d 4.3
I created a room and I can join 4 clients at the first time,when the game is end ,all the clients in the room will left
including the MasterClient.
But when I create the same room ,I can only have 2 clients join the room ,orthers failed.
Please help thanks

Comments

  • [Deleted User]
    Options
    Please post the code you used.
  • Tobias
    Options
    Depending on how you tested, maybe 2 of the 4 users are not timed out before you try to re-join.
    Make sure each client successfully disconnected / left the room. Else, the room might still exist when you join again.
    You could check which ID you get, too. It must be 1, if the room is new (not still existing with some non-timed-out users).
  • Tobias wrote:
    Depending on how you tested, maybe 2 of the 4 users are not timed out before you try to re-join.
    Make sure each client successfully disconnected / left the room. Else, the room might still exist when you join again.
    You could check which ID you get, too. It must be 1, if the room is new (not still existing with some non-timed-out users).

    How to make sure no room exist/no player in the last room?
    I am sure my MasterClient get the ID=1.And the client all disconnect from the room.Because I can create the new room with the same name
  • khetag wrote:
    Please post the code you used.

    Here is my left room code.
    I send RPC to other clients to leaveroom and the MasterClient leave the room last one .
    [code2=csharp][RPC]
    void BackToTheLobby()
    {
    StopAllCoroutines();
    PhotonNetwork.LeaveRoom();
    }

    public void OnLeftRoom()
    {
    Debug.Log("OnLeftRoom (local)");
    StartCoroutine(Wait2secondsToExit());
    }

    IEnumerator Wait2secondsToExit()
    {
    yield return new WaitForSeconds(2);
    Application.LoadLevel("StartScene");
    }[/code2]
  • Kaiserludi
    Options
    orthers failed.
    With which error message? Are you using Photon Cloud or Photon Server?
  • Kaiserludi wrote:
    orthers failed.
    With which error message? Are you using Photon Cloud or Photon Server?
    No error message here!So amazing!
    I use PhotonServer,SelfHost