JoinRandomRoom not working when using custom RoomProperties

Options
Using the following code, the 2 clients never end up in the same room together:
public Hashtable GetRoomProps() {
    return new Hashtable { { "lobbyType", LobbyType.Normal } };
}

public void JoinRandomRoom() {
    PhotonNetwork.JoinRandomRoom(GetRoomProps(), 2, MatchmakingMode.FillRoom, null, null);
}

public override void OnPhotonRandomJoinFailed(object[] codeAndMsg) {
    PhotonNetwork.CreateRoom(null, new RoomOptions {
        CustomRoomProperties = GetRoomProps(),
        MaxPlayers = 2
    }, null);
}

If I don't specify any room properties, it works fine. But this should also work no?

if it matters, lobbyType is just an integer-based Enum.

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @TreeFortress,

    Can you please log array codeAndMsg.
    If the error code is 32760 and msg is NoRandomMatchFound then this is perfectly expected and you need to decide whether or not create a new room.
  • TreeFortress
    edited November 2016
    Options
    Thanks JohnTube, it ended up being that I just had to set the CustomRoomPropertiesForLobby when creating a room:
    PhotonNetwork.CreateRoom(null, new RoomOptions {
            CustomRoomPropertiesForLobby = new string[1]{ "lobbyType" },
            CustomRoomProperties = GetRoomProps(),
            MaxPlayers = 2
        }, null);