OpJoinRandomRoom() public method

NetworkingPeer.OpJoinRandomRoom
this override just makes sure we have a mRoomToGetInto, even if it's blank (the properties provided in this method are filters. they are not set when we join the game)
public OpJoinRandomRoom ( OpJoinRandomRoomParams, opJoinRandomRoomParams ) : bool
opJoinRandomRoomParams OpJoinRandomRoomParams,
return bool
Ejemplo n.º 1
0
 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);
 }