Examples of DebugConfig


Examples of com.jcloisterzone.config.Config.DebugConfig

        //execute after chain update is done
        toExecute.perform(getServer());
    }

    private void autosave() {
        DebugConfig debugConfig = game.getConfig().getDebug();
        if (debugConfig != null && debugConfig.getAutosave() != null && debugConfig.getAutosave().length() > 0) {
            Snapshot snapshot = new Snapshot(game);
            if ("plain".equals(debugConfig.getSave_format())) {
                snapshot.setGzipOutput(false);
            }
            try {
                snapshot.save(new FileOutputStream(debugConfig.getAutosave()));
            } catch (TransformerException | IOException e) {
                logger.error("Auto save before ranking failed.", e);
            }
        }
    }
View Full Code Here

Examples of com.jcloisterzone.config.Config.DebugConfig

        }
        if (config.getConnection_history() != null && !config.getConnection_history().isEmpty()) {
            model.put("connection_history", yaml.dumpAs(config.getConnection_history(), Tag.SEQ, FlowStyle.FLOW).trim());
        }

        DebugConfig dc = config.getDebug();
        model.put("hasDebug", dc != null);
        if (dc != null) {
            model.put("save_format", dc.getSave_format());
            model.put("autosave", dc.getAutosave());
            if (dc.getAutostart() != null) {
                model.put("autostart", indent(2, yaml.dumpAs(dc.getAutostart(), Tag.MAP, FlowStyle.BLOCK)));
            }
            if (dc.getTile_definitions() != null) {
                model.put("tile_definitions", indent(2, yaml.dumpAs(dc.getTile_definitions(), Tag.MAP, FlowStyle.BLOCK)));
            }
            if (dc.getDraw() != null) {
                model.put("draw", indent(1, yaml.dumpAs(dc.getDraw(), Tag.SEQ, FlowStyle.BLOCK)));
            }
            if (dc.getOff_capabilities() != null) {
                model.put("off_capabilities", indent(2, yaml.dumpAs(dc.getOff_capabilities(), Tag.SEQ, FlowStyle.BLOCK)));
            }
            model.put("area_highlight", dc.getArea_highlight());
        }

        String result = engine.transform(template, model);
        result = result.replace(" !!"+PresetConfig.class.getName(), "");
        result = result.replace("\n", System.lineSeparator());
View Full Code Here

Examples of com.jcloisterzone.config.Config.DebugConfig

                    Application macApplication = Application.getApplication();
                    macApplication.setDockIconImage(new ImageIcon(Client.class.getClassLoader().getResource("sysimages/ico.png")).getImage());
                    macApplication.addApplicationListener(new MacApplicationAdapter(client));
                }

                DebugConfig debugConfig = client.getConfig().getDebug();
                if (debugConfig != null && debugConfig.isAutostartEnabled()) {
                    client.createGame();
                }
            }
        });
View Full Code Here

Examples of com.jcloisterzone.config.Config.DebugConfig

    protected void prepareCapabilities() {
        for (Expansion exp : game.getExpansions()) {
            game.getCapabilityClasses().addAll(Arrays.asList(exp.getCapabilities()));
        }

        DebugConfig debugConfig = game.getConfig().getDebug();
        if (debugConfig != null && debugConfig.getOff_capabilities() != null) {
            List<String> offNames =  debugConfig.getOff_capabilities();
            Set<Class<? extends Capability>> off = new HashSet<>();
            for (String tok : offNames) {
                tok = tok.trim();
                try {
                    String className = "com.jcloisterzone.game.capability."+tok+"Capability";
View Full Code Here

Examples of com.jcloisterzone.config.Config.DebugConfig

    private final BazaarCapability bazaarCap;
    private final AbbeyCapability abbeyCap;

    public DrawPhase(Game game, Connection conn) {
        super(game, conn);
        DebugConfig debugConfig = game.getConfig().getDebug();
        if (debugConfig != null) {
            debugTiles = debugConfig.getDraw();
        }
        bazaarCap = game.getCapability(BazaarCapability.class);
        abbeyCap = game.getCapability(AbbeyCapability.class);
    }
View Full Code Here

Examples of com.jcloisterzone.config.Config.DebugConfig

     */
    private boolean figureHighlight = false;

    public AbstractAreaLayer(GridPanel gridPanel) {
        super(gridPanel);
        DebugConfig debugConfig = getClient().getConfig().getDebug();
        if (debugConfig != null && "figure".equals(debugConfig.getArea_highlight())) {
            figureHighlight = true;
        }
    }
View Full Code Here

Examples of com.jcloisterzone.config.Config.DebugConfig

        return conn.getClientId();
    }


  protected void performAutostart() {
      DebugConfig debugConfig = client.getConfig().getDebug();
      if (!autostartPerfomed && debugConfig != null && debugConfig.isAutostartEnabled()) {
          autostartPerfomed = true; //apply autostart only once
          AutostartConfig autostartConfig = debugConfig.getAutostart();
          final PresetConfig presetCfg = client.getConfig().getPresets().get(autostartConfig.getPreset());
          if (presetCfg == null) {
              logger.warn("Autostart profile {} not found.", autostartConfig.getPreset());
              return;
          }
View Full Code Here

Examples of com.jcloisterzone.config.Config.DebugConfig

                if (!file.getName().endsWith(".jcz")) {
                    file = new File(file.getAbsolutePath() + ".jcz");
                }
                try {
                    Snapshot snapshot = new Snapshot(game);
                    DebugConfig debugConfig = getConfig().getDebug();
                    if (debugConfig != null && "plain".equals(debugConfig.getSave_format())) {
                        snapshot.setGzipOutput(false);
                    }
                    snapshot.save(new FileOutputStream(file));
                } catch (IOException | TransformerException ex) {
                    logger.error(ex.getMessage(), ex);
View Full Code Here

Examples of com.jcloisterzone.config.Config.DebugConfig

        String fileName = "tile-definitions/"+expansion.name().toLowerCase()+".xml";
        return TilePackFactory.class.getClassLoader().getResource(fileName);
    }

    protected URL getCardsConfig(Expansion expansion) {
        DebugConfig debugConfig = config.getDebug();
        String fileName = null;
        if (debugConfig != null && debugConfig.getTile_definitions() != null) {
            fileName = debugConfig.getTile_definitions().get(expansion.name());
        }
        if (fileName == null) {
            return getStandardCardsConfig(expansion);
        } else {
            return TilePackFactory.class.getClassLoader().getResource(fileName);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.