From 421e90cf70e687a849b85e5839c758ee67e77073 Mon Sep 17 00:00:00 2001 From: RaidMax Date: Mon, 24 Jun 2019 18:32:14 -0500 Subject: [PATCH] fix old bug of auto unflag not working fix wrong thresholds on recoil --- Plugins/Stats/Cheat/Detection.cs | 4 ++-- Plugins/Stats/Helpers/StatManager.cs | 2 +- SharedLibraryCore/Services/PenaltyService.cs | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Plugins/Stats/Cheat/Detection.cs b/Plugins/Stats/Cheat/Detection.cs index ede9df77e..275b8a1aa 100644 --- a/Plugins/Stats/Cheat/Detection.cs +++ b/Plugins/Stats/Cheat/Detection.cs @@ -205,7 +205,7 @@ namespace IW4MAdmin.Plugins.Stats.Cheat var lifeTimeHits = ClientStats.HitLocations.Sum(_loc => _loc.HitCount); ClientStats.AverageRecoilOffset = (ClientStats.AverageRecoilOffset * (lifeTimeHits - 1) + hitRecoilAverage) / lifeTimeHits; - if (sessionAverageRecoilAmount == 0 && HitCount > Thresholds.MediumSampleMinKills) + if (sessionAverageRecoilAmount == 0 && HitCount > Thresholds.LowSampleMinKills) { results.Add(new DetectionPenaltyResult() { @@ -216,7 +216,7 @@ namespace IW4MAdmin.Plugins.Stats.Cheat }); } - if (ClientStats.AverageRecoilOffset == 0 && HitCount >= Thresholds.LowSampleMinKills) + if (ClientStats.AverageRecoilOffset == 0 && HitCount >= Thresholds.HighSampleMinKills) { results.Add(new DetectionPenaltyResult() { diff --git a/Plugins/Stats/Helpers/StatManager.cs b/Plugins/Stats/Helpers/StatManager.cs index 6fd38b8ba..9f6854cf2 100644 --- a/Plugins/Stats/Helpers/StatManager.cs +++ b/Plugins/Stats/Helpers/StatManager.cs @@ -569,7 +569,7 @@ namespace IW4MAdmin.Plugins.Stats.Helpers { DetectionPenaltyResult result = new DetectionPenaltyResult() { ClientPenalty = EFPenalty.PenaltyType.Any }; #if DEBUG - if (clientDetection.QueuedHits.Count > 0) + if (clientDetection.TrackedHits.Count > 0) #else if (clientDetection.TrackedHits.Count > Detection.MAX_TRACKED_HIT_COUNT) #endif diff --git a/SharedLibraryCore/Services/PenaltyService.cs b/SharedLibraryCore/Services/PenaltyService.cs index 965cdd0e4..0e57cded5 100644 --- a/SharedLibraryCore/Services/PenaltyService.cs +++ b/SharedLibraryCore/Services/PenaltyService.cs @@ -172,14 +172,14 @@ namespace SharedLibraryCore.Services { var now = DateTime.UtcNow; - Expression> filter = (p) => new EFPenalty.PenaltyType[] + Expression> filter = (p) => (new EFPenalty.PenaltyType[] { EFPenalty.PenaltyType.TempBan, - EFPenalty.PenaltyType.Ban, - EFPenalty.PenaltyType.Flag + EFPenalty.PenaltyType.Ban }.Contains(p.Type) && p.Active && - (p.Expires == null || p.Expires > now); + (p.Expires == null || p.Expires > now)) || + (p.Type ==EFPenalty.PenaltyType.Flag && p.Active); using (var context = new DatabaseContext(true)) {