public void DropPlayer(int playerId, int gameId, ClientCode clientCode, Team team) { lock (_gameLock) { Player player = getPlayer(playerId); if (team != null) { checkPlayerAccess(player, team); } else { checkPlayerAccess(player, clientCode); } Game game = player.Game; if (game == null) { throw new ApplicationException("Player is not in a game"); } if (gameId > 0 && game.GameId != gameId) { throw new ApplicationException("Player is not in the specified game"); } game.DropPlayer(player, clientCode.ToString()); } }