Merge pull request #3370 from magefree/feature/fix_new_perspectives_freeze

magenoxx branch - Feature/fix new perspectives freeze
This commit is contained in:
LevelX2 2017-05-14 06:47:08 +02:00 committed by GitHub
commit a045196572
4 changed files with 8 additions and 4 deletions

View file

@ -61,7 +61,7 @@
</repositories>
<build>
<sourceDirectory>src</sourceDirectory>
<sourceDirectory>src/main/java</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>

View file

@ -244,6 +244,7 @@ public class HumanPlayer extends PlayerImpl {
while (!abort) {
game.fireChooseChoiceEvent(playerId, replacementEffectChoice);
updateGameStatePriority("chooseEffect", game);
waitForResponse(game);
logger.debug("Choose effect: " + response.getString());
if (response.getString() != null) {

View file

@ -961,7 +961,7 @@ public class GameController implements GameCallback {
}
}
private synchronized void setupTimeout(final UUID playerId) {
private void setupTimeout(final UUID playerId) {
if (!useTimeout) {
return;
}
@ -973,9 +973,12 @@ public class GameController implements GameCallback {
);
}
private synchronized void cancelTimeout() {
private void cancelTimeout() {
logger.debug("cancelTimeout");
if (futureTimeout != null) {
futureTimeout.cancel(false);
synchronized (futureTimeout) {
futureTimeout.cancel(false);
}
}
}