Package mage.server.util

Examples of mage.server.util.ConfigSettings


    public static void main(String[] args) {

    logger.info("Starting MAGE server version " + version);
    logger.info("Logging level: " + Logging.getLevel(logger));
    deleteSavedGames();
    ConfigSettings config = ConfigSettings.getInstance();
    for (GamePlugin plugin: config.getGameTypes()) {
      GameFactory.getInstance().addGameType(plugin.getName(), loadGameType(plugin), loadPlugin(plugin));
    }
    for (Plugin plugin: config.getPlayerTypes()) {
      PlayerFactory.getInstance().addPlayerType(plugin.getName(), loadPlugin(plugin));
    }
    for (Plugin plugin: config.getDeckTypes()) {
      DeckValidatorFactory.getInstance().addDeckType(plugin.getName(), loadPlugin(plugin));
    }
    boolean testMode = false;
    for (String arg: args) {
      if (arg.startsWith(testModeArg)) {
        testMode = Boolean.valueOf(arg.replace(testModeArg, ""));
      }
    }
    Copier.setLoader(classLoader);
    System.setProperty("java.rmi.server.hostname", config.getServerAddress());
    server = new ServerImpl(config.getPort(), config.getServerName(), testMode);

    }
View Full Code Here


            CardScanner.scan();
        }
        logger.info("Done.");

        deleteSavedGames();
        ConfigSettings config = ConfigSettings.getInstance();
        for (GamePlugin plugin: config.getGameTypes()) {
            GameFactory.getInstance().addGameType(plugin.getName(), loadGameType(plugin), loadPlugin(plugin));
        }
        for (GamePlugin plugin: config.getTournamentTypes()) {
            TournamentFactory.getInstance().addTournamentType(plugin.getName(), loadTournamentType(plugin), loadPlugin(plugin));
        }
        for (Plugin plugin: config.getPlayerTypes()) {
            PlayerFactory.getInstance().addPlayerType(plugin.getName(), loadPlugin(plugin));
        }
        for (Plugin plugin: config.getDraftCubes()) {
            CubeFactory.getInstance().addDraftCube(plugin.getName(), loadPlugin(plugin));
        }
        for (Plugin plugin: config.getDeckTypes()) {
            DeckValidatorFactory.getInstance().addDeckType(plugin.getName(), loadPlugin(plugin));
        }

        logger.info("Config - max seconds idle: " + config.getMaxSecondsIdle());
        logger.info("Config - max game threads: " + config.getMaxGameThreads());
        logger.info("Config - max AI opponents: " + config.getMaxAiOpponents());
        logger.info("Config - min user name l.: " + config.getMinUserNameLength());
        logger.info("Config - max user name l.: " + config.getMaxUserNameLength());
        logger.info("Config - save game active: " + (config.isSaveGameActivated() ? "True":"false"));
       
        logger.info("Config - backlog size    : " + config.getBacklogSize());
        logger.info("Config - lease period    : " + config.getLeasePeriod());
        logger.info("Config - max pool size   : " + config.getMaxPoolSize());
        logger.info("Config - num accp.threads: " + config.getNumAcceptThreads());
        logger.info("Config - second.bind port: " + config.getSecondaryBindPort());
       
        Connection connection = new Connection("&maxPoolSize=" + config.getMaxPoolSize());
        connection.setHost(config.getServerAddress());
        connection.setPort(config.getPort());
        try {
            // Parameter: serializationtype => jboss
            InvokerLocator serverLocator = new InvokerLocator(connection.getURI());               
            if (!isAlreadyRunning(serverLocator)) {
                server = new MageTransporterServer(serverLocator, new MageServerImpl(adminPassword, testMode), MageServer.class.getName(), new MageServerInvocationHandler());
View Full Code Here

    public static void init() {
        Logger.getRootLogger().setLevel(Level.DEBUG);
        logger.debug("Starting MAGE tests");
        logger.debug("Logging level: " + logger.getLevel());
        deleteSavedGames();
        ConfigSettings config = ConfigSettings.getInstance();
        for (GamePlugin plugin : config.getGameTypes()) {
            GameFactory.getInstance().addGameType(plugin.getName(), loadGameType(plugin), loadPlugin(plugin));
        }
        Copier.setLoader(classLoader);
    }
View Full Code Here

    public static void init() {
        Logger.getRootLogger().setLevel(Level.DEBUG);
        logger.info("Starting MAGE tests");
        logger.info("Logging level: " + logger.getLevel());
        deleteSavedGames();
        ConfigSettings config = ConfigSettings.getInstance();
        for (GamePlugin plugin : config.getGameTypes()) {
            GameFactory.getInstance().addGameType(plugin.getName(), loadGameType(plugin), loadPlugin(plugin));
        }
        for (GamePlugin plugin : config.getTournamentTypes()) {
            TournamentFactory.getInstance().addTournamentType(plugin.getName(), loadTournamentType(plugin), loadPlugin(plugin));
        }
        for (Plugin plugin : config.getPlayerTypes()) {
            PlayerFactory.getInstance().addPlayerType(plugin.getName(), loadPlugin(plugin));
        }
//        for (Plugin plugin : config.getDeckTypes()) {
//            DeckValidatorFactory.getInstance().addDeckType(plugin.getName(), loadPlugin(plugin));
//        }
View Full Code Here

TOP

Related Classes of mage.server.util.ConfigSettings

Copyright © 2018 www.massapicom. 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.