/// <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); }
/// <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)); }
/// <summary> /// Start this game with only a local client. /// </summary> IGameNetworkServerHandler IGameNetworkService.StartLocalGame() { Debug.Assert(NetworkGameMode == NetworkGameMode.NotSet); NetworkGameMode = NetworkGameMode.Local; return(this); }