From 2f2c1fd4f7054ae4d24131ae0aec74ec7c2347ce Mon Sep 17 00:00:00 2001 From: "Robin C. Ladiges" Date: Wed, 22 Mar 2023 21:43:28 +0100 Subject: [PATCH] add command: `ban profile ` To add a profile ID to the ban list. --- Server/BanLists.cs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/Server/BanLists.cs b/Server/BanLists.cs index 69c63d4..15ecde1 100644 --- a/Server/BanLists.cs +++ b/Server/BanLists.cs @@ -120,7 +120,7 @@ public static class BanLists { public static string HandleBanCommand(string[] args, MUCH much) { if (args.Length == 0) { - return "Usage: ban {player|ip} ..."; + return "Usage: ban {player|profile|ip} ..."; } string cmd = args[0]; @@ -128,7 +128,7 @@ public static class BanLists { switch (cmd) { default: - return "Usage: ban {player|ip} ..."; + return "Usage: ban {player|profile|ip} ..."; case "player": if (args.Length == 0) { @@ -154,6 +154,21 @@ public static class BanLists { Save(); return sb.ToString(); + case "profile": + if (args.Length != 1) { + return "Usage: ban profile "; + } + if (!Guid.TryParse(args[0], out Guid id)) { + return "Invalid profile ID value!"; + } + if (IsProfileBanned(id)) { + return "Profile " + id.ToString() + " is already banned."; + } + BanProfile(id); + CrashMultiple(args, much); + Save(); + return "Banned profile: " + id.ToString(); + case "ip": if (args.Length != 1) { return "Usage: ban ip ";