From c41fc27a1ad4f4a2b43450681e9610fd2e8e4b75 Mon Sep 17 00:00:00 2001 From: RaidMax Date: Wed, 30 Sep 2020 21:00:40 -0500 Subject: [PATCH] fix introduced bug :) --- Plugins/Stats/Helpers/StatManager.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Plugins/Stats/Helpers/StatManager.cs b/Plugins/Stats/Helpers/StatManager.cs index c5b921bde..b5565e7ea 100644 --- a/Plugins/Stats/Helpers/StatManager.cs +++ b/Plugins/Stats/Helpers/StatManager.cs @@ -557,8 +557,8 @@ namespace IW4MAdmin.Plugins.Stats.Helpers if (oldestHit.IsAlive) { var result = DeterminePenaltyResult(clientDetection.ProcessHit(oldestHit), attacker); - - if (Utilities.IsDevelopment) + + if (!Utilities.IsDevelopment) { await ApplyPenalty(result, attacker); } @@ -622,13 +622,21 @@ namespace IW4MAdmin.Plugins.Stats.Helpers private bool ShouldUseDetection(Server server, DetectionType detectionType, long clientId) { - bool shouldRun = true; var detectionTypes = Plugin.Config.Configuration().AnticheatConfiguration.ServerDetectionTypes; var ignoredClients = Plugin.Config.Configuration().AnticheatConfiguration.IgnoredClientIds; + if (ignoredClients.Contains(clientId)) + { + return false; + } + + try { - shouldRun &= !detectionTypes[server.EndPoint].Contains(detectionType); + if (detectionTypes[server.EndPoint].Contains(detectionType)) + { + return false; + } } catch (KeyNotFoundException) @@ -636,8 +644,7 @@ namespace IW4MAdmin.Plugins.Stats.Helpers } - shouldRun &= !ignoredClients.Any(_clientId => _clientId == clientId); - return shouldRun; + return true; } async Task ApplyPenalty(DetectionPenaltyResult penalty, EFClient attacker)