예제 #1
0
 public void HandleOnGameMaster(Messages.GameMaster.IConnection connection)
 {
     try
     {
         Console.WriteLine("Player id #{0} disconnected", this.playerId);
         connection.GameState.RemovePlayer(this.playerId);
         if (connection.GameState.GameStarted == true &&
             connection.GameState.RedPlayers.Count == 0 &&
             connection.GameState.BluePlayers.Count == 0)
         {
             connection.Disconnect();
             Console.WriteLine("All players disconnected");
         }
     }
     catch (ArgumentNullException)
     {
         Console.WriteLine("Invalid msg: {0}", this);
     }
     Thread.Sleep(2000);
 }
 public void HandleOnGameMaster(Messages.GameMaster.IConnection connection)
 {
     connection.Disconnect();
 }