FillRoom









How do I use Fill Room
Below are practical examples compiled from projects for learning and reference purposes

Featured Snippets


File name: LoadbalancingPeer.cs Copy
212         public virtual bool OpJoinRandomRoom(Hashtable expectedCustomRoomProperties, byte expectedMaxPlayers, Hashtable playerProperties, MatchmakingMode matchingType, TypedLobby typedLobby, string sqlLobbyFilter)
213         {
214             if (this.DebugOut >= DebugLevel.INFO)
215             {
216                 this.Listener.DebugReturn(DebugLevel.INFO, "OpJoinRandomRoom()");
217             }
218
219             Hashtable expectedRoomProperties = new Hashtable();
220             expectedRoomProperties.MergeStringKeys(expectedCustomRoomProperties);
221             if (expectedMaxPlayers > 0)
222             {
223                 expectedRoomProperties[GameProperties.MaxPlayers] = expectedMaxPlayers;
224             }
225
226             Dictionary opParameters = new Dictionary();
227             if (expectedRoomProperties.Count > 0)
228             {
229                 opParameters[ParameterCode.GameProperties] = expectedRoomProperties;
230             }
231
232             if (playerProperties != null && playerProperties.Count > 0)
233             {
234                 opParameters[ParameterCode.PlayerProperties] = playerProperties;
235             }
236
237             if (matchingType != MatchmakingMode.FillRoom)
238             {
239                 opParameters[ParameterCode.MatchMakingType] = (byte)matchingType;
240             }
241
242             if (typedLobby != null)
243             {
244                 opParameters[ParameterCode.LobbyName] = typedLobby.Name;
245                 opParameters[ParameterCode.LobbyType] = (byte)typedLobby.Type;
246             }
247
248             if (!string.IsNullOrEmpty(sqlLobbyFilter))
249             {
250                 opParameters[ParameterCode.Data] = sqlLobbyFilter;
251             }
252
253             // UnityEngine.Debug.LogWarning("OpJoinRandom: " + opParameters.ToStringFull());
254             return this.OpCustom(OperationCode.JoinRandomGame, opParameters, true);
255         }
File name: PhotonNetwork.cs Copy
1644     /// This method looks up a room in the currently active lobby or (if no lobby is joined)
1650     public static bool JoinRandomRoom()
1651     {
1652         return JoinRandomRoom(null, 0, MatchmakingMode.FillRoom, null, null);
1653     }
File name: PhotonNetwork.cs Copy
1665     /// This method looks up a room in the currently active lobby or (if no lobby is joined)
1673     public static bool JoinRandomRoom(Hashtable expectedCustomRoomProperties, byte expectedMaxPlayers)
1674     {
1675         return JoinRandomRoom(expectedCustomRoomProperties, expectedMaxPlayers, MatchmakingMode.FillRoom, null, null);
1676     }

FillRoom 120 lượt xem

Gõ tìm kiếm nhanh...