// remove user from all tournament sub tables public void userQuitTournamentSubTables(UUID userId) { for (TableController controller : controllers.values()) { if (controller.getTable() != null) { if (controller.getTable().isTournamentSubTable()) { controller.leaveTable(userId); } } else { logger.error("TableManager.userQuitTournamentSubTables table == null - userId " + userId); } } }
public void leaveTable(UUID userId, UUID tableId) { TableController tableController = controllers.get(tableId); if (tableController != null) { // table not started yet and user is the owner, remove the table Table table = getTable(tableId); if (table != null && isTableOwner(tableId, userId) && (table.getState().equals(TableState.WAITING) || table.getState().equals(TableState.STARTING))) { removeTable(tableId); } else { logger.debug("TABLE leave - userId: " + userId + " tableId: " + tableId); tableController.leaveTable(userId); } } }
public void leaveTableAll() { for (UUID leavingUserId : userPlayerMap.keySet()) { leaveTable(leavingUserId); } closeTable(); }