private void setLobbyAttributes(LobbyAttributeAccessor lobbyAttributeAccessor) { // lobbyAttributeAccessor.setStringAttribute(IDENTIFIER.name(), config.getIdentifier()); lobbyAttributeAccessor.setStringAttribute(BUY_IN.name(), format(config.getBuyIn())); lobbyAttributeAccessor.setStringAttribute(FEE.name(), format(config.getFee())); lobbyAttributeAccessor.setStringAttribute(SIT_AND_GO.name(), isSitAndGo() ? "true" : "false"); lobbyAttributeAccessor.setStringAttribute(BUY_IN_CURRENCY_CODE.name(), config.getCurrency()); lobbyAttributeAccessor.setStringAttribute(VARIANT.name(), config.getVariant().name()); }
private String getOperatorLobbyIdString() { StringBuilder b = new StringBuilder(); for (Long l : config.getOperatorIds()) { b.append(l).append(","); } String s = b.toString(); if (s.length() > 0) { s = s.substring(0, s.length() - 1); } return s; }
public final void tournamentCreated(MTTState mtt, LobbyAttributeAccessor acc) { log.debug("Poker tournament created. MTT: [" + mtt.getId() + "]" + mtt.getName()); MTTStateSupport stateSupport = ((MTTStateSupport) mtt); stateSupport.setGameId(PokerTournamentActivatorImpl.POKER_GAME_ID); stateSupport.setSeats(config.getSeatsPerTable()); stateSupport.setName(config.getName()); stateSupport.setCapacity(config.getMaxPlayers()); stateSupport.setMinPlayers(config.getMinPlayers()); PokerTournamentState pokerState = new PokerTournamentState(); pokerState.setTiming(config.getTimingType()); pokerState.setBetStrategy(config.getBetStrategy()); pokerState.setBlindsStructure(config.getBlindsStructure()); pokerState.setBuyIn(config.getBuyIn()); pokerState.setFee(config.getFee()); pokerState.setPayOutAsBonus(config.isPayOutAsBonus()); pokerState.setCurrency(cashGamesBackendService.getCurrency(config.getCurrency())); pokerState.setPayoutStructure(config.getPayoutStructure(), config.getMinPlayers()); pokerState.setStartingChips(config.getStartingChips()); TournamentLifeCycle tournamentLifeCycle = getTournamentLifeCycle(); pokerState.setLifecycle(tournamentLifeCycle); pokerState.setStartDateString(tournamentLifeCycle.getStartTime().toString(datePattern)); pokerState.setRegistrationStartDate(tournamentLifeCycle.getOpenRegistrationTime()); pokerState.setMinutesVisibleAfterFinished(getMinutesVisibleAfterFinished()); pokerState.setTemplateId(getConfigurationTemplateId()); pokerState.setSitAndGo(isSitAndGo()); pokerState.setRebuySupport(createRebuySupport(config.getRebuyConfiguration())); pokerState.setGuaranteedPrizePool(config.getGuaranteedPrizePool()); pokerState.getAllowedOperators().addAll(config.getOperatorIds()); pokerState.setUserRuleExpression(config.getUserRuleExpression()); pokerState.setVariant(config.getVariant()); pokerState.setDescription(config.getDescription()); PokerTournament tournament = new PokerTournament(pokerState); stateSupport.setState(tournament); acc.setStringAttribute("SPEED", timing.name()); // TODO: Table size should be configurable. acc.setIntAttribute( PokerTournamentLobbyAttributes.TABLE_SIZE.name(), config.getSeatsPerTable()); String opString = getOperatorLobbyIdString(); acc.setStringAttribute(OPERATOR_IDS.name(), opString); String rule = config.getUserRuleExpression(); acc.setStringAttribute(USER_RULE_EXPRESSION.name(), rule != null ? rule : ""); acc.setStringAttribute(VARIANT.name(), PokerVariant.TEXAS_HOLDEM.name()); createHistoricTournament(stateSupport, pokerState); tournamentCreated(stateSupport, pokerState, acc); }