Moderation Commands #1

Merged
Moonbase merged 6 commits from moderation-commands into main 2025-03-07 18:15:42 -08:00
2 changed files with 6 additions and 2 deletions
Showing only changes of commit 1edbbde74c - Show all commits

View File

@ -12,9 +12,13 @@ class BanCommand : IManagementCommand
{
if(arguments.Length < 2) { client.Send(Utils.BuildServerSideMessage($"Expected 3 Args, Got {arguments.Length + 1}", "Server")); return; }
if (arguments[0] == "help") client.Send(Utils.BuildServerSideMessage($"::ban - This bans a user who is in-room. First argument is the id of the user in-room. Room user lists start at 0.", "Server"));
var clientToBan = client.Room!.Clients.ToArray()[int.Parse(arguments[0])].PlayerData.Uid;
if (clientToBan == null) { client.Send(Utils.BuildServerSideMessage($"User Could Not Be Found", "Server")); return; }
// send an http request to the api set in appsettings
ApiWebService apiWebService = new();
var response = apiWebService.BanUser(client, arguments[0], arguments[1], arguments[2]);
var response = apiWebService.BanUser(client, clientToBan, arguments[1], arguments[2]);
var responseString = response.Content.ReadAsStringAsync().Result;
if (response.StatusCode != System.Net.HttpStatusCode.OK && responseString != null) { client.Send(Utils.BuildServerSideMessage(responseString, "Server")); return; }

View File

@ -63,7 +63,7 @@
"// Authentication Required": "authentication is required to connect to mmo",
"Authentication": "Required",
"// ApiUrl": "SoDOff API server URL for authentication calls",
"// ApiUrl": "SoDOff API server URL for authentication calls and other calls",
"ApiUrl": "http://localhost:5000",
"// BypassToken": "Token allowed to connect without authentication",