diff --git a/Mage.Server/src/main/java/mage/server/User.java b/Mage.Server/src/main/java/mage/server/User.java index 01525e1bfd..c13ebdff79 100644 --- a/Mage.Server/src/main/java/mage/server/User.java +++ b/Mage.Server/src/main/java/mage/server/User.java @@ -45,6 +45,8 @@ import mage.players.net.UserData; import mage.server.draft.DraftSession; import mage.server.game.GameManager; import mage.server.game.GameSessionPlayer; +import mage.server.tournament.TournamentController; +import mage.server.tournament.TournamentManager; import mage.server.tournament.TournamentSession; import mage.server.util.SystemUtil; import mage.view.TableClientMessage; @@ -348,6 +350,10 @@ public class User { draftSessions.clear(); logger.debug("REMOVE " + getName() + " Tournament sessions " + tournamentSessions.size()); for (TournamentSession tournamentSession: tournamentSessions.values()) { + TournamentController tournamentController = TournamentManager.getInstance().getTournamentController(tournamentSession.getTournamentId()); + if (tournamentController != null) { + tournamentController.quit(userId); + } tournamentSession.setKilled(); } tournamentSessions.clear(); diff --git a/Mage.Server/src/main/java/mage/server/tournament/TournamentController.java b/Mage.Server/src/main/java/mage/server/tournament/TournamentController.java index 35bf2f1346..4502d7892b 100644 --- a/Mage.Server/src/main/java/mage/server/tournament/TournamentController.java +++ b/Mage.Server/src/main/java/mage/server/tournament/TournamentController.java @@ -416,13 +416,6 @@ public class TournamentController { return tournament.isAbort(); } - public boolean isPlayerAlive(UUID playerId) { - if (tournamentSessions.containsKey(playerId)) { - return tournamentSessions.get(playerId).isKilled(); - } - return false; - } - private void checkPlayersState() { for (TournamentPlayer tournamentPlayer: tournament.getPlayers()) { if (!tournamentPlayer.isEliminated() && tournamentPlayer.getPlayer().isHuman()) {