Exemplo n.º 1
0
        public async void VoteRequest(Guid fromGuid, Guid kickGuid, Guid gameGuid)
        {
            Game g = _gamePool.Games[gameGuid];

            Log.Information("Request from '{0}' to kick '{1}'", _playerPool.Players[fromGuid].Name, _playerPool.Players[kickGuid].Name);

            if (_playerPool.Players[kickGuid].Role != PlayerRole.Kicked || _playerPool.Players[kickGuid].Role != PlayerRole.Ghost)
            {
                _playerPool.Players[kickGuid].VoteCount += 1;
            }

            _playerPool.Players[fromGuid].HasVoted = true;

            Voting.AllowRandomPlayerToVote(g, _hubContext);

            //await _hubContext.Clients.All.SendAsync("SnackbarMessage", $"'{_playerPool.Players[fromGuid].Name}' voted to kick '{_playerPool.Players[kickGuid].Name}'", 5, g.Guid);
        }