diff --git a/Mage.Server/src/main/java/mage/server/game/GameSession.java b/Mage.Server/src/main/java/mage/server/game/GameSession.java index cce5261011f..3ba8c37f1df 100644 --- a/Mage.Server/src/main/java/mage/server/game/GameSession.java +++ b/Mage.Server/src/main/java/mage/server/game/GameSession.java @@ -288,10 +288,13 @@ public class GameSession extends GameWatcher { player.quit(game); } catch (Exception ex) { if (ex != null) { + // It seems this can happen if two threads try to end the game at the exact same time (one wins and one ends here) logger.fatal("Game session game quit exception " + (ex.getMessage() == null ? "null":ex.getMessage())); logger.debug("- gameId:" + game.getId() +" playerId: " + playerId); if (ex.getCause() != null) { logger.debug("- Cause: " + (ex.getCause().getMessage() == null ? "null":ex.getCause().getMessage())); + } else { + logger.debug("- ex: " + ex.toString()); } ex.printStackTrace(); }else { diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java index d2ccb055df5..9e02be53456 100644 --- a/Mage/src/mage/players/PlayerImpl.java +++ b/Mage/src/mage/players/PlayerImpl.java @@ -1749,7 +1749,7 @@ public abstract class PlayerImpl implements Player, Serializable { } } if (opponentsAlive == 0 && !hasWon()) { - logger.debug("player won -> No more oppononets alive game won: " + this.getName()); + logger.debug("player won -> No more opponents alive game won: " + this.getName()); game.informPlayers(new StringBuilder(this.getName()).append(" has won the game").toString()); this.wins = true; game.end();