Add config option to enable console SQL commands
(disabled by default)
This commit is contained in:
@@ -24,6 +24,7 @@ public class APConfig {
|
||||
private boolean overrideCommands;
|
||||
private boolean logIncrementalPosition;
|
||||
private boolean disableVacuum;
|
||||
private boolean consoleSQL;
|
||||
private boolean sessionLogIP;
|
||||
private boolean skipRowCount;
|
||||
private KeyUtil key;
|
||||
@@ -62,6 +63,7 @@ public class APConfig {
|
||||
} else {
|
||||
disableVacuum = config.getBoolean("disablevacuum", false);
|
||||
}
|
||||
consoleSQL = config.getBoolean("ConsoleSQLCommands", false);
|
||||
if (config.getPlatform() == PlatformType.SPIGOT) {
|
||||
overrideCommands = config.getBoolean("OverrideCommands");
|
||||
inventoryOnWorldChange = config.getBoolean("Actions.inventory.WorldChange", false);
|
||||
@@ -284,4 +286,8 @@ public class APConfig {
|
||||
public boolean isSkipRowCount() {
|
||||
return skipRowCount;
|
||||
}
|
||||
|
||||
public boolean isConsoleSQL() {
|
||||
return consoleSQL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,10 @@ public class SQLCommand extends Command {
|
||||
|
||||
@Override
|
||||
public void onCommand(SenderAdapter sender, String commandLabel, String[] args) {
|
||||
if (!plugin.getAPConfig().isConsoleSQL()) {
|
||||
sender.sendMessageRaw("&cThis command must be enabled in the config by setting 'ConsoleSQLCommands: true'");
|
||||
return;
|
||||
}
|
||||
StringBuilder msg = new StringBuilder();
|
||||
for (int i = 1; i < args.length; i++) {
|
||||
msg.append(args[i]).append(" ");
|
||||
|
||||
Reference in New Issue
Block a user