public void prepareChallenge(UUID playerId, Match match) { Map<Zone, String> commands = new HashMap<>(); commands.put(Zone.OUTSIDE, "life:3"); match.getGame().cheat(playerId, commands); } }
Game game = null; if (match != null) { game = match.getGame(); if (game != null && !game.hasEnded()) { game.end();
gameOptions.bannedUsers = match.getOptions().getBannedUsers(); gameOptions.planeChase = match.getOptions().isPlaneChase(); match.getGame().setGameOptions(gameOptions); GameManager.instance.createGameSession(match.getGame(), userPlayerMap, table.getId(), choosingPlayerId, gameOptions); String creator = null; StringBuilder opponent = new StringBuilder(); if (_user.isPresent()) { User user = _user.get(); user.ccGameStarted(match.getGame().getId(), entry.getValue()); logger.info("GAME started " + (match.getGame() != null ? match.getGame().getId() : "no Game") + " [" + match.getName() + "] " + creator + " - " + opponent.toString()); logger.debug("- matchId: " + match.getId() + " [" + match.getName() + ']'); if (match.getGame() != null) { logger.debug("- chatId: " + GameManager.instance.getChatId(match.getGame().getId())); Game game = match.getGame(); if (game != null) { GameManager.instance.removeGame(game.getId());
logger.warn("-- matchId:" + match.getId() + " , table : " + table.getId()); } else if (match.isDoneSideboarding() && match.getGame() == null) { || table.getState() == TableState.READY_TO_START) || !match.isDoneSideboarding() || (!matchPlayer.hasQuit() && match.getGame() != null && matchPlayer.getPlayer().isInGame())) { Optional<User> user = UserManager.instance.getUser(userPlayerEntry.getKey()); if (!user.isPresent() || !user.get().isActive()) {
public boolean watchTable(UUID userId) { if (table.isTournament()) { UserManager.instance.getUser(userId).ifPresent(user -> user.ccShowTournament(table.getTournament().getId())); return true; } else { if (table.isTournamentSubTable() && !table.getTournament().getOptions().isWatchingAllowed()) { return false; } if (table.getState() != TableState.DUELING) { return false; } // you can't watch your own game if (userPlayerMap.get(userId) != null) { return false; } Optional<User> _user = UserManager.instance.getUser(userId); if (!_user.isPresent()) { return false; } return _user.get().ccWatchGame(match.getGame().getId()); } }
MatchPlayer matchPlayer = match.getPlayer(playerId); if (matchPlayer != null && !match.hasEnded() && !matchPlayer.hasQuit()) { Game game = match.getGame(); if (game != null && !game.hasEnded()) { Player player = match.getPlayer(playerId).getPlayer();