OnRoomListUpdate not found room CustomProprieties
public void OnCreateRoomButtonClicked()
{
RoomOptions roomOptions = new RoomOptions();
roomOptions.IsOpen = true;
roomOptions.IsVisible = true;
string roomName;
string gameMap;
if (gameMode.Equals("CarMeeting"))
{
gameMap = carMeetingModeMaps[mapIndex].sceneName;
roomName = roomNameCarMeetingModeInputField.text;
roomOptions.MaxPlayers = 4;
}
else
{
gameMap = racingModeMaps[mapIndex].sceneName;
roomName = roomNameRacingModeInputField.text;
roomOptions.MaxPlayers = 2;
}
if (!CheckIfRoomAlreadyExists(roomName))
{
StartCoroutine(EShowWarning());
}
else
{
roomOptions.CustomRoomProperties = new Hashtable();
roomOptions.CustomRoomProperties.Add("GameMap", gameMap);
roomOptions.CustomRoomProperties.Add("GameMode", gameMode);
string[] customLobbyProperties = new string[2];
customLobbyProperties[0] = "GameMap";
customLobbyProperties[1] = "GameMode";
roomOptions.CustomRoomPropertiesForLobby = customLobbyProperties;
Debug.Log(gameMode);
PhotonNetwork.CreateRoom(roomName, roomOptions, null, null);
}
}
public override void OnRoomListUpdate(List<RoomInfo> roomInfo)
{
Debug.Log("Rooms found " + roomInfo.Count);
bool roomFound = false;
foreach (RoomInfo room in roomInfo)
{
if (room.RemovedFromList)
{
int index = roomUIs.FindIndex(x => x.roomNameString.Equals(room.Name));
if (index != -1)
{
Destroy(roomUIs[index].gameObject);
roomUIs.RemoveAt(index);
}
}
else
{
if (room.IsOpen && room.PlayerCount > 0)
{
CMRoomUI roomUI = Instantiate(roomUIPrefab.gameObject, roomUIParent).GetComponent<CMRoomUI>();
roomUIs.Add(roomUI);
Debug.Log(room.Name);
//Debug.Log(room.CustomProperties["GameMap"].ToString());
//Debug.Log(room.CustomProperties["GameMode"].ToString());
roomUI.Check(room.Name, (room.PlayerCount + "/" + room.MaxPlayers).ToString(), "", ""/*, room.CustomProperties["GameMap"].ToString(), room.CustomProperties["GameMode"].ToString()*/);
}
}
}
if (roomUIs.Count > 0) roomFound = true;
noRoomTextObj.SetActive(!roomFound);
}
This is my