Some minor changes.

This commit is contained in:
LevelX2 2015-02-27 01:07:49 +01:00
parent a7db298711
commit 6f6b35d40f
3 changed files with 11 additions and 19 deletions

View file

@ -924,7 +924,9 @@ public class TableController {
}
if (matchPlayer.getPlayer().isHuman()) {
humanPlayers++;
if ((table.getState().equals(TableState.WAITING) || table.getState().equals(TableState.STARTING) || table.getState().equals(TableState.READY_TO_START)) ||
if ((table.getState().equals(TableState.WAITING) ||
table.getState().equals(TableState.STARTING) ||
table.getState().equals(TableState.READY_TO_START)) ||
!match.isDoneSideboarding() ||
(!matchPlayer.hasQuit() && match.getGame() != null && matchPlayer.getPlayer().isInGame())) {
User user = UserManager.getInstance().getUser(userPlayerEntry.getKey());

View file

@ -395,8 +395,6 @@ public class TableManager {
debugServerState();
}
logger.debug("TABLE HEALTH CHECK");
List<UUID> toRemove = new ArrayList<>();
ArrayList<Table> tableCopy = new ArrayList<>();
tableCopy.addAll(tables.values());
for (Table table : tableCopy) {
@ -406,13 +404,13 @@ public class TableManager {
logger.debug(table.getId() + " [" + table.getName()+ "] " + formatter.format(table.getStartTime() == null ? table.getCreateTime() : table.getCreateTime()) +" (" + table.getState().toString() + ") " + (table.isTournament() ? "- Tournament":""));
TableController tableController = getController(table.getId());
if (tableController != null) {
if (table.isTournament()) {
if (!tableController.isTournamentStillValid()) {
toRemove.add(table.getId());
}
} else {
if (!tableController.isMatchTableStillValid()) {
toRemove.add(table.getId());
if ((table.isTournament() && !tableController.isTournamentStillValid()) ||
(!table.isTournament() && !tableController.isMatchTableStillValid())) {
try {
logger.warn("Removing unhealthy tableId " + table.getId());
removeTable(table.getId());
} catch (Exception e) {
logger.error(e);
}
}
}
@ -422,14 +420,6 @@ public class TableManager {
logger.debug(Arrays.toString(ex.getStackTrace()));
}
}
for (UUID tableId : toRemove) {
try {
logger.warn("Removing unhealthy tableId " + tableId);
removeTable(tableId);
} catch (Exception e) {
logger.error(e);
}
}
logger.debug("TABLE HEALTH CHECK - END");
}