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()) { if (matchPlayer.getPlayer().isHuman()) {
humanPlayers++; 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() || !match.isDoneSideboarding() ||
(!matchPlayer.hasQuit() && match.getGame() != null && matchPlayer.getPlayer().isInGame())) { (!matchPlayer.hasQuit() && match.getGame() != null && matchPlayer.getPlayer().isInGame())) {
User user = UserManager.getInstance().getUser(userPlayerEntry.getKey()); User user = UserManager.getInstance().getUser(userPlayerEntry.getKey());

View file

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

View file

@ -62,7 +62,7 @@ public class GameWorker<T> implements Callable {
gameController.gameResult(game.getWinner()); gameController.gameResult(game.getWinner());
game.cleanUp(); game.cleanUp();
} catch (MageException ex) { } catch (MageException ex) {
logger.fatal("GameWorker mage error [" + game.getId() + "]" +ex, ex); logger.fatal("GameWorker mage error [" + game.getId() + "]" + ex, ex);
ex.printStackTrace(); ex.printStackTrace();
} catch (Exception e) { } catch (Exception e) {
logger.fatal("GameWorker general exception [" + game.getId() + "]" + e.getMessage(), e); logger.fatal("GameWorker general exception [" + game.getId() + "]" + e.getMessage(), e);