From a319ae80e06ae99e955b25e3d5684eba09d12caa Mon Sep 17 00:00:00 2001 From: Gold KingZ <48490385+oqyh@users.noreply.github.com> Date: Wed, 1 May 2024 00:16:38 +0400 Subject: [PATCH] 1.0.8 --- Config/Configs.cs | 2 ++ Config/Helper.cs | 4 ++-- Kill-Sound-GoldKingZ.cs | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Config/Configs.cs b/Config/Configs.cs index 9ea75e6..074f692 100644 --- a/Config/Configs.cs +++ b/Config/Configs.cs @@ -112,6 +112,7 @@ public class ConfigData public bool KS_BodyHitSoundDefaultValue { get; set; } public string KS_InGameMenu { get; set; } public string KS_OnlyAllowTheseGroupsToToggle { get; set; } + public int KS_AutoRemovePlayerCookieOlderThanXDays { get; set; } public string empty3 { get; set; } public string Information_For_You_Dont_Delete_it { get; set; } @@ -137,6 +138,7 @@ public ConfigData() KS_BodyHitSoundDefaultValue = false; KS_InGameMenu = "!quake,!quakesounds,!soundmenu,!soundsmenu,!menusound,!menusounds,!soundsettings,!soundsetting"; KS_OnlyAllowTheseGroupsToToggle = ""; + KS_AutoRemovePlayerCookieOlderThanXDays = 7; empty3 = "-----------------------------------------------------------------------------------"; Information_For_You_Dont_Delete_it = " Vist [https://github.com/oqyh/cs2-Kill-Sound-GoldKingZ/tree/main?tab=readme-ov-file#-configuration-] To Understand All Above"; } diff --git a/Config/Helper.cs b/Config/Helper.cs index f421516..417a286 100644 --- a/Config/Helper.cs +++ b/Config/Helper.cs @@ -440,7 +440,7 @@ public static void SaveToJsonFile(ulong PlayerSteamID, bool freezemenu, bool hea } - allPersonsData.RemoveAll(p => (DateTime.Now - p.DateAndTime).TotalDays > 100); + allPersonsData.RemoveAll(p => (DateTime.Now - p.DateAndTime).TotalDays > Configs.GetConfigData().KS_AutoRemovePlayerCookieOlderThanXDays); @@ -474,7 +474,7 @@ public static PersonData RetrievePersonDataById(ulong targetId) PersonData targetPerson = allPersonsData.Find(p => p.PlayerSteamID == targetId)!; - if (targetPerson != null && (DateTime.Now - targetPerson.DateAndTime<= TimeSpan.FromDays(100))) + if (targetPerson != null && (DateTime.Now - targetPerson.DateAndTime<= TimeSpan.FromDays(Configs.GetConfigData().KS_AutoRemovePlayerCookieOlderThanXDays))) { return targetPerson; } diff --git a/Kill-Sound-GoldKingZ.cs b/Kill-Sound-GoldKingZ.cs index 7fb2e32..4319a99 100644 --- a/Kill-Sound-GoldKingZ.cs +++ b/Kill-Sound-GoldKingZ.cs @@ -17,7 +17,7 @@ namespace Kill_Sound_GoldKingZ; public class KillSoundGoldKingZ : BasePlugin { public override string ModuleName => "Kill Sound ( Kill , HeadShot , Quake )"; - public override string ModuleVersion => "1.0.7"; + public override string ModuleVersion => "1.0.8"; public override string ModuleAuthor => "Gold KingZ"; public override string ModuleDescription => "https://github.com/oqyh"; internal static IStringLocalizer? Stringlocalizer;