customRoomProperties

I have followed the example to create a Random Room, it works without problem.

However, I want to implement a semi-random scheme by matching their skill set level, but fail. My code is as follow:

private ExitGames.Client.Photon.Hashtable skillset = new ExitGames.Client.Photon.Hashtable();

void Start() {
skillset["skill"] = 1;
}

public virtual void OnConnectedToMaster()
{
PhotonNetwork.JoinRandomRoom(skillset, 2);
}

public virtual void OnPhotonRandomJoinFailed()
{
RoomOptions options = new RoomOptions();
options.maxPlayers = 2;
options.customRoomProperties = skillset;
options.isVisible = false;
options.isOpen = true;

PhotonNetwork.CreateRoom(null, options, TypedLobby.Default);
}

When the 1st player enters the code, it should go to OnPhotonRandomJoinFailed and create a room with skillset=1. When 2nd player enters the code, it should join the room that 1st player created, but it fails again and go to OnPhotonRandomJoinFailed and create another room.

Where is the problem? How to make it work?

Comments

  • anyone can help?
  • Try join room without setting 'expectedMaxPlayers' parameter:
    PhotonNetwork.JoinRandomRoom(skillset, 0);
    My test did not work with expectedMaxPlayers=2 but did with 0. Probably a bug. We will check this.
    I hope you do not need 'max player' filter. If you do, let me know.
  • I am confused in specify maxPlayer during joining. Actually the maxPlayer already defined during CreateRoom, every player join the room is supposed to align to this rule.

    I tried JoinRandomRoom(skillset,0) with no luck. the only work statement is JoinRandomRoom()

    MaxPlayer + skillset has to be introduced in my case. Hope it can be addressed as soon as you can. Thanks.
  • The trick is most likely that you have to define RoomOptions.customRoomPropertiesForLobby.
    None of the properties are sent to the lobby by default, to keep traffic low. You have to set (per room when you create it) which values you need in the lobby.
    Then I hope you can do skillbased matchmaking like you try.
  • Oh I didn't think about Lobby. It works now. Thanks for your help.