1
0
mirror of https://github.com/LOOHP/Limbo.git synced 2026-06-08 05:51:43 +00:00

Flesh out allowlist handling

Addresses comments from https://github.com/LOOHP/Limbo/pull/57#issuecomment-1304543589

In particular:

* Functionality now matches other server types

* only enforce the allowlist if a new "enforce-allowlist"
  boolean in server.properties is set to true

* Loads and process the allowlist only once when the server starts (or
  the reload command is executed), instead of every time a user connects.

* Add a new command & associated permissions "allowlist reload"
  to reload the allowlist
This commit is contained in:
Tad Hunt
2022-11-05 14:32:25 -06:00
parent 898fe20b14
commit d3b0aba94f
4 changed files with 118 additions and 85 deletions
@@ -165,6 +165,20 @@ public class DefaultCommands implements CommandExecutor, TabCompletor {
}
return;
}
if (args[0].equalsIgnoreCase("allowlist")) {
if (sender.hasPermission("limboserver.allowlist")) {
if (args.length != 2) {
sender.sendMessage(ChatColor.RED + "Invalid usage!");
} else if (!args[1].equalsIgnoreCase("reload")) {
sender.sendMessage(ChatColor.RED + "Invalid usage!");
} else {
Limbo.getInstance().reloadAllowlist();
}
} else {
sender.sendMessage(ChatColor.RED + "You do not have permission to use that command!");
}
return;
}
}
@Override