Beispiel #1
0
        public async Task Join(string playerName, string characterName)
        {
            var player = new PlayerModel
            {
                Id            = Context.ConnectionId,
                PlayerName    = playerName,
                CharacterName = characterName
            };

            PlayerStore.Add(player);
            await Clients.All.SendAsync("PlayersChanged", PlayerStore.GetPlayers());
        }
        private IPlayer extractPlayer(LogLine line)
        {
            foreach (var player in _playerStore.GetPlayers())
            {
                if (line.Message.Split(" ").Take(3).Any(x => x.Contains(player.Name)))
                {
                    return(player);
                }
            }

            return(null);
        }
 public LinePlayerJoinDecorator(ILogLineEventConverter component, IPlayerStore playerStore)
 {
     _component = component;
     _players   = playerStore.GetPlayers();
 }