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:
parent
d4a1d32706
commit
5c5b37a81a
1 changed files with 15 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue