From 9d6770aa2003cc950cc546ca2e055e0d055215d8 Mon Sep 17 00:00:00 2001 From: EnefFlow Date: Tue, 20 Feb 2024 16:11:09 +0300 Subject: [PATCH] fix: added severity to bot ban command --- .../_White/PandaSocket/Commands/PandaBanCommand.cs | 8 +++++++- .../_White/PandaSocket/Main/PandaCommunication.cs | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Content.Server/_White/PandaSocket/Commands/PandaBanCommand.cs b/Content.Server/_White/PandaSocket/Commands/PandaBanCommand.cs index ddbda4080f..92e4d7e091 100644 --- a/Content.Server/_White/PandaSocket/Commands/PandaBanCommand.cs +++ b/Content.Server/_White/PandaSocket/Commands/PandaBanCommand.cs @@ -46,6 +46,12 @@ public sealed class PandaBanCommand : IPandaCommand var minutes = (uint) message.Duration!; var isGlobalBan = (bool) message.Global!; + if (Enum.TryParse(message.Severity!, ignoreCase: true, out NoteSeverity severity)) + { + UtkaSendResponse(context, false); + return; + } + var located = await locator.LookupIdByNameOrIdAsync(target); if (located == null) { @@ -101,7 +107,7 @@ public sealed class PandaBanCommand : IPandaCommand roundId, playtime, reason, - NoteSeverity.High, + severity, player, null, serverName); diff --git a/Content.Server/_White/PandaSocket/Main/PandaCommunication.cs b/Content.Server/_White/PandaSocket/Main/PandaCommunication.cs index 344bb0b9ae..b92c699249 100644 --- a/Content.Server/_White/PandaSocket/Main/PandaCommunication.cs +++ b/Content.Server/_White/PandaSocket/Main/PandaCommunication.cs @@ -141,6 +141,9 @@ public sealed class UtkaBanRequest : PandaBaseRequestEventMessage [JsonPropertyName("global")] public bool? Global { get; set; } + + [JsonPropertyName("severity")] + public string? Severity { get; set; } } public sealed class UtkaBanResponse : PandaBaseMessage