public IActionResult PostProfile(GameMaster gameMaster)
        {
            var storedGameMaster = _playerStore.Get(gameMaster.Id);

            gameMaster.PlayerPool = storedGameMaster.PlayerPool;
            _playerStore.Add(gameMaster);
            var url = Url.Action(nameof(GetOrCreate));

            return(Created(url, gameMaster));
        }
Esempio n. 2
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());
        }