From b924f4bb6bdebb838e21b21fa74230813a81872b Mon Sep 17 00:00:00 2001 From: spjspj Date: Sat, 3 Feb 2018 13:21:47 +1100 Subject: [PATCH] Scenario I was testing for this fix. Local Server, EDH game with Player1, Player2, Player3. Player1 has 2 mana reflections out, cast Torment of Hailfire for 15 and is tapping mana for it. The 'choose replacement effect' popup comes up. Whilst this is happening, Player2 concedes. This will currently lock up the game and sits forever in waitResponseOpen. (With the time out now there, it will time out after 30 seconds or so. --- .../src/mage/player/human/HumanPlayer.java | 6 ++++-- Mage/src/main/java/mage/game/GameImpl.java | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java index bdda0915ed..5aa3ce60b9 100644 --- a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java @@ -151,11 +151,13 @@ public class HumanPlayer extends PlayerImpl { protected void waitResponseOpen() { // wait response open for answer process - while (!responseOpenedForAnswer && canRespond()) { + int numTimesWaiting = 0; + while (!responseOpenedForAnswer && canRespond() && numTimesWaiting < 300) { + numTimesWaiting ++; try { Thread.sleep(100); } catch (InterruptedException e) { - logger.warn("Response waiting interrapted for " + getId()); + logger.warn("Response waiting interrupted for " + getId()); } } } diff --git a/Mage/src/main/java/mage/game/GameImpl.java b/Mage/src/main/java/mage/game/GameImpl.java index 4b46792cbb..98298e835c 100644 --- a/Mage/src/main/java/mage/game/GameImpl.java +++ b/Mage/src/main/java/mage/game/GameImpl.java @@ -2452,6 +2452,9 @@ public abstract class GameImpl implements Game, Serializable { @Override public UUID getPriorityPlayerId() { + if (state.getPriorityPlayerId() == null) { + return state.getActivePlayerId(); + } return state.getPriorityPlayerId(); }