* Fixed a problem of match handling if a player left XMage during sideboarding.

This commit is contained in:
LevelX2 2014-09-04 12:30:43 +02:00
parent 6f9a6ccabf
commit b770c9d0ab
2 changed files with 3 additions and 2 deletions

View file

@ -251,7 +251,7 @@ public class User {
public boolean isExpired(Date expired) {
if (lastActivity.before(expired)) {
logger.debug(new StringBuilder(userName).append(" is expired!"));
logger.debug(userName + " is expired!");
return true;
}
logger.trace(new StringBuilder("isExpired: User ").append(userName).append(" lastActivity: ").append(lastActivity).append(" expired: ").append(expired).toString());

View file

@ -93,13 +93,14 @@ public abstract class MatchImpl implements Match {
public boolean leave(UUID playerId) {
MatchPlayer mPlayer = getPlayer(playerId);
if (mPlayer != null) {
if (games.isEmpty() ) {
if (startedGames == 0) {
return players.remove(mPlayer);
}
mPlayer.setQuit(true);
synchronized (this) {
this.notifyAll();
}
checkIfMatchEnds();
return true;
}
return false;