From 093b9919b7c249a62a907d0a7510e151270e19b7 Mon Sep 17 00:00:00 2001 From: RaidMax Date: Sat, 24 Aug 2019 14:06:23 -0500 Subject: [PATCH] another fix because I'm retarded bump version up --- Application/Application.csproj | 6 +++--- Application/IO/GameLogEventDetection.cs | 2 ++ Plugins/Stats/Helpers/StatManager.cs | 10 ++++++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Application/Application.csproj b/Application/Application.csproj index d2d3f06e..e172bbf8 100644 --- a/Application/Application.csproj +++ b/Application/Application.csproj @@ -6,7 +6,7 @@ 2.2.2 false RaidMax.IW4MAdmin.Application - 2.2.8.1 + 2.2.8.2 RaidMax Forever None IW4MAdmin @@ -33,8 +33,8 @@ false true true - 2.2.8.1 - 2.2.8.1 + 2.2.8.2 + 2.2.8.2 7.1 diff --git a/Application/IO/GameLogEventDetection.cs b/Application/IO/GameLogEventDetection.cs index 70c14df8..3b89ccfb 100644 --- a/Application/IO/GameLogEventDetection.cs +++ b/Application/IO/GameLogEventDetection.cs @@ -48,6 +48,8 @@ namespace IW4MAdmin.Application.IO await Task.Delay(_reader.UpdateInterval, _server.Manager.CancellationToken); } + + _server.Logger.WriteDebug("Stopped polling for changes"); } private async Task UpdateLogEvents() diff --git a/Plugins/Stats/Helpers/StatManager.cs b/Plugins/Stats/Helpers/StatManager.cs index bba171c1..f27269a9 100644 --- a/Plugins/Stats/Helpers/StatManager.cs +++ b/Plugins/Stats/Helpers/StatManager.cs @@ -564,11 +564,12 @@ namespace IW4MAdmin.Plugins.Stats.Helpers { if (Plugin.Config.Configuration().StoreClientKills) { + OnProcessingPenalty.Wait(); _hitCache.Add(hit); if (_hitCache.Count > Detection.MAX_TRACKED_HIT_COUNT) { - OnProcessingPenalty.Wait(); + using (var ctx = new DatabaseContext()) { ctx.AddRange(_hitCache); @@ -576,8 +577,8 @@ namespace IW4MAdmin.Plugins.Stats.Helpers } _hitCache.Clear(); - OnProcessingPenalty.Release(); } + OnProcessingPenalty.Release(1); } @@ -630,6 +631,11 @@ namespace IW4MAdmin.Plugins.Stats.Helpers { _log.WriteError("Could not save hit or AC info"); _log.WriteDebug(ex.GetExceptionInfo()); + + if (OnProcessingPenalty.CurrentCount == 0) + { + OnProcessingPenalty.Release(); + } } }