From 0cabf6f8a3dee4bccf4f30e29c03a84f5dbaf49e Mon Sep 17 00:00:00 2001 From: RaidMax Date: Sat, 16 May 2020 20:55:18 -0500 Subject: [PATCH] only fix double forward slash characters (instead of single) when sending messages retry kicks on banned players if they're banned from webfront, but don't actually get kicked because the game doesn't process the command (looking at you T6) allow capturing chat messages for names spoofed to an empty string make sure mostkills uses days not month for cutoff --- Application/EventParsers/BaseEventParser.cs | 2 +- Application/IW4MServer.cs | 3 ++- Plugins/Stats/Commands/MostKillsCommand.cs | 2 +- Plugins/Stats/Plugin.cs | 2 +- SharedLibraryCore/Utilities.cs | 9 ++------- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Application/EventParsers/BaseEventParser.cs b/Application/EventParsers/BaseEventParser.cs index d07ddd5bb..72144d572 100644 --- a/Application/EventParsers/BaseEventParser.cs +++ b/Application/EventParsers/BaseEventParser.cs @@ -23,7 +23,7 @@ namespace IW4MAdmin.Application.EventParsers GameDirectory = "main", }; - Configuration.Say.Pattern = @"^(say|sayteam);(-?[A-Fa-f0-9_]{1,32}|bot[0-9]+|0);([0-9]+);(.+);(.*)$"; + Configuration.Say.Pattern = @"^(say|sayteam);(-?[A-Fa-f0-9_]{1,32}|bot[0-9]+|0);([0-9]+);([^;]*);(.*)$"; Configuration.Say.AddMapping(ParserRegex.GroupType.EventType, 1); Configuration.Say.AddMapping(ParserRegex.GroupType.OriginNetworkId, 2); Configuration.Say.AddMapping(ParserRegex.GroupType.OriginClientNumber, 3); diff --git a/Application/IW4MServer.cs b/Application/IW4MServer.cs index 0d887b84d..e91542f92 100644 --- a/Application/IW4MServer.cs +++ b/Application/IW4MServer.cs @@ -667,7 +667,8 @@ namespace IW4MAdmin } } - else if (client.IPAddress != null && client.State == ClientState.Disconnecting) + else if ((client.IPAddress != null && client.State == ClientState.Disconnecting) || + client.Level == Permission.Banned) { Logger.WriteWarning($"{client} state is Unknown (probably kicked), but they are still connected. trying to kick again..."); await client.CanConnect(client.IPAddress); diff --git a/Plugins/Stats/Commands/MostKillsCommand.cs b/Plugins/Stats/Commands/MostKillsCommand.cs index 3c57c226a..f6dc99624 100644 --- a/Plugins/Stats/Commands/MostKillsCommand.cs +++ b/Plugins/Stats/Commands/MostKillsCommand.cs @@ -52,7 +52,7 @@ namespace IW4MAdmin.Plugins.Stats.Commands { using (var ctx = contextFactory.CreateContext(enableTracking: false)) { - var dayInPast = DateTime.UtcNow.AddMonths(-config.MostKillsMaxInactivityDays); + var dayInPast = DateTime.UtcNow.AddDays(-config.MostKillsMaxInactivityDays); var iqStats = (from stats in ctx.Set() join client in ctx.Clients diff --git a/Plugins/Stats/Plugin.cs b/Plugins/Stats/Plugin.cs index 2ac9d905b..452bcff8f 100644 --- a/Plugins/Stats/Plugin.cs +++ b/Plugins/Stats/Plugin.cs @@ -532,7 +532,7 @@ namespace IW4MAdmin.Plugins.Stats /// private bool ShouldIgnoreEvent(EFClient origin, EFClient target) { - return ((origin?.NetworkId == 1 && target?.NetworkId == 1)); + return ((origin?.NetworkId == Utilities.WORLD_ID && target?.NetworkId == Utilities.WORLD_ID)); } /// diff --git a/SharedLibraryCore/Utilities.cs b/SharedLibraryCore/Utilities.cs index b76460dbe..bb8dde88a 100644 --- a/SharedLibraryCore/Utilities.cs +++ b/SharedLibraryCore/Utilities.cs @@ -1,9 +1,4 @@ -#if DEBUG -using Microsoft.EntityFrameworkCore.Query; -using Microsoft.EntityFrameworkCore.Query.Internal; -using Microsoft.EntityFrameworkCore.Storage; -#endif -using SharedLibraryCore.Database.Models; +using SharedLibraryCore.Database.Models; using SharedLibraryCore.Helpers; using SharedLibraryCore.Interfaces; using System; @@ -172,7 +167,7 @@ namespace SharedLibraryCore /// /// /// - public static string FixIW4ForwardSlash(this string str) => str.Replace("/", " /"); + public static string FixIW4ForwardSlash(this string str) => str.Replace("//", "/ /"); private static readonly IList _zmGameTypes = new[] { "zclassic", "zstandard", "zcleansed", "zgrief" }; ///