From c0721317e49541ebdb55346c6cb491cc34601680 Mon Sep 17 00:00:00 2001 From: Cj Date: Thu, 25 Jul 2024 21:58:35 +0000 Subject: [PATCH] Fix duplicate logging (!151) Fixes a duplicate set of logging requests sent to the server for no reason. Co-authored-by: Cj <161484149+CJ-SPT@users.noreply.github.com> Reviewed-on: https://dev.sp-tarkov.com/SPT/Modules/pulls/151 Co-authored-by: Cj Co-committed-by: Cj --- project/SPT.Core/Utils/ValidationUtil.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/project/SPT.Core/Utils/ValidationUtil.cs b/project/SPT.Core/Utils/ValidationUtil.cs index c5e0144..c94de1b 100644 --- a/project/SPT.Core/Utils/ValidationUtil.cs +++ b/project/SPT.Core/Utils/ValidationUtil.cs @@ -6,6 +6,8 @@ namespace SPT.Core.Utils { public static class ValidationUtil { + private static bool _hasRun = false; + public static bool Validate() { var c0 = @"Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\EscapeFromTarkov"; @@ -27,10 +29,14 @@ namespace SPT.Core.Utils new FileInfo(Path.Combine(v2, "UnityCrashHandler64.exe")) }; - ServerLog.Debug("SPT.Core", Gfs(v2, "UnityCrashHandler64.exe")?.Length.ToString() ?? "0"); - ServerLog.Debug("SPT.Core", Gfs(v2, "Uninstall.exe")?.Length.ToString() ?? "0"); - ServerLog.Debug("SPT.Core", Gfs(v2, "Register.bat")?.Length.ToString() ?? "0"); - + if (!_hasRun) + { + ServerLog.Debug("SPT.Core", Gfs(v2, "UnityCrashHandler64.exe")?.Length.ToString() ?? "0"); + ServerLog.Debug("SPT.Core", Gfs(v2, "Uninstall.exe")?.Length.ToString() ?? "0"); + ServerLog.Debug("SPT.Core", Gfs(v2, "Register.bat")?.Length.ToString() ?? "0"); + _hasRun = true; + } + v0 = v4.Length - 1; foreach (var value in v4)