public synchronized void startMatch() { if (table.getState() == TableState.STARTING) { try { if (table.isTournamentSubTable()) { logger.info("Tourn. match started id:" + match.getId() + " tournId: " + table.getTournament().getId()); } else { UserManager.instance.getUser(userId).ifPresent(user -> { logger.info("MATCH started [" + match.getName() + "] " + match.getId() + '(' + user.getName() + ')'); logger.debug("- " + match.getOptions().getGameType() + " - " + match.getOptions().getDeckType()); }); } match.startMatch(); startGame(null); } catch (GameException ex) { logger.fatal("Error starting match ", ex); match.endGame(); } } }
if (match == null) { logger.warn("- Match table with no match:"); logger.warn("-- matchId:" + match.getId() + " , table : " + table.getId()); logger.warn("-- matchId:" + match.getId() + " [" + match.getName() + ']'); if (matchPlayer == null) { logger.warn("- Match player not found:"); logger.warn("-- matchId:" + match.getId()); logger.warn("-- userId:" + userPlayerEntry.getKey()); logger.warn("-- playerId:" + userPlayerEntry.getValue()); if (!user.isPresent() || !user.get().isActive()) { logger.warn("- Active user of match is missing: " + matchPlayer.getName()); logger.warn("-- matchId:" + match.getId()); logger.warn("-- userId:" + userPlayerEntry.getKey()); logger.warn("-- playerId:" + userPlayerEntry.getValue());
private void initMatchTable(Table table) { Match match = table.getMatch(); this.matchId = match.getId(); this.matchName = match.getName(); this.gameType = match.getOptions().getGameType();
TournamentGameView(int roundNum, TournamentPairing pair, Game game) { this.roundNum = roundNum; this.matchId = pair.getMatch().getId(); this.gameId = game.getId(); this.players = pair.getPlayer1().getPlayer().getName() + " - " + pair.getPlayer2().getPlayer().getName(); String duelingTime = ""; if (game.hasEnded()) { if (game.getEndTime() != null && game.getStartTime() != null) { duelingTime = " (" + DateFormat.getDuration((game.getEndTime().getTime() - game.getStartTime().getTime())/1000) + ')'; } this.state = "Finished" + duelingTime; this.result = game.getWinner(); } else { if (game.getStartTime() != null) { duelingTime = " (" + DateFormat.getDuration((new Date().getTime() - game.getStartTime().getTime())/1000) + ')'; } this.state = "Dueling" + duelingTime; this.result = ""; } this.tableId = pair.getTableId(); }
logger.debug("- matchId: " + match.getId() + " [" + match.getName() + ']'); if (match.getGame() != null) { logger.debug("- chatId: " + GameManager.instance.getChatId(match.getGame().getId()));
matchHolder.id_match.setText(match.getId().toString()); matchHolder.nome_partita.setText(match.getName().toString()); matchHolder.citta.setText(match.getCitta().toString());