Remove redundant config option

This commit is contained in:
Luck 2016-10-27 18:48:38 +01:00
parent 7acc8bc7ed
commit 66f756575a
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
12 changed files with 12 additions and 28 deletions

View File

@ -56,6 +56,6 @@ public class BukkitCalculatorFactory implements CalculatorFactory {
} }
processors.add(new DefaultsProcessor(contexts.isOp(), plugin.getDefaultsProvider())); processors.add(new DefaultsProcessor(contexts.isOp(), plugin.getDefaultsProvider()));
return new PermissionCalculator(plugin, user.getName(), plugin.getConfiguration().isDebugPermissionChecks(), processors.build()); return new PermissionCalculator(plugin, user.getName(), processors.build());
} }
} }

View File

@ -70,7 +70,7 @@ public class VaultPermissionHook extends Permission {
} }
public void log(String s) { public void log(String s) {
if (plugin.getConfiguration().isDebugPermissionChecks()) { if (plugin.getConfiguration().isVaultDebug()) {
plugin.getLog().info("[VAULT] " + s); plugin.getLog().info("[VAULT] " + s);
} }
} }

View File

@ -46,9 +46,6 @@ online-mode: true
# If the plugin should send log notifications to users whenever permissions are modified. # If the plugin should send log notifications to users whenever permissions are modified.
log-notify: true log-notify: true
# If LuckPerms should print to console every time a plugin checks if a player has a permission
debug-permission-checks: false
@ -125,6 +122,9 @@ vault-primary-groups-overrides:
# If LuckPerms should check if the user is actually a member of the group # If LuckPerms should check if the user is actually a member of the group
check-user-member-of: true check-user-member-of: true
# If LuckPerms should print debugging info to console when a plugin uses a Vault function
vault-debug: false
# Mirrors world names. Whenever LuckPerms checks what world a user is in, if the world name is in this list, the value assigned # Mirrors world names. Whenever LuckPerms checks what world a user is in, if the world name is in this list, the value assigned
# will be sent forward for permission calculation instead. # will be sent forward for permission calculation instead.
world-rewrite: world-rewrite:

View File

@ -43,6 +43,6 @@ public class BungeeCalculatorFactory implements CalculatorFactory {
processors.add(new RegexProcessor()); processors.add(new RegexProcessor());
} }
return new PermissionCalculator(plugin, user.getName(), plugin.getConfiguration().isDebugPermissionChecks(), processors.build()); return new PermissionCalculator(plugin, user.getName(), processors.build());
} }
} }

View File

@ -46,9 +46,6 @@ online-mode: true
# If the plugin should send log notifications to users whenever permissions are modified. # If the plugin should send log notifications to users whenever permissions are modified.
log-notify: true log-notify: true
# If LuckPerms should print to console every time a plugin checks if a player has a permission
debug-permission-checks: false
# Mirrors world names. Whenever LuckPerms checks what world a user is in, if the world name is in this list, the value assigned # Mirrors world names. Whenever LuckPerms checks what world a user is in, if the world name is in this list, the value assigned
# will be sent forward for permission calculation instead. # will be sent forward for permission calculation instead.
world-rewrite: world-rewrite:

View File

@ -103,7 +103,7 @@ public class LPConfigurationLink implements LPConfiguration {
@Override @Override
public boolean getDebugPermissionChecks() { public boolean getDebugPermissionChecks() {
return master.isDebugPermissionChecks(); return false; // Constant TODO depreciate this
} }
@Override @Override

View File

@ -39,7 +39,6 @@ import java.util.Map;
public class PermissionCalculator { public class PermissionCalculator {
private final LuckPermsPlugin plugin; private final LuckPermsPlugin plugin;
private final String objectName; private final String objectName;
private final boolean debug;
private final List<PermissionProcessor> processors; private final List<PermissionProcessor> processors;
private final LoadingCache<String, Tristate> cache = CacheBuilder.newBuilder() private final LoadingCache<String, Tristate> cache = CacheBuilder.newBuilder()
@ -57,12 +56,7 @@ public class PermissionCalculator {
public Tristate getPermissionValue(String permission) { public Tristate getPermissionValue(String permission) {
permission = permission.toLowerCase(); permission = permission.toLowerCase();
Tristate t = cache.getUnchecked(permission); Tristate t = cache.getUnchecked(permission);
plugin.getDebugHandler().printOutput(objectName, permission, t); plugin.getDebugHandler().printOutput(objectName, permission, t);
if (debug) {
plugin.getLog().info("Checking if " + objectName + " has permission: " + permission + " - (" + t.toString() + ")");
}
return t; return t;
} }

View File

@ -60,7 +60,6 @@ public abstract class AbstractConfiguration<T extends LuckPermsPlugin> implement
private boolean applyingRegex; private boolean applyingRegex;
private boolean applyingShorthand; private boolean applyingShorthand;
private boolean logNotify; private boolean logNotify;
private boolean debugPermissionChecks;
private boolean opsEnabled; private boolean opsEnabled;
private boolean commandsAllowOp; private boolean commandsAllowOp;
private boolean autoOp; private boolean autoOp;
@ -71,6 +70,7 @@ public abstract class AbstractConfiguration<T extends LuckPermsPlugin> implement
private boolean vaultPrimaryGroupOverridesCheckInherited; private boolean vaultPrimaryGroupOverridesCheckInherited;
private boolean vaultPrimaryGroupOverridesCheckExists; private boolean vaultPrimaryGroupOverridesCheckExists;
private boolean vaultPrimaryGroupOverridesCheckMemberOf; private boolean vaultPrimaryGroupOverridesCheckMemberOf;
private boolean vaultDebug;
private Map<String, String> worldRewrites; private Map<String, String> worldRewrites;
private Map<String, String> groupNameRewrites; private Map<String, String> groupNameRewrites;
private List<Rule> defaultAssignments; private List<Rule> defaultAssignments;
@ -110,7 +110,6 @@ public abstract class AbstractConfiguration<T extends LuckPermsPlugin> implement
applyingRegex = getBoolean("apply-regex", true); applyingRegex = getBoolean("apply-regex", true);
applyingShorthand = getBoolean("apply-shorthand", true); applyingShorthand = getBoolean("apply-shorthand", true);
logNotify = getBoolean("log-notify", true); logNotify = getBoolean("log-notify", true);
debugPermissionChecks = getBoolean("debug-permission-checks", false);
autoOp = getBoolean("auto-op", false); autoOp = getBoolean("auto-op", false);
opsEnabled = !isAutoOp() && getBoolean("enable-ops", true); opsEnabled = !isAutoOp() && getBoolean("enable-ops", true);
commandsAllowOp = getBoolean("commands-allow-op", true); commandsAllowOp = getBoolean("commands-allow-op", true);
@ -121,6 +120,7 @@ public abstract class AbstractConfiguration<T extends LuckPermsPlugin> implement
vaultPrimaryGroupOverridesCheckInherited = getBoolean("vault-primary-groups-overrides.check-inherited-permissions", false); vaultPrimaryGroupOverridesCheckInherited = getBoolean("vault-primary-groups-overrides.check-inherited-permissions", false);
vaultPrimaryGroupOverridesCheckExists = getBoolean("vault-primary-groups-overrides.check-group-exists", true); vaultPrimaryGroupOverridesCheckExists = getBoolean("vault-primary-groups-overrides.check-group-exists", true);
vaultPrimaryGroupOverridesCheckMemberOf = getBoolean("vault-primary-groups-overrides.check-user-member-of", true); vaultPrimaryGroupOverridesCheckMemberOf = getBoolean("vault-primary-groups-overrides.check-user-member-of", true);
vaultDebug = getBoolean("vault-debug", false);
worldRewrites = ImmutableMap.copyOf(getMap("world-rewrite", Collections.emptyMap())); worldRewrites = ImmutableMap.copyOf(getMap("world-rewrite", Collections.emptyMap()));
groupNameRewrites = ImmutableMap.copyOf(getMap("group-name-rewrite", Collections.emptyMap())); groupNameRewrites = ImmutableMap.copyOf(getMap("group-name-rewrite", Collections.emptyMap()));

View File

@ -64,8 +64,6 @@ public interface LPConfiguration {
boolean isLogNotify(); boolean isLogNotify();
boolean isDebugPermissionChecks();
boolean isOpsEnabled(); boolean isOpsEnabled();
boolean isCommandsAllowOp(); boolean isCommandsAllowOp();
@ -86,6 +84,8 @@ public interface LPConfiguration {
boolean isVaultPrimaryGroupOverridesCheckMemberOf(); boolean isVaultPrimaryGroupOverridesCheckMemberOf();
boolean isVaultDebug();
Map<String, String> getWorldRewrites(); Map<String, String> getWorldRewrites();
Map<String, String> getGroupNameRewrites(); Map<String, String> getGroupNameRewrites();

View File

@ -48,6 +48,6 @@ public class SpongeCalculatorFactory implements CalculatorFactory {
} }
processors.add(new DefaultsProcessor(plugin.getService(), LuckPermsService.convertContexts(contexts.getContexts()))); processors.add(new DefaultsProcessor(plugin.getService(), LuckPermsService.convertContexts(contexts.getContexts())));
return new PermissionCalculator(plugin, user.getName(), plugin.getConfiguration().isDebugPermissionChecks(), processors.build()); return new PermissionCalculator(plugin, user.getName(), processors.build());
} }
} }

View File

@ -80,10 +80,6 @@ public class UserCollection implements SubjectCollection {
return s.get(); return s.get();
} }
if (service.getPlugin().getConfiguration().isDebugPermissionChecks()) {
service.getPlugin().getLog().warn("Couldn't get user subject for: " + id);
}
// Fallback to the other collection. This Subject instance will never be persisted. // Fallback to the other collection. This Subject instance will never be persisted.
return fallback.get(id); return fallback.get(id);
} }

View File

@ -42,9 +42,6 @@ online-mode=true
# If the plugin should send log notifications to users whenever permissions are modified. # If the plugin should send log notifications to users whenever permissions are modified.
log-notify=true log-notify=true
# If LuckPerms should print to console every time a plugin checks if a player has a permission
debug-permission-checks=false
# Mirrors world names. Whenever LuckPerms checks what world a user is in, if the world name is in this list, the value assigned # Mirrors world names. Whenever LuckPerms checks what world a user is in, if the world name is in this list, the value assigned
# will be sent forward for permission calculation instead. # will be sent forward for permission calculation instead.
world-rewrite { world-rewrite {