use of fr.neatmonster.nocheatplus.hooks.ExemptionSettings in project NoCheatPlus by NoCheatPlus.
the class NoCheatPlus method setInstanceMembers.
/**
* 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));
}
use of fr.neatmonster.nocheatplus.hooks.ExemptionSettings in project NoCheatPlus by NoCheatPlus.
the class NoCheatPlus method setupBasics.
/**
* Lazy initialization of basics (static API, configuration, logging).
*/
private void setupBasics() {
// Ensure permissions are registered early.
for (RegisteredPermission rp : Permissions.getPermissions()) {
if (permissionRegistry.getPermissionInfo(rp.getId()) == null) {
permissionRegistry.addRegisteredPermission(rp);
}
}
// API.
updateNoCheatPlusAPI();
// Initialize server version.
if (ServerVersion.getMinecraftVersion() == GenericVersion.UNKNOWN_VERSION) {
BukkitVersion.init();
}
// Pre config setup.
if (getGenericInstance(ActionFactoryFactory.class) == null) {
// Set to default.
setActionFactoryFactory(null);
}
// Configuration.
if (!ConfigManager.isInitialized()) {
ConfigManager.init(this, worldDataManager);
// Basic setup for exemption (uses CheckType). This is redundant, but should not hurt.
NCPExemptionManager.setExemptionSettings(new ExemptionSettings(ConfigManager.getConfigFile()));
}
// Logging.
if (logManager == null || logManager.getStreamID(Streams.STATUS.name) != Streams.STATUS) {
logManager = new BukkitLogManager(this);
StaticLog.setStreamID(Streams.INIT);
StaticLog.setUseLogManager(true);
logManager.info(Streams.INIT, "Logging system initialized.");
logManager.info(Streams.INIT, "Detected Minecraft version: " + ServerVersion.getMinecraftVersion());
genericInstanceRegistry.setLogger(logManager, new IGetStreamId() {
@Override
public StreamID getStreamId() {
// TODO Auto-generated method stub
return NoCheatPlus.this.getRegistryStreamId();
}
}, "[GenericInstanceRegistry] ");
}
}
Aggregations