Examples of ConfigFile


Examples of fr.neatmonster.nocheatplus.config.ConfigFile

        Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
            @Override
            public void run() {
                // Debug information about unknown blocks.
                // (Probably removed later.)
                ConfigFile config = ConfigManager.getConfigFile();
                BlockProperties.dumpBlocks(config.getBoolean(ConfPaths.BLOCKBREAK_FASTBREAK_DEBUG, config.getBoolean(ConfPaths.BLOCKBREAK_DEBUG, config.getBoolean(ConfPaths.CHECKS_DEBUG, false))));
            }
        });
    }
View Full Code Here

Examples of fr.neatmonster.nocheatplus.config.ConfigFile

    protected void scheduleConsistencyCheckers(){
        BukkitScheduler sched = getServer().getScheduler();
        if (consistencyCheckerTaskId != -1){
            sched.cancelTask(consistencyCheckerTaskId);
        }
        ConfigFile config = ConfigManager.getConfigFile();
        if (!config.getBoolean(ConfPaths.DATA_CONSISTENCYCHECKS_CHECK, true)) return;
        // Schedule task in seconds.
        final long delay = 20L * config.getInt(ConfPaths.DATA_CONSISTENCYCHECKS_INTERVAL, 1, 3600, 10);
        consistencyCheckerTaskId = sched.scheduleSyncRepeatingTask(this, new Runnable() {
            @Override
            public void run() {
                runConsistencyChecks();
            }
View Full Code Here

Examples of fr.neatmonster.nocheatplus.config.ConfigFile

    /**
     * Run consistency checks for at most the configured duration. If not finished, a task will be scheduled to continue.
     */
    protected void runConsistencyChecks(){
        final long tStart = System.currentTimeMillis();
        final ConfigFile config = ConfigManager.getConfigFile();
        if (!config.getBoolean(ConfPaths.DATA_CONSISTENCYCHECKS_CHECK) || consistencyCheckers.isEmpty()){
            consistencyCheckerIndex = 0;
            return;
        }
        final long tEnd = tStart + config.getLong(ConfPaths.DATA_CONSISTENCYCHECKS_MAXTIME, 1, 50, 2);
        if (consistencyCheckerIndex >= consistencyCheckers.size()) consistencyCheckerIndex = 0;
        final Player[] onlinePlayers = getServer().getOnlinePlayers();
        // Loop
        while (consistencyCheckerIndex < consistencyCheckers.size()){
            final ConsistencyChecker checker = consistencyCheckers.get(consistencyCheckerIndex);
            try{
                checker.checkConsistency(onlinePlayers);
            }
            catch (Throwable t){
                LogUtil.logSevere("[NoCheatPlus] ConsistencyChecker(" + checker.getClass().getName() + ") encountered an exception:");
                LogUtil.logSevere(t);
            }
            consistencyCheckerIndex ++; // Do not remove :).
            final long now = System.currentTimeMillis();
            if (now < tStart || now >= tEnd){
                break;
            }
        }
        // (The index might be bigger than size by now.)

        final boolean debug = config.getBoolean(ConfPaths.LOGGING_DEBUG);

        // If not finished, schedule further checks.
        if (consistencyCheckerIndex < consistencyCheckers.size()){
            getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
                @Override
View Full Code Here

Examples of fr.neatmonster.nocheatplus.config.ConfigFile

    /** Commands not to be executed in-game.  */
    private final SimpleCharPrefixTree consoleOnlyCommands = new SimpleCharPrefixTree();
   
    public ChatListener(){
      super(CheckType.CHAT);
      ConfigFile config = ConfigManager.getConfigFile();
      initFilters(config);
      // (text inits in constructor.)
    }
View Full Code Here

Examples of fr.neatmonster.nocheatplus.config.ConfigFile

    }

  @Override
  public void onReload() {
    // Read some things from the global config file.
      ConfigFile config = ConfigManager.getConfigFile();
      initFilters(config);
      text.onReload();
      logins.onReload();
  }
View Full Code Here

Examples of fr.neatmonster.nocheatplus.config.ConfigFile

    }
  }
 
  private void init() {
    // Set some things from the global config.
    final ConfigFile config = ConfigManager.getConfigFile();
    final NoCheatPlusAPI api = NCPAPIProvider.getNoCheatPlusAPI();
    if (engine != null) {
      engine.clear();
      api.removeComponent(engine);
    }
View Full Code Here

Examples of fr.neatmonster.nocheatplus.config.ConfigFile

    /** Maximum distance for thunder effects (squared). */
    private final double distSq;

    public SoundDistance(Plugin plugin) {
        super(plugin, PacketType.Play.Server.NAMED_SOUND_EFFECT);
        ConfigFile config = ConfigManager.getConfigFile();
        double dist = config.getDouble(ConfPaths.NET_SOUNDDISTANCE_MAXDISTANCE);
        distSq = dist * dist;
    }
View Full Code Here

Examples of fr.neatmonster.nocheatplus.config.ConfigFile

  private final float maxPackets;
 
  public FlyingFrequency(Plugin plugin) {
    // PacketPlayInFlying[3, legacy: 10]
    super(plugin, PacketType.Play.Client.FLYING); // TODO: How does POS and POS_LOOK relate/translate?
    ConfigFile config = ConfigManager.getConfigFile();
    seconds = Math.max(1, config.getInt(ConfPaths.NET_FLYINGFREQUENCY_SECONDS));
    maxPackets = Math.max(1, config.getInt(ConfPaths.NET_FLYINGFREQUENCY_MAXPACKETS));
  }
View Full Code Here

Examples of net.crystalyx.bukkit.simplyperms.io.ConfigFile

  }

  @Override
  public void run() throws Exception {
      try {
        ConfigFile importFile = new ConfigFile(plugin);
        ConfigSQL importSQL = new ConfigSQL(plugin);
        if (!importSQL.checkDatabase()) {
          throw new Exception("Could not connect to database !");
        }
       
        for (String player : importSQL.getAllPlayers()) {
          for (String group : importSQL.getPlayerGroups(player)) {
            importFile.addPlayerGroup(player, group);
          }

          for (Entry<String, Boolean> permission : importSQL.getPlayerPermissions(player).entrySet()) {
            importFile.addPlayerPermission(player, permission.getKey(), permission.getValue());
          }

          for (String world : importSQL.getPlayerWorlds(player)) {
            for (Entry<String, Boolean> permission : importSQL.getPlayerPermissions(player, world).entrySet()) {
              importFile.addPlayerPermission(player, world, permission.getKey(), permission.getValue());
            }
          }
        }
      } catch (Exception e) {
        throw e;
View Full Code Here

Examples of net.crystalyx.bukkit.simplyperms.io.ConfigFile

  }

  @Override
  public void run() throws Exception {
      try {
        ConfigFile importFile = new ConfigFile(plugin);
        ConfigSQL importSQL = new ConfigSQL(plugin);
        if (!importSQL.checkDatabase()) {
          throw new Exception("Could not connect to database !");
        }

        for (String player : importFile.getAllPlayers()) {
          for (String group : importFile.getPlayerGroups(player)) {
            importSQL.addPlayerGroup(player, group);
          }

          for (Entry<String, Boolean> permission : importFile.getPlayerPermissions(player).entrySet()) {
            importSQL.addPlayerPermission(player, permission.getKey(), permission.getValue());
          }

          for (String world : importFile.getPlayerWorlds(player)) {
            for (Entry<String, Boolean> permission : importFile.getPlayerPermissions(player, world).entrySet()) {
              importSQL.addPlayerPermission(player, world, permission.getKey(), permission.getValue());
            }
          }
        }
      } catch (Exception e) {
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.