Example #1
0
 // 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);
     }
   }
 }
Example #2
0
  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);
      }
    }
  }
Example #3
0
 public void leaveTableAll() {
   for (UUID leavingUserId : userPlayerMap.keySet()) {
     leaveTable(leavingUserId);
   }
   closeTable();
 }