public SimilarWordsBKLSettings applyConfig(ConfigFile config, String prefix){ super.applyConfig(config, prefix); this.range = config.getInt(prefix + "range", this.range); this.maxSize = config.getInt(prefix + "size", this.maxSize); this.maxSeek= config.getInt(prefix + "seek", this.maxSeek); this.durExpire = (long) (config.getDouble(prefix + "time", (float) this.durExpire / 1000f) * 1000f); return this; } }
public FlatWordsSettings applyConfig(ConfigFile config, String prefix){ super.applyConfig(config, prefix); this.maxSize = config.getInt(prefix + "size", this.maxSize); this.nBuckets = config.getInt(prefix + "buckets", this.nBuckets); // In seconds. this.durBucket = (long) (config.getDouble(prefix + "time", (float) this.durBucket / 1000f) * 1000f); this.factor = (float) config.getDouble(prefix + "factor", this.factor); return this; } }
@Override public void onReload() { aux.clear(); hoverTicksStep = Math.max(1, ConfigManager.getConfigFile().getInt(ConfPaths.MOVING_SURVIVALFLY_HOVER_STEP)); }
public WordPrefixesSettings applyConfig(ConfigFile config, String prefix){ super.applyConfig(config, prefix); this.maxAdd = config.getInt(prefix + "size", this.maxAdd); this.durExpire = (long) (config.getDouble(prefix + "time", (float) this.durExpire / 1000f) * 1000f); return this; } }
/** * Returns this object. * @param config * @param prefix Prefix for direct addition of config path. * @return This object. */ public DigestedWordsSettings applyConfig(ConfigFile config, String prefix){ this.sort = config.getBoolean(prefix + "sort", this.sort); this.compress = config.getBoolean(prefix + "compress", this.compress); this.split = config.getBoolean(prefix + "split", this.split); this.weight = (float) config.getDouble(prefix + "weight", this.weight); this.minWordSize = config.getInt(prefix + "minwordsize", this.minWordSize); this.maxWordSize = config.getInt(prefix + "maxwordsize", this.maxWordSize); return this; } }
attackFrequencyLimitSecondsHalf = config.getInt(ConfPaths.NET_ATTACKFREQUENCY_SECONDS_HALF); attackFrequencyLimitSecondsOne = config.getInt(ConfPaths.NET_ATTACKFREQUENCY_SECONDS_ONE); attackFrequencyLimitSecondsTwo = config.getInt(ConfPaths.NET_ATTACKFREQUENCY_SECONDS_TWO); attackFrequencyLimitSecondsFour= config.getInt(ConfPaths.NET_ATTACKFREQUENCY_SECONDS_FOUR); attackFrequencyLimitSecondsEight = config.getInt(ConfPaths.NET_ATTACKFREQUENCY_SECONDS_EIGHT); attackFrequencyActions = config.getOptimizedActionList(ConfPaths.NET_ATTACKFREQUENCY_ACTIONS, Permissions.NET_ATTACKFREQUENCY); flyingFrequencySeconds = Math.max(1, globalConfig.getInt(ConfPaths.NET_FLYINGFREQUENCY_SECONDS)); flyingFrequencyPPS = Math.max(1.0, globalConfig.getDouble(ConfPaths.NET_FLYINGFREQUENCY_PACKETSPERSECOND)); flyingFrequencyActions = config.getOptimizedActionList(ConfPaths.NET_FLYINGFREQUENCY_ACTIONS, Permissions.NET_FLYINGFREQUENCY); flyingFrequencyRedundantActive = config.getBoolean(ConfPaths.NET_FLYINGFREQUENCY_CANCELREDUNDANT); flyingFrequencyRedundantSeconds = Math.max(1, config.getInt(ConfPaths.NET_FLYINGFREQUENCY_REDUNDANT_SECONDS)); AlmostBoolean.NO, OverrideType.PERMANENT, true); packetFrequencyPacketsPerSecond = config.getInt(ConfPaths.NET_PACKETFREQUENCY_PPS); packetFrequencySeconds = config.getInt(ConfPaths.NET_PACKETFREQUENCY_SECONDS); packetFrequencyActions = config.getOptimizedActionList(ConfPaths.NET_PACKETFREQUENCY_ACTIONS, Permissions.NET_PACKETFREQUENCY);
fastBreakGrace = config.getLong(ConfPaths.BLOCKBREAK_FASTBREAK_BUCKETS_CONTENTION, config.getLong(ConfPaths.BLOCKBREAK_FASTBREAK_GRACE, 2000)); fastBreakBucketDur = config.getInt(ConfPaths.BLOCKBREAK_FASTBREAK_BUCKETS_DUR, 4000); fastBreakBucketFactor = (float) config.getDouble(ConfPaths.BLOCKBREAK_FASTBREAK_BUCKETS_FACTOR, 0.99); fastBreakBuckets = config.getInt(ConfPaths.BLOCKBREAK_FASTBREAK_BUCKETS_N, 30); fastBreakModSurvival = config.getInt(ConfPaths.BLOCKBREAK_FASTBREAK_MOD_SURVIVAL); frequencyBuckets = config.getInt(ConfPaths.BLOCKBREAK_FREQUENCY_BUCKETS_N, 2); frequencyBucketDur = config.getLong(ConfPaths.BLOCKBREAK_FREQUENCY_BUCKETS_DUR, 1000); frequencyBucketFactor = (float) config.getDouble(ConfPaths.BLOCKBREAK_FREQUENCY_BUCKETS_FACTOR, 1f); frequencyIntervalCreative = config.getInt(ConfPaths.BLOCKBREAK_FREQUENCY_MOD_CREATIVE); frequencyIntervalSurvival = config.getInt(ConfPaths.BLOCKBREAK_FREQUENCY_MOD_SURVIVAL); frequencyShortTermLimit = config.getInt(ConfPaths.BLOCKBREAK_FREQUENCY_SHORTTERM_LIMIT); frequencyShortTermTicks = config.getInt(ConfPaths.BLOCKBREAK_FREQUENCY_SHORTTERM_TICKS); frequencyActions = config.getOptimizedActionList(ConfPaths.BLOCKBREAK_FREQUENCY_ACTIONS, Permissions.BLOCKBREAK_FREQUENCY); wrongBLockLevel = config.getInt(ConfPaths.BLOCKBREAK_WRONGBLOCK_LEVEL); wrongBlockActions = config.getOptimizedActionList(ConfPaths.BLOCKBREAK_WRONGBLOCK_ACTIONS, Permissions.BLOCKBREAK_WRONGBLOCK);
/** * This will create all default loggers as well. * @param plugin */ public BukkitLogManager(Plugin plugin) { super(new BukkitLogNodeDispatcher(plugin), Streams.defaultPrefix, Streams.INIT); this.plugin = plugin; ConfigFile config = ConfigManager.getConfigFile(); createDefaultLoggers(config); getLogNodeDispatcher().setMaxQueueSize(config.getInt(ConfPaths.LOGGING_MAXQUEUESIZE)); }
invulnerableInitialTicksJoin = config.getInt(ConfPaths.COMBINED_INVULNERABLE_INITIALTICKS_JOIN); boolean error = false; yawRate = config.getInt(ConfPaths.COMBINED_YAWRATE_RATE); yawRateImprobable = config.getBoolean(ConfPaths.COMBINED_YAWRATE_IMPROBABLE); yawRatePenaltyFactor = (float) config.getDouble(ConfPaths.COMBINED_YAWRATE_PENALTY_FACTOR); yawRatePenaltyMin = config.getInt(ConfPaths.COMBINED_YAWRATE_PENALTY_MIN); yawRatePenaltyMax = config.getInt(ConfPaths.COMBINED_YAWRATE_PENALTY_MAX);
private void updateBlockChangeTracker(final ConfigFile config) { // Activation / listener. if (config.getBoolean(ConfPaths.COMPATIBILITY_BLOCKS_CHANGETRACKER_ACTIVE) && config.getBoolean(ConfPaths.COMPATIBILITY_BLOCKS_CHANGETRACKER_PISTONS)) { if (blockChangeListener == null) { blockChangeListener = new BlockChangeListener(blockChangeTracker); blockChangeListener.register(); } blockChangeListener.setEnabled(true); } else if (blockChangeListener != null) { blockChangeListener.setEnabled(false); blockChangeTracker.clear(); } // Configuration. blockChangeTracker.setExpirationAgeTicks(config.getInt(ConfPaths.COMPATIBILITY_BLOCKS_CHANGETRACKER_MAXAGETICKS)); blockChangeTracker.setWorldNodeSkipSize(config.getInt(ConfPaths.COMPATIBILITY_BLOCKS_CHANGETRACKER_PERWORLD_MAXENTRIES)); blockChangeTracker.updateBlockCacheHandle(); }
/** * Set instance members based on the given configuration. This is meant to * work after reloading the configuration too. * * @param config */ private void setInstanceMembers(final ConfigFile config) { configProblemsChat = ConfigManager.isConfigUpToDate(config, config.getInt(ConfPaths.CONFIGVERSION_NOTIFYMAXPATHS)); configProblemsFile = configProblemsChat == null ? null : ConfigManager.isConfigUpToDate(config, -1); clearExemptionsOnJoin = config.getBoolean(ConfPaths.COMPATIBILITY_EXEMPTIONS_REMOVE_JOIN); clearExemptionsOnLeave = config.getBoolean(ConfPaths.COMPATIBILITY_EXEMPTIONS_REMOVE_LEAVE); NCPExemptionManager.setExemptionSettings(new ExemptionSettings(config)); }
fastPlaceLimit = config.getInt(ConfPaths.BLOCKPLACE_FASTPLACE_LIMIT); fastPlaceShortTermTicks = config.getInt(ConfPaths.BLOCKPLACE_FASTPLACE_SHORTTERM_TICKS); fastPlaceShortTermLimit = config.getInt(ConfPaths.BLOCKPLACE_FASTPLACE_SHORTTERM_LIMIT); fastPlaceActions = config.getOptimizedActionList(ConfPaths.BLOCKPLACE_FASTPLACE_ACTIONS, Permissions.BLOCKPLACE_FASTPLACE);
/** * Instantiates a new block interact configuration. * * @param data * the data */ public BlockInteractConfig(final IWorldData worldData) { super(worldData); final ConfigFile data = worldData.getRawConfiguration(); directionActions = data.getOptimizedActionList(ConfPaths.BLOCKINTERACT_DIRECTION_ACTIONS, Permissions.BLOCKINTERACT_DIRECTION); reachActions = data.getOptimizedActionList(ConfPaths.BLOCKINTERACT_REACH_ACTIONS, Permissions.BLOCKINTERACT_REACH); speedInterval = data.getLong(ConfPaths.BLOCKINTERACT_SPEED_INTERVAL); speedLimit = data.getInt(ConfPaths.BLOCKINTERACT_SPEED_LIMIT); speedActions = data.getOptimizedActionList(ConfPaths.BLOCKINTERACT_SPEED_ACTIONS, Permissions.BLOCKINTERACT_SPEED); visibleActions = data.getOptimizedActionList(ConfPaths.BLOCKINTERACT_VISIBLE_ACTIONS, Permissions.BLOCKINTERACT_VISIBLE); }
private 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(); } }, delay, delay ); }
morePacketsEPSIdeal = config.getInt(ConfPaths.MOVING_MOREPACKETS_EPSIDEAL); morePacketsEPSMax = Math.max(morePacketsEPSIdeal, config.getInt(ConfPaths.MOVING_MOREPACKETS_EPSMAX)); morePacketsEPSBuckets = 2 * Math.max(1, Math.min(60, config.getInt(ConfPaths.MOVING_MOREPACKETS_SECONDS))); morePacketsBurstPackets = config.getInt(ConfPaths.MOVING_MOREPACKETS_BURST_EPM); morePacketsBurstDirect = config.getInt(ConfPaths.MOVING_MOREPACKETS_BURST_DIRECT); morePacketsBurstEPM = config.getInt(ConfPaths.MOVING_MOREPACKETS_BURST_EPM); morePacketsSetBackAge = config.getInt(ConfPaths.MOVING_MOREPACKETS_SETBACKAGE); morePacketsActions = config.getOptimizedActionList(ConfPaths.MOVING_MOREPACKETS_ACTIONS, Permissions.MOVING_MOREPACKETS); survivalFlyBlockingSpeed = config.getInt(ConfPaths.MOVING_SURVIVALFLY_BLOCKINGSPEED, 100); survivalFlySneakingSpeed = config.getInt(ConfPaths.MOVING_SURVIVALFLY_SNEAKINGSPEED, 100); survivalFlySpeedingSpeed = config.getInt(ConfPaths.MOVING_SURVIVALFLY_SPEEDINGSPEED, 200); survivalFlySprintingSpeed = config.getInt(ConfPaths.MOVING_SURVIVALFLY_SPRINTINGSPEED, 100); survivalFlySwimmingSpeed = config.getInt(ConfPaths.MOVING_SURVIVALFLY_SWIMMINGSPEED, 100); survivalFlyWalkingSpeed = config.getInt(ConfPaths.MOVING_SURVIVALFLY_WALKINGSPEED, 100); survivalFlyCobwebHack = config.getBoolean(ConfPaths.MOVING_SURVIVALFLY_COBWEBHACK, true); sfSlownessSprintHack = config.getAlmostBoolean(ConfPaths.MOVING_SURVIVALFLY_SLOWNESSSPRINTHACK, AlmostBoolean.MAYBE).decideOptimistically(); survivalFlyVLFreezeCount = config.getInt(ConfPaths.MOVING_SURVIVALFLY_LENIENCY_FREEZECOUNT); survivalFlyVLFreezeInAir = config.getBoolean(ConfPaths.MOVING_SURVIVALFLY_LENIENCY_FREEZEINAIR); survivalFlyActions = config.getOptimizedActionList(ConfPaths.MOVING_SURVIVALFLY_ACTIONS, Permissions.MOVING_SURVIVALFLY); sfHoverTicks = config.getInt(ConfPaths.MOVING_SURVIVALFLY_HOVER_TICKS); sfHoverLoginTicks = Math.max(0, config.getInt(ConfPaths.MOVING_SURVIVALFLY_HOVER_LOGINTICKS)); sfHoverFallDamage = config.getBoolean(ConfPaths.MOVING_SURVIVALFLY_HOVER_FALLDAMAGE); sfHoverViolation = config.getDouble(ConfPaths.MOVING_SURVIVALFLY_HOVER_SFVIOLATION); velocityActivationCounter = config.getInt(ConfPaths.MOVING_VELOCITY_ACTIVATIONCOUNTER); velocityActivationTicks = config.getInt(ConfPaths.MOVING_VELOCITY_ACTIVATIONTICKS);
if (!overrideCreated && globalConfig.getInt(ConfPaths.CONFIGVERSION_CREATED, 0) >= 0 && ConfigManager.isConfigUpToDate(globalConfig, 0) == null) {
captchaLength = config.getInt(ConfPaths.CHAT_CAPTCHA_LENGTH); captchaQuestion = config.getString(ConfPaths.CHAT_CAPTCHA_QUESTION); captchaSuccess = config.getString(ConfPaths.CHAT_CAPTCHA_SUCCESS); captchaTries = config.getInt(ConfPaths.CHAT_CAPTCHA_TRIES); captchaActions = config.getOptimizedActionList(ConfPaths.CHAT_CAPTCHA_ACTIONS, Permissions.CHAT_CAPTCHA); commandsShortTermTicks = config.getInt(ConfPaths.CHAT_COMMANDS_SHORTTERM_TICKS); commandsShortTermLevel = config.getDouble(ConfPaths.CHAT_COMMANDS_SHORTTERM_LEVEL);; commandsActions = config.getOptimizedActionList(ConfPaths.CHAT_COMMANDS_ACTIONS, Permissions.CHAT_COMMANDS); loginsSeconds = config.getInt(ConfPaths.CHAT_LOGINS_SECONDS); loginsLimit = config.getInt(ConfPaths.CHAT_LOGINS_LIMIT); loginsKickMessage = config.getString(ConfPaths.CHAT_LOGINS_KICKMESSAGE); loginsStartupDelay = config.getInt(ConfPaths.CHAT_LOGINS_STARTUPDELAY) * 1000; relogWarningNumber = config.getInt(ConfPaths.CHAT_RELOG_WARNING_NUMBER); relogWarningTimeout = config.getLong(ConfPaths.CHAT_RELOG_WARNING_TIMEOUT); relogActions = config.getOptimizedActionList(ConfPaths.CHAT_RELOG_ACTIONS, Permissions.CHAT_RELOG);
speedLimit = config.getInt(ConfPaths.FIGHT_SPEED_LIMIT); speedBuckets = config.getInt(ConfPaths.FIGHT_SPEED_BUCKETS_N, 6); speedBucketDur = config.getLong(ConfPaths.FIGHT_SPEED_BUCKETS_DUR, 333); speedBucketFactor = (float) config.getDouble(ConfPaths.FIGHT_SPEED_BUCKETS_FACTOR, 1f); speedShortTermLimit = config.getInt(ConfPaths.FIGHT_SPEED_SHORTTERM_LIMIT); speedShortTermTicks = config.getInt(ConfPaths.FIGHT_SPEED_SHORTTERM_TICKS); speedActions = config.getOptimizedActionList(ConfPaths.FIGHT_SPEED_ACTIONS, Permissions.FIGHT_SPEED);
super(worldData); final ConfigFile data = worldData.getRawConfiguration(); dropLimit = data.getInt(ConfPaths.INVENTORY_DROP_LIMIT); dropTimeFrame = data.getLong(ConfPaths.INVENTORY_DROP_TIMEFRAME); dropActions = data.getOptimizedActionList(ConfPaths.INVENTORY_DROP_ACTIONS, Permissions.INVENTORY_DROP); instantBowDelay = data.getInt(ConfPaths.INVENTORY_INSTANTBOW_DELAY); instantBowImprobableFeedOnly = data.getBoolean(ConfPaths.INVENTORY_INSTANTBOW_IMPROBABLE_FEEDONLY); instantBowImprobableWeight = (float) data.getDouble(ConfPaths.INVENTORY_INSTANTBOW_IMPROBABLE_WEIGHT);