diff --git a/README.md b/README.md index 314a856..fc0f4f5 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ Default configuration: "LogInsteadofKick": false, "Thresholds": { "MaxVACBans": 1, + "MinDaysSinceLastBan": -1, "MaxGameBans": 1, "MinSteamLevel": 2, "MaxAccountCreationTime": -1, @@ -67,6 +68,8 @@ Default configuration: * With this option being false, it will only do the hour-checks if he has the hours-played-information on public (recommended) * `LogInsteadofKick` (`true` or `false`) -- If true, will just log whether the player would pass the steamchecks, instead of actually kicking him on failure * `MaxVACBans` -- If `0`, will kick if the user has any VAC Ban. If `1`, will kick if the user has at least 2 VAC Bans, etc.. Use `-1` to disable check. +* `MinDaysSinceLastBan` -- Minimum Number of days since the last ban. Use `-1` to disable check. + * This option only makes sense, when `MaxVACBans` is greater than 0 or disabled with -1. * `MaxGameBans` -- If `0`, will kick if the user has any Game Ban. If `1`, will kick if the user has at least 2 Game Bans, etc.. Use `-1` to disable check. ###### Those options require a **public** steam profile: @@ -112,7 +115,7 @@ The checks are completly asynchronous. ## Issues If you encounter a bug, please create an GitHub issue. -Please include the output of `steamcheck ` and `steamcheck.runtests `, using the steamid on which the checks don't pass correctly. Also your configuration file would be helpful. +Please include the output of `steamcheck ` and `steamcheck.runtests `, using the steamid on which the checks don't pass correctly. If you have an error, also include the offending steamids. Also your configuration file would be helpful. ## Development diff --git a/SteamChecks.cs b/SteamChecks.cs index a9c0015..fcb497c 100644 --- a/SteamChecks.cs +++ b/SteamChecks.cs @@ -100,6 +100,10 @@ public class SteamChecks : CovalencePlugin /// private int maxVACBans; /// + /// How old the last VAC ban should minimally + /// + private int minDaysSinceLastBan; + /// /// Maximum amount of game bans, the user is allowed to have /// private int maxGameBans; @@ -155,6 +159,7 @@ protected override void LoadDefaultConfig() Config["Thresholds"] = new Dictionary { ["MaxVACBans"] = 1, + ["MinDaysSinceLastBan"] = -1, ["MaxGameBans"] = 1, ["MinSteamLevel"] = 2, ["MaxAccountCreationTime"] = -1, @@ -185,6 +190,7 @@ private void InitializeConfig() forceHoursPlayedKick = Config.Get("Kicking", "ForceHoursPlayedKick"); maxVACBans = Config.Get("Thresholds", "MaxVACBans"); + minDaysSinceLastBan = Config.Get("Thresholds", "MinDaysSinceLastBan"); maxGameBans = Config.Get("Thresholds", "MaxGameBans"); @@ -373,14 +379,18 @@ private void CheckPlayer(string steamid, Action callback) callback(false, Lang("KickTradeBan")); return; } - if (banResponse.GameBanCount > maxGameBans) + if (banResponse.GameBanCount > maxGameBans && maxGameBans > -1) { callback(false, Lang("KickGameBan")); return; } - // The Steam API returns two values, one is the count of VAC bans and one a boolean - // We will check both to be sure - if (banResponse.VacBanCount > maxVACBans || (banResponse.VacBan && maxVACBans == 0)) + + if (banResponse.VacBanCount > maxVACBans && maxVACBans > -1) + { + callback(false, Lang("KickVacBan")); + return; + } + if (banResponse.LastBan < minDaysSinceLastBan && minDaysSinceLastBan > 0) { callback(false, Lang("KickVacBan")); return;