示例#1
0
 /// <summary>
 /// Start this game as a dedicated server.
 /// </summary>
 IGameNetworkServerHandler IGameNetworkService.StartDedicatedServer(ushort serverPortNumber)
 {
     Debug.Assert(NetworkGameMode == NetworkGameMode.NotSet);
     NetworkGameMode = NetworkGameMode.DedicatedServer;
     _serverNetworkHandler.Start(serverPortNumber);
     return(this);
 }
示例#2
0
 /// <summary>
 /// Join a remote game.
 /// </summary>
 Task <ConnectResult> IGameNetworkService.BeginConnectToServer(string serverIp, ushort serverPortNumber)
 {
     Debug.Assert(NetworkGameMode == NetworkGameMode.NotSet);
     NetworkGameMode = NetworkGameMode.RemoteClient;
     return(_clientNetworkHandler.Connect(serverIp, serverPortNumber));
 }
示例#3
0
 /// <summary>
 /// Start this game with only a local client.
 /// </summary>
 IGameNetworkServerHandler IGameNetworkService.StartLocalGame()
 {
     Debug.Assert(NetworkGameMode == NetworkGameMode.NotSet);
     NetworkGameMode = NetworkGameMode.Local;
     return(this);
 }