public void LeaveGame(int playerId, ClientCode clientCode) { lock (_gameLock) { Player player = getPlayer(playerId); checkPlayerAccess(player, clientCode); GameModel game = player.Game; if (game == null) { return; } game.DropPlayer(player, clientCode.ToString()); } }
public void DropPlayer(int playerId, int gameId, ClientCode clientCode, Team team) { lock (_gameLock) { Player player = getPlayer(playerId); GameModel game = getGame(gameId); checkGameChange(game, team); if (player.Game != game) { throw new ApplicationException("Player is not in this game"); } game.DropPlayer(player, clientCode.ToString()); } }