NetworkingPeer.OpCreateGame C# (CSharp) Method

OpCreateGame() public method

NetworkingPeer.OpCreateGame
public OpCreateGame ( EnterRoomParams, enterRoomParams ) : bool
enterRoomParams EnterRoomParams,
return bool
    public bool OpCreateGame(EnterRoomParams enterRoomParams)
    {
        bool onGameServer = this.server == ServerConnection.GameServer;
        enterRoomParams.OnGameServer = onGameServer;
        enterRoomParams.PlayerProperties = GetLocalActorProperties();
        if (!onGameServer)
        {
            enterRoomParamsCache = enterRoomParams;
        }

        this.mLastJoinType = JoinType.CreateGame;
        return base.OpCreateRoom(enterRoomParams);
    }

Usage Example

Exemplo n.º 1
0
 /// <summary>
 /// Create a room with given title. This will fail if the room title is already in use.
 /// </summary>
 /// <param name="roomName">Unique name of the room to create.</param>
 public static void CreateRoom(string roomName)
 {
     if (room != null)
     {
         Debug.LogError("CreateRoom aborted: You are already in a room!");
     }
     else if (roomName == string.Empty)
     {
         Debug.LogError("CreateRoom aborted: You must specifiy a room name!");
     }
     else
     {
         if (offlineMode)
         {
             offlineMode_inRoom = true;
             NetworkingPeer.SendMonoMessage(PhotonNetworkingMessage.OnCreatedRoom);
         }
         else
         {
             networkingPeer.OpCreateGame(roomName, true, true, 0, null);
         }
     }
 }
All Usage Examples Of NetworkingPeer::OpCreateGame
NetworkingPeer