Problems with join random filter
Options
UnitJS15
✭
Hey everyone, I am having some trouble with the filters for random machmaking, they are not working at all and I dont understand why, I want to create a room, with certain parameters, map, gamemode, and skill, and I want to join rooms randomly using only the gamemode and skill filter, I am doing the following:
For creating:
<pre><code>
GameMode gm = gameSettings.curGameMode;
RoomOptions roomOptions = new RoomOptions();
string[] roomPropsInLobby = { "map", "skill", "gameMode" };
ExitGames.Client.Photon.Hashtable roomCustomProperties;
roomCustomProperties = new ExitGames.Client.Photon.Hashtable();
roomCustomProperties.Add("map", gm.targetLevel);
roomCustomProperties.Add("skill", null); //pending to be done
roomCustomProperties.Add("gameMode", gm.type);
roomOptions.CustomRoomPropertiesForLobby = roomPropsInLobby;
roomOptions.CustomRoomProperties = roomCustomProperties;
roomOptions.IsOpen = true;
roomOptions.IsVisible = true;
roomOptions.PublishUserId = true;
roomOptions.MaxPlayers = maxPlayers;
PhotonNetwork.CreateRoom(null, roomOptions, TypedLobby.Default);
</code></pre>
----------------
for joining:
RoomOptions roomOptions = new RoomOptions();
roomOptions.MaxPlayers = maxPlayers;
GameMode gm = gameSettings.curGameMode;
ExitGames.Client.Photon.Hashtable expectedCustomRoomProperties = new ExitGames.Client.Photon.Hashtable();
expectedCustomRoomProperties.Add("skill", null);
expectedCustomRoomProperties.Add("gameMode", gm.type);
PhotonNetwork.JoinRandomRoom(expectedCustomRoomProperties, maxPlayers);
I have followed the photon documentation but it is not working any thoughts?
For creating:
<pre><code>
GameMode gm = gameSettings.curGameMode;
RoomOptions roomOptions = new RoomOptions();
string[] roomPropsInLobby = { "map", "skill", "gameMode" };
ExitGames.Client.Photon.Hashtable roomCustomProperties;
roomCustomProperties = new ExitGames.Client.Photon.Hashtable();
roomCustomProperties.Add("map", gm.targetLevel);
roomCustomProperties.Add("skill", null); //pending to be done
roomCustomProperties.Add("gameMode", gm.type);
roomOptions.CustomRoomPropertiesForLobby = roomPropsInLobby;
roomOptions.CustomRoomProperties = roomCustomProperties;
roomOptions.IsOpen = true;
roomOptions.IsVisible = true;
roomOptions.PublishUserId = true;
roomOptions.MaxPlayers = maxPlayers;
PhotonNetwork.CreateRoom(null, roomOptions, TypedLobby.Default);
</code></pre>
----------------
for joining:
RoomOptions roomOptions = new RoomOptions();
roomOptions.MaxPlayers = maxPlayers;
GameMode gm = gameSettings.curGameMode;
ExitGames.Client.Photon.Hashtable expectedCustomRoomProperties = new ExitGames.Client.Photon.Hashtable();
expectedCustomRoomProperties.Add("skill", null);
expectedCustomRoomProperties.Add("gameMode", gm.type);
PhotonNetwork.JoinRandomRoom(expectedCustomRoomProperties, maxPlayers);
I have followed the photon documentation but it is not working any thoughts?
0
Comments
-
Hi @UnitJS15,
Thank you for choosing Photon!but it is not workingCould you give us more details? What error do you get?
Could you go through the "Matchmaking Checklist"?
Maybe thenull
cannot be used as a room lobby property value in matchmaking filtering. Try without it.0