room properties??

Options
Hi all,

I'm struggling here.
When I used photon when Unity was still in 3 version

PhotonNetwork.CreateRoom(roomName, true, true, 4, customRoomProperties, roomPropsInLobby);

existed. (and I have a project with that)
But now it got removed!!
I found OpCreateRoom() but the comment there was too scary to use.

Below is what I have from here -> https://doc.photonengine.com/en/realtime/current/reference/matchmaking-and-lobby

string[] roomPropsInLobby = { "map", "ai" };
Hashtable customRoomProperties = new Hashtable() { { "map", 1 } };
CreateRoom(roomName, true, true, 4, customRoomProperties, roomPropsInLobby);

There is no PhotonNetwork attached on CreateRoom().
I'm super lost.

All I want to do is make a room with some properties so that I can show rooms in seperate lobbies so users can choose the rooms like Death match, Time attack or something.

Could I get some help on this one?

Comments

  • vadim
    Options
    You hardly need OpCreateRoom. it's mostly for internal use.
    CreateRoom is member of PhotonNetwork. So PhotonNetwork.CreateRoom(...) should be ok.
    Check PUN demos for more PhotonNetwork.CreateRoom usage examples.
  • Oh customRoomProperties is what I needed. thanks.
    It is so simple now than before!

    option.customRoomProperties = new ExitGames.Client.Photon.Hashtable();
    option.customRoomProperties.Add(property.mode, modeIndex);
    option.customRoomProperties.Add(property.scene, sceneIndex);

    option.customRoomPropertiesForLobby = new String[2];
    option.customRoomPropertiesForLobby[0] = property.mode;
    option.customRoomPropertiesForLobby[1] = property.scene;

    PhotonNetwork.CreateRoom(roomName, option, null);