mirror of
https://github.com/correl/mage.git
synced 2024-12-24 03:00:14 +00:00
Fixed a bug that a tournament match did not end, if a player left during sideboarding.
This commit is contained in:
parent
61edeb4809
commit
f85f477b90
2 changed files with 6 additions and 7 deletions
|
@ -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();
|
||||
|
|
|
@ -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()) {
|
||||
|
|
Loading…
Reference in a new issue