From 5c5b37a81abbce9f472b588e07e8c55e35eb67fb Mon Sep 17 00:00:00 2001 From: "Robin C. Ladiges" Date: Sun, 20 Oct 2024 09:37:49 +0200 Subject: [PATCH] [ban] new: add command `unban gamemode` --- Server/BanLists.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Server/BanLists.cs b/Server/BanLists.cs index 8a393d5..de0e8af 100644 --- a/Server/BanLists.cs +++ b/Server/BanLists.cs @@ -154,6 +154,10 @@ public static class BanLists { Stages.Remove(stage); } + private static void UnbanGameMode(GameMode gameMode) { + GameModes.Remove((sbyte)gameMode); + } + private static void Save() { Settings.SaveSettings(true); @@ -387,6 +391,17 @@ public static class BanLists { } Save(); return "Unbanned stage: " + string.Join(", ", stages); + + case "gamemode": + if (!GameMode.TryParse(val, out GameMode gameMode)) { + return "Invalid gamemode value!"; + } + if (!IsGameModeBanned(gameMode)) { + return "Gamemode " + gameMode + " is not banned."; + } + UnbanGameMode(gameMode); + Save(); + return "Unbanned gamemode: " + gameMode; } } }