return; final long tEnd = tStart + config.getLong(ConfPaths.DATA_CONSISTENCYCHECKS_MAXTIME, 1, 50, 2); if (consistencyCheckerIndex >= consistencyCheckers.size()) consistencyCheckerIndex = 0; final Player[] onlinePlayers = BridgeMisc.getOnlinePlayers();
/** * 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); }
angleActions = config.getOptimizedActionList(ConfPaths.FIGHT_ANGLE_ACTIONS, Permissions.FIGHT_ANGLE); toolChangeAttackPenalty = config.getLong(ConfPaths.FIGHT_TOOLCHANGEPENALTY); directionPenalty = config.getLong(ConfPaths.FIGHT_DIRECTION_PENALTY); directionActions = config.getOptimizedActionList(ConfPaths.FIGHT_DIRECTION_ACTIONS, Permissions.FIGHT_DIRECTION); true); fastHealInterval = config.getLong(ConfPaths.FIGHT_FASTHEAL_INTERVAL); fastHealBuffer = config.getLong(ConfPaths.FIGHT_FASTHEAL_BUFFER); fastHealActions = config.getOptimizedActionList(ConfPaths.FIGHT_FASTHEAL_ACTIONS, Permissions.FIGHT_FASTHEAL); godModeLagMinAge = config.getLong(ConfPaths.FIGHT_GODMODE_LAGMINAGE); godModeLagMaxAge = config.getLong(ConfPaths.FIGHT_GODMODE_LAGMAXAGE); godModeActions = config.getOptimizedActionList(ConfPaths.FIGHT_GODMODE_ACTIONS, Permissions.FIGHT_GODMODE); reachPenalty = config.getLong(ConfPaths.FIGHT_REACH_PENALTY); reachPrecision = config.getBoolean(ConfPaths.FIGHT_REACH_PRECISION); reachReduce = config.getBoolean(ConfPaths.FIGHT_REACH_REDUCE); 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);
fastBreakDelay = config.getLong(ConfPaths.BLOCKBREAK_FASTBREAK_DELAY); 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); 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);
/** * Fetch settings from the current default config. */ private void adjustSettings() { final ConfigFile config = ConfigManager.getConfigFile(); doExpireData = config.getBoolean(ConfPaths.DATA_EXPIRATION_ACTIVE); durExpireData = config.getLong(ConfPaths.DATA_EXPIRATION_DURATION, 1, 1000000, 60) * 60000L; // in minutes deleteData = config.getBoolean(ConfPaths.DATA_EXPIRATION_DATA, true); // hidden. deleteHistory = config.getBoolean(ConfPaths.DATA_EXPIRATION_HISTORY); // TODO: Per world permission registries: need world configs (...). Set<RegisteredPermission> changedPermissions = null; try { // TODO: Only update if changes are there - should have a config-path hash+size thing (+ setting). changedPermissions = permissionRegistry.updateSettings(PermissionSettings.fromConfig(config, ConfPaths.PERMISSIONS_POLICY_DEFAULT, ConfPaths.PERMISSIONS_POLICY_RULES)); } catch (Exception e) { StaticLog.logSevere("Failed to read the permissions setup. Relay to ALWAYS policy."); StaticLog.logSevere(e); permissionRegistry.updateSettings(new PermissionSettings(null, null, new PermissionPolicy())); } // Invalidate all already fetched permissions. for(final Entry<UUID, PlayerData> entry : playerData.iterable()) { entry.getValue().adjustSettings(changedPermissions); } }
speedInterval = config.getLong(ConfPaths.BLOCKPLACE_SPEED_INTERVAL); speedActions = config.getOptimizedActionList(ConfPaths.BLOCKPLACE_SPEED_ACTIONS, Permissions.BLOCKPLACE_SPEED);
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);
chatWarningLevel = (float) config.getDouble(ConfPaths.CHAT_WARNING_LEVEL); chatWarningMessage = config.getString(ConfPaths.CHAT_WARNING_MESSAGE); chatWarningTimeout = config.getLong(ConfPaths.CHAT_WARNING_TIMEOUT) * 1000; relogTimeout = config.getLong(ConfPaths.CHAT_RELOG_TIMEOUT); relogWarningMessage = config.getString(ConfPaths.CHAT_RELOG_WARNING_MESSAGE); 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);