add config option to disable /server

This commit is contained in:
ayunami2000 2022-07-11 11:44:04 -04:00
parent af9af3bbe7
commit b5cf14b204
4 changed files with 6 additions and 1 deletions

View File

@ -19,6 +19,8 @@ public class ChatHandler {
case "server":
if (!client.authed) return false;
if (!Main.serverCmd) return false;
if (args.isEmpty()) {
//usage msg
client.conn.send(new byte[] { 3, 0, 25, 0, (byte) 167, 0, 57, 0, 85, 0, 115, 0, 97, 0, 103, 0, 101, 0, 58, 0, 32, 0, 47, 0, 115, 0, 101, 0, 114, 0, 118, 0, 101, 0, 114, 0, 32, 0, 60, 0, 110, 0, 117, 0, 109, 0, 98, 0, 101, 0, 114, 0, 62 });

View File

@ -24,7 +24,7 @@ public class Main {
public static boolean forwarded = false;
public static boolean filterUsernames = true;
public static boolean serverCmd = true;
public static boolean useAuth = false;
public static int authIpLimit = -1;
@ -132,6 +132,7 @@ public class Main {
webPort = (int) config.getOrDefault("web_port", 25565);
forwarded = (boolean) config.getOrDefault("forwarded", false);
serverCmd = (boolean) config.getOrDefault("server_cmd", true);
List<String> defaultMotd = new ArrayList<>();

View File

@ -11,6 +11,8 @@ origin_blacklist: "https://g.eags.us/eaglercraft/origin_blacklist.txt"
# for example,
# - "https://g.eags.us"
origins: []
# enable /server command?
server_cmd: true
# authentication info
auth:
# use auth