public OpJoinRandomRoom ( OpJoinRandomRoomParams, opJoinRandomRoomParams ) : bool | ||
opJoinRandomRoomParams | OpJoinRandomRoomParams, | |
Résultat | bool |
public static bool JoinRandomRoom(Hashtable expectedCustomRoomProperties, byte expectedMaxPlayers, MatchmakingMode matchingType, TypedLobby typedLobby, string sqlLobbyFilter) { if (offlineMode) { if (offlineModeRoom != null) { Debug.LogError("JoinRandomRoom failed. In offline mode you still have to leave a room to enter another."); return(false); } offlineModeRoom = new Room("offline room", null); NetworkingPeer.SendMonoMessage(PhotonNetworkingMessage.OnJoinedRoom, new object[0]); return(true); } if ((networkingPeer.server == ServerConnection.MasterServer) && connectedAndReady) { Hashtable target = new Hashtable(); target.MergeStringKeys(expectedCustomRoomProperties); if (expectedMaxPlayers > 0) { target[(byte)0xff] = expectedMaxPlayers; } return(networkingPeer.OpJoinRandomRoom(target, 0, null, matchingType, typedLobby, sqlLobbyFilter)); } Debug.LogError("JoinRandomRoom failed. Client is not on Master Server or not yet ready to call operations. Wait for callback: OnJoinedLobby or OnConnectedToMaster."); return(false); }