コード例 #1
0
        public void OnGamePlayerJoined(IGamePlayerJoinedEvent e)
        {
            if (JesterGames[e.Game.Code].CountingDown)
            {
                _logger.LogInformation($"Assigning Jester interrupted. {JesterGames[e.Game.Code].Jestername} is NOT the jester.");
                Task.Run(async() => await SorryNotJester(e.Game.GetClientPlayer(JesterGames[e.Game.Code].JesterClientId)).ConfigureAwait(false));

                JesterGame jgame = JesterGames[e.Game.Code];
                jgame.CountingDown       = false;
                JesterGames[e.Game.Code] = jgame;
            }
        }
コード例 #2
0
        public async void PlayerConnection(IGamePlayerJoinedEvent @event)
        {
            var record = _banDatabase.Get(@event.Player.Client.Connection !.EndPoint.Address.ToString());

            if (!record.Equals(default(PlayerBan)))
            {
                await _logManager.LogInformation(
                    $"Ban Manager: {@event.Player.Client.Connection!.EndPoint.Address} tried to join but is banned.");

                await @event.Player.Client.DisconnectAsync(DisconnectReason.Custom, record.Reason);
            }
        }
コード例 #3
0
        public void OnPlayerJoined(IGamePlayerJoinedEvent evt)
        {
            var code    = evt.Game.Code;
            var players = evt.Game.Players;

            logger.LogInformation($"[{code}] Player joined, moving clients into voice channel.");

            foreach (var player in players)
            {
                // must use p.Client here since p.Character is not available yet
                var name = player.Client.Name;
                logger.LogInformation($"Moving client: {name}");

                var move = new MoveClient {
                    ChannelName = $"Impostor {code}", Nickname = name
                };
                executor.Schedule(move);

                var unmute = new UnmuteClient {
                    Nickname = name
                };
                executor.Schedule(unmute);
            }
        }
コード例 #4
0
 public void OnPlayerJoined(IGamePlayerJoinedEvent e)
 {
     Console.WriteLine("Player joined a game.");
 }
コード例 #5
0
 public void OnGamePlayerJoined(IGamePlayerJoinedEvent evt) => GamePlayerJoined?.Invoke(evt);
コード例 #6
0
 public void OnPlayerJoined(IGamePlayerJoinedEvent e)
 {
     _automuteService.AddGamePlayer(e.Player);
 }
コード例 #7
0
 public void OnPlayerJoined(IGamePlayerJoinedEvent e)
 {
     _logger.LogInformation("Game {code} > {player} joined", e.Game.Code, e.Player.Client.Name);
 }
コード例 #8
0
 public void OnGamePlayerJoined(IGamePlayerJoinedEvent evt)
 {
     Interlocked.Increment(ref OnGamePlayerJoinedCount);
 }
コード例 #9
0
 public void OnPlayerJoined(IGamePlayerJoinedEvent e)
 {
     _logger.LogInformation("Player joined a game.");
 }