From 672d45df7ca121b6b3e6dc7d1c623e78dc5a4e29 Mon Sep 17 00:00:00 2001 From: RaidMax Date: Sun, 2 Sep 2018 22:09:25 -0500 Subject: [PATCH] fix for issue #45 and #37 --- Application/Server.cs | 19 ++++++++++--------- Plugins/Stats/Cheat/Detection.cs | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Application/Server.cs b/Application/Server.cs index 6cef9920..7acb26af 100644 --- a/Application/Server.cs +++ b/Application/Server.cs @@ -209,16 +209,8 @@ namespace IW4MAdmin var autoKickClient = (await Manager.GetClientService().Get(1)).AsPlayer(); autoKickClient.CurrentServer = this; - if (currentBan.Type == Penalty.PenaltyType.TempBan) - { - string formattedKick = String.Format( - RconParser.GetCommandPrefixes().Kick, - polledPlayer.ClientNumber, - $"{loc["SERVER_TB_REMAIN"]} ({(currentBan.Expires - DateTime.UtcNow).TimeSpanText()} {loc["WEBFRONT_PENALTY_TEMPLATE_REMAINING"]})"); - await this.ExecuteCommandAsync(formattedKick); - } // the player is permanently banned - else + if (currentBan.Type == Penalty.PenaltyType.Ban) { // don't store the kick message string formattedKick = String.Format( @@ -228,6 +220,15 @@ namespace IW4MAdmin await this.ExecuteCommandAsync(formattedKick); } + else + { + string formattedKick = String.Format( + RconParser.GetCommandPrefixes().Kick, + polledPlayer.ClientNumber, + $"{loc["SERVER_TB_REMAIN"]} ({(currentBan.Expires - DateTime.UtcNow).TimeSpanText()} {loc["WEBFRONT_PENALTY_TEMPLATE_REMAINING"]})"); + await this.ExecuteCommandAsync(formattedKick); + } + // reban the "evading" guid if (player.Level != Player.Permission.Banned && currentBan.Type == Penalty.PenaltyType.Ban) await player.Ban($"{currentBan.Offense}", autoKickClient); diff --git a/Plugins/Stats/Cheat/Detection.cs b/Plugins/Stats/Cheat/Detection.cs index d359479c..5f8f9f81 100644 --- a/Plugins/Stats/Cheat/Detection.cs +++ b/Plugins/Stats/Cheat/Detection.cs @@ -194,7 +194,7 @@ namespace IW4MAdmin.Plugins.Stats.Cheat if (currentHeadshotRatio > maxHeadshotLerpValueForFlag) { // ban on headshot - if (currentHeadshotRatio > maxHeadshotLerpValueForFlag) + if (currentHeadshotRatio > maxHeadshotLerpValueForBan) { Log.WriteDebug("**Maximum Headshot Ratio Reached For Ban**"); Log.WriteDebug($"ClientId: {kill.AttackerId}");