Can´t get custom lobby properties working

So i´ve been looking a lot about this but didn´t find anything that works, I just want to show the match´s map and gamemode in lobby, here´s my code.

This is where i want to get the properties and put them in a text object:

public void Setup(RoomInfo _matchInfo, JoinMatchDelegate _JoinMatch)
{
matchInfo = _matchInfo;
matchName.text = matchInfo.Name + " " + "" + matchInfo.PlayerCount.ToString() + "/" + matchInfo.MaxPlayers.ToString() + "";

ExitGames.Client.Photon.Hashtable properties = matchInfo.CustomProperties;

matchMap.text = properties[0].ToString();
matchGM.text = properties[1].ToString();

JoinMatchCallback = _JoinMatch;
}
This is my create match method:

public void CreateRoom()
{
if (roomName != null && roomName != "")
{
RoomOptions roomOptions = new RoomOptions() { IsVisible = true, MaxPlayers = 8 };
roomOptions.CustomRoomPropertiesForLobby = new string[] { map, gamemode };
PhotonNetwork.CreateRoom(roomName, roomOptions, null);
}
}
Please tell me if you need any further information and thanks for your answers :)

Comments

  • Hi @Canned_Tuna,

    please take a look at the Not So Random Matchmaking section from the Matchmaking Guide. There is an example which shows how to use the Custom Room Properties and make them available in the lobby.

    In your case, you would have to use roomOptions.CustomRoomProperties = new Hashtable(); and add KeyValuePairs to it, which have map and gamemode as keys.