Пример #1
0
        public void MarkGameAsInactive(long gameId)
        {
            var game = _avalonContext.Games
                       .Include(g => g.Players)
                       .FirstOrDefault(g => g.Active && g.GameId == gameId);

            if (game == default(Game))
            {
                return;
            }
            game.Active = false;
            foreach (Player player in game.Players)
            {
                player.Disconnected = true;
            }
            _avalonContext.Update(game);
            _avalonContext.SaveChanges();
        }
Пример #2
0
 public void UpdatePlayer(Player player)
 {
     _avalonContext.Update(player);
     _avalonContext.SaveChanges();
 }