NetworkingPeer.OpJoinRoom C# (CSharp) Method

OpJoinRoom() public method

NetworkingPeer.OpJoinRoom
public OpJoinRoom ( EnterRoomParams, opParams ) : bool
opParams EnterRoomParams,
return bool
    public override bool OpJoinRoom(EnterRoomParams opParams)
    {
        bool onGameServer = this.server == ServerConnection.GameServer;
        opParams.OnGameServer = onGameServer;
        if (!onGameServer)
        {
            enterRoomParamsCache = opParams;
        }

        this.mLastJoinType = (opParams.CreateIfNotExists) ? JoinType.JoinOrCreateOnDemand : JoinType.JoinGame;
        return base.OpJoinRoom(opParams);
    }

Usage Example

Exemplo n.º 1
0
 public static bool JoinOrCreateRoom(string roomName, RoomOptions roomOptions, TypedLobby typedLobby)
 {
     if (offlineMode)
     {
         if (offlineModeRoom != null)
         {
             Debug.LogError("JoinOrCreateRoom failed. In offline mode you still have to leave a room to enter another.");
             return(false);
         }
         offlineModeRoom = new Room(roomName, roomOptions);
         NetworkingPeer.SendMonoMessage(PhotonNetworkingMessage.OnCreatedRoom, 0, new object[0]);
         NetworkingPeer.SendMonoMessage(PhotonNetworkingMessage.OnJoinedRoom, 0, new object[0]);
         return(true);
     }
     if ((networkingPeer.server != ServerConnection.MasterServer) || !connectedAndReady)
     {
         Debug.LogError("JoinOrCreateRoom failed. Client is not on Master Server or not yet ready to call operations. Wait for callback: OnJoinedLobby or OnConnectedToMaster.");
         return(false);
     }
     if (string.IsNullOrEmpty(roomName))
     {
         Debug.LogError("JoinOrCreateRoom failed. A roomname is required. If you don't know one, how will you join?");
         return(false);
     }
     return(networkingPeer.OpJoinRoom(roomName, roomOptions, typedLobby, true));
 }
All Usage Examples Of NetworkingPeer::OpJoinRoom
NetworkingPeer