Disallow use of some server disrupting command rewards, fixes #1410

This commit is contained in:
PikaMug 2020-09-28 19:57:57 -04:00
parent cbb6d0941a
commit 88ccd1bd12
2 changed files with 19 additions and 1 deletions

View File

@ -76,6 +76,7 @@ public class ActionMainPrompt extends ActionsEditorNumericPrompt {
case 4: case 4:
case 5: case 5:
case 6: case 6:
return ChatColor.BLUE;
case 7: case 7:
if (plugin.getDependencies().getDenizenApi() == null) { if (plugin.getDependencies().getDenizenApi() == null) {
return ChatColor.GRAY; return ChatColor.GRAY;

View File

@ -753,7 +753,24 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
if (s.startsWith("/")) { if (s.startsWith("/")) {
s = s.substring(1); s = s.substring(1);
} }
commands.add(s); switch (s.trim().split(" ")[0].toLowerCase()) {
case "*":
case "op":
case "deop":
case "stop":
case "reload":
case "timings":
case "pardon":
case "pardon-ip":
case "ban":
case "ban-ip":
case "whitelist":
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption")
+ ChatColor.DARK_RED + " (" + s.trim() + ")");
continue;
default:
commands.add(s.trim());
}
} }
context.setSessionData(CK.REW_COMMAND, commands.isEmpty() ? null : commands); context.setSessionData(CK.REW_COMMAND, commands.isEmpty() ? null : commands);
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) { } else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {