Merge pull request #4476 from spjspj/master

Scenario I was testing for this fix:
This commit is contained in:
spjspj 2018-02-03 18:45:52 +11:00 committed by GitHub
commit aebc16dc82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -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());
}
}
}

View file

@ -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();
}