mirror of
https://github.com/Sanae6/SmoOnlineServer.git
synced 2024-11-16 08:35:07 +00:00
add command: ban profile <profile-id>
To add a profile ID to the ban list.
This commit is contained in:
parent
5dcb85eb68
commit
2f2c1fd4f7
1 changed files with 17 additions and 2 deletions
|
@ -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 <profile-id>";
|
||||
}
|
||||
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 <ipv4-address>";
|
||||
|
|
Loading…
Reference in a new issue