0
0
Fork 0
mirror of https://github.com/Sanae6/SmoOnlineServer.git synced 2024-11-22 03:05:16 +00:00

[ban] new: add command unban gamemode

This commit is contained in:
Robin C. Ladiges 2024-10-20 09:37:49 +02:00
parent d4a1d32706
commit 5c5b37a81a
No known key found for this signature in database
GPG key ID: B494D3DF92661B99

View file

@ -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;
}
}
}