Quantcast
Channel: Recent Discussions — Photon Engine
Viewing all articles
Browse latest Browse all 15755

RoomInfo.CustomRoomProperties is empty on lobby?

$
0
0
Here's how I create the room:

public void CreateRoom(string name, string mode, string map, int maxPlayers) {
popupCreateLobby.SetActive(false);
popupConnecting.SetActive(true);

ExitGames.Client.Photon.Hashtable roomSettings = new ExitGames.Client.Photon.Hashtable() {
{ "name", name }, { "mode", mode }, { "map", map }
};

string[] lobbyProperties = { "name", "mode", "map" };

RoomOptions options = new RoomOptions();
options.IsVisible = true;
options.IsOpen = true;
options.MaxPlayers = (byte) maxPlayers;
options.CustomRoomPropertiesForLobby = lobbyProperties;
options.CustomRoomProperties = roomSettings;
PhotonNetwork.CreateRoom(null, options, TypedLobby.Default);
}
Here's how I display the information. I call this when the game received OnReceivedRoomListUpdate.

public void SetRoomInfo(RoomInfo roomInfo) {
this.roomInfo = roomInfo;

Debug.Log(roomInfo.ToStringFull());

textGameName.text = (string) roomInfo.CustomProperties["name"];
textGameMode.text = (string) roomInfo.CustomProperties["mode"];
textMapName.text = (string) roomInfo.CustomProperties["map"];
textPlayerCount.text = roomInfo.PlayerCount + " / " + roomInfo.MaxPlayers;
}
The log displays:

Room: 'xxxx' visible,open 1/0 players.
customProps: {}
As you can see, the customProps is empty even though I set them properly when I created the room. What gives?

Viewing all articles
Browse latest Browse all 15755

Trending Articles