Merge pull request #77 from uecasm/skip-kick-fix

Don't reset game when kicking idle players
This commit is contained in:
Andy Janata 2014-01-25 07:51:13 -08:00
commit 2a46c26c49
1 changed files with 10 additions and 8 deletions

View File

@ -880,8 +880,9 @@ public class Game {
}
synchronized (playedCards) {
if (state == GameState.PLAYING || playersToRemove.size() == 0) {
// not sure how much of this check is actually required
if (players.size() < 3 || playedCards.size() < 2 || state != GameState.PLAYING) {
if (players.size() < 3 || playedCards.size() < 2) {
logger.info(String.format(
"Resetting game %d due to insufficient players after removing %d idle players.",
id, playersToRemove.size()));
@ -890,6 +891,7 @@ public class Game {
judgingState();
}
}
}
// have to do this after we move to judging state
for (final Player player : playersToUpdateStatus) {