Пример #1
0
        private void AddPlayerToGame(int gameId)
        {
            var player = _usrMngr.GetUserByName(Context.User.Identity.Name);

            player.GameId   = gameId;
            player.IsInGame = true;
            _gameFactory.AddPlayerToGame(gameId, Context.User.Identity.Name);
            _gameFactory.StartGame(gameId);

            Clients.Client(player.ConnectionId).RedirectToGame();
        }