1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-07 21:58:06 -05:00

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
This commit is contained in:
Edo 2023-05-02 03:40:12 +01:00 committed by GitHub
parent 7570749aa5
commit 210ffa5d83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}