From ed3f9f750f4970fa59ccfb9b00b31534ba4498d9 Mon Sep 17 00:00:00 2001 From: Sword <62721069+SwordSWD@users.noreply.github.com> Date: Sat, 22 Apr 2023 21:17:20 -0400 Subject: [PATCH 1/2] fixed spelling mistake with Moon (#294) --- Application/DefaultSettings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/DefaultSettings.json b/Application/DefaultSettings.json index b26074fba..7a6cc131c 100644 --- a/Application/DefaultSettings.json +++ b/Application/DefaultSettings.json @@ -1715,7 +1715,7 @@ "Name": "zm_theater" }, { - "Alias": "Moom", + "Alias": "Moon", "Name": "zm_moon" }, { From 6ae15261c9337fbab418610ca7c8aeb6781ed8dc Mon Sep 17 00:00:00 2001 From: Edo Date: Tue, 2 May 2023 03:40:12 +0100 Subject: [PATCH 2/2] BaseEvent: Deal with all sorts of special characters sent by the engine (#298) * BaseEvent: Deal with all sorts of special characters sent by the engine --- Application/EventParsers/BaseEventParser.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Application/EventParsers/BaseEventParser.cs b/Application/EventParsers/BaseEventParser.cs index 6eade2c12..90e84e519 100644 --- a/Application/EventParsers/BaseEventParser.cs +++ b/Application/EventParsers/BaseEventParser.cs @@ -578,11 +578,15 @@ namespace IW4MAdmin.Application.EventParsers return null; } - var message = matchResult.Values[Configuration.Say.GroupMapping[ParserRegex.GroupType.Message]] - .Replace(Configuration.LocalizeText, "") - .Trim(); + var message = new string(matchResult.Values[Configuration.Say.GroupMapping[ParserRegex.GroupType.Message]] + .Where(c => !char.IsControl(c)).ToArray()); - if (message.Length <= 0) + if (message.StartsWith("/")) + { + message = message[1..]; + } + + if (String.IsNullOrEmpty(message)) { return null; }