Skip to content

Commit

Permalink
[ban] new: add command unban gamemode
Browse files Browse the repository at this point in the history
  • Loading branch information
Istador committed Oct 20, 2024
1 parent d4a1d32 commit 5c5b37a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Server/BanLists.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ private static void UnbanStage(string stage) {
Stages.Remove(stage);
}

private static void UnbanGameMode(GameMode gameMode) {
GameModes.Remove((sbyte)gameMode);
}


private static void Save() {
Settings.SaveSettings(true);
Expand Down Expand Up @@ -387,6 +391,17 @@ public static string HandleUnbanCommand(string[] args) {
}
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;
}
}
}

0 comments on commit 5c5b37a

Please sign in to comment.