I want to get the properties of a room when I’m in lobby. I’m sure that the properties are setted to show on lobby with adding a string to it. But, at the moment to get this properties instantiating with the RoomInfo class, it seems to be empty.
This is the code I use to create a new room:
Be aware that the “Password” field will be “plain text” and not really secure. Much less, if you send it to the lobby as property. This is probably not what your players will be aware of.
Overall, we would like to avoid using the room listing as much as possible. If a game has a password, it should maybe not even be listed. You can put rooms with password into their own lobby. Maybe players should know room name and password. If they may know the room name, then let users enter both and you won’t have to fetch the room list in the first place.
then I try to retrieve the information sent as part of RoomOptions:
public void UpdateRoomList(List<RoomInfo> roomList, GameRoomMode mode)
{
int indexDataDisplayed = 0;
for (int x = 0; x < roomList.Count; x++)
{
string mGameMode= roomList[x].CustomProperties[NetworkManager.roomGameMode].ToString();
//more code....
}
}
but CustomProperties is always null… I can confirm that the first room that I get in the list is in fact the one that I have created in another client (at least the name of the room is the same)
Am I doing something wrong?
Edit:
If I access this property “networkManager.Client.CurrentRoom.CustomProperties” within the client that has created the room, the CustomProperties are displayed correctly.