Exemplo n.º 1
0
 public override void OnOpen()
 {
     string nickname = QueryParameters["nickname"];
     int gameSize = int.Parse(QueryParameters["gamesize"]);
     connection = server.JoinGame(this, nickname, gameSize);
 }
Exemplo n.º 2
0
        public void Disconnect(GameConnection connection)
        {
            clients.Remove(connection.Client);

            if (clients.Count == 0 && gameTimer != null)
                gameTimer.Dispose();

            if (Started)
                ProcessCommand(new RemovePlayerCommand(connection.Player));
            else
                game.Players.Remove(connection.Player);
        }