JoinRandomRoom

Options
void OnJoinedLobby()
{
   Hashtable customRoomProperties = new Hashtable() { { "tip_room", 1} };
   PhotonNetwork.JoinRandomRoom(customRoomProperties, 2);
}
void OnPhotonRandomJoinFailed() 
{
   PhotonNetwork.CreateRoom(null, new RoomOptions() { maxPlayers = 2, customRoomProperties = new Hashtable() { { "tip_room", 1} } },null);
}
why the second player does not find the first room?

Comments

  • jeanfabre
    Options
    Hi,

    Your second player may not be in the same region. Can you double check this?

    If you want to test with a remote person far away, you need to explicitly mention the region you want to connect in the Photon settings. This will impact network performances, so this is of course something we only suggest during development for remote teams, Regions are here to optimize player experience and fight latency.

    Bye,

    Jean
  • Kurtav
    Kurtav ✭✭
    Options
    jeanfabre said:

    Hi,

    Your second player may not be in the same region. Can you double check this?

    If you want to test with a remote person far away, you need to explicitly mention the region you want to connect in the Photon settings. This will impact network performances, so this is of course something we only suggest during development for remote teams, Regions are here to optimize player experience and fight latency.

    Bye,

    Jean

    I did not change during a test connectUsingSettings(version)
    the problem is not in the region
    test two players - my house, one player - Unity, the second player - android device
    PhotonNetwork.JoinRandomRoom(null, 2);
    Search the room working on maxplayer
    but I have to find a room on the property room
    void OnJoinedRoom()
        {
            print(PhotonNetwork.room.customProperties["tip_room"]);
        }
    If this is done this line of code the first player I waited another 5-10 seconds after went to the lobby and then perform the search of the room the second player
  • jeanfabre
    Options
    Hi,

    Sorry, can you explain this again, I am not following your explanations.

    I would debug with the following:

    display the full list of rooms and their respective tip_room, and then you'll know exactly what rooms are available, then you click on join random and see if it joins properly.

    but you seem to say that it takes time for the lobby to refresh rooms data, am I correct?

    Bye,

    Jean