mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
Some minor changes.
This commit is contained in:
parent
a7db298711
commit
6f6b35d40f
3 changed files with 11 additions and 19 deletions
|
@ -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());
|
||||||
|
|
|
@ -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");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue