From 4935ec3187444af7dcf1865cc584616cbca94f0e Mon Sep 17 00:00:00 2001 From: Archi Date: Thu, 2 Sep 2021 13:45:56 +0200 Subject: [PATCH] Remove support for SystemEvents.TimeChanged This causes excessive delay during ASF shutdown on Windows, and because it's completely optional for irrelevant feature, it's not worth the burden --- ArchiSteamFarm/ArchiSteamFarm.csproj | 1 - ArchiSteamFarm/Core/AprilFools.cs | 8 -------- ArchiSteamFarm/Program.cs | 12 ------------ Directory.Packages.props | 1 - 4 files changed, 22 deletions(-) diff --git a/ArchiSteamFarm/ArchiSteamFarm.csproj b/ArchiSteamFarm/ArchiSteamFarm.csproj index b9a1e733d..1230ebe2b 100644 --- a/ArchiSteamFarm/ArchiSteamFarm.csproj +++ b/ArchiSteamFarm/ArchiSteamFarm.csproj @@ -25,7 +25,6 @@ - diff --git a/ArchiSteamFarm/Core/AprilFools.cs b/ArchiSteamFarm/Core/AprilFools.cs index 8ae697cd3..18a666dcd 100644 --- a/ArchiSteamFarm/Core/AprilFools.cs +++ b/ArchiSteamFarm/Core/AprilFools.cs @@ -73,13 +73,5 @@ namespace ArchiSteamFarm.Core { Timer.Change(dueTime, Timeout.Infinite); } } - -#if TARGET_GENERIC || TARGET_WINDOWS - internal static void OnTimeChanged(object? sender, EventArgs e) { - lock (LockObject) { - Timer.Change(TimeSpan.Zero, Timeout.InfiniteTimeSpan); - } - } -#endif } } diff --git a/ArchiSteamFarm/Program.cs b/ArchiSteamFarm/Program.cs index b9c703916..d8ba1a1b2 100644 --- a/ArchiSteamFarm/Program.cs +++ b/ArchiSteamFarm/Program.cs @@ -19,12 +19,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if NETFRAMEWORK -using OperatingSystem = JustArchiNET.Madness.OperatingSystemMadness.OperatingSystem; -#endif -#if TARGET_GENERIC || TARGET_WINDOWS -using Microsoft.Win32; -#endif using System; using System.Collections; using System.Collections.Generic; @@ -275,12 +269,6 @@ namespace ArchiSteamFarm { } else { // April Fools easter egg logic AprilFools.Init(); - -#if TARGET_GENERIC || TARGET_WINDOWS - if (OperatingSystem.IsWindows()) { - SystemEvents.TimeChanged += AprilFools.OnTimeChanged; - } -#endif } if (!string.IsNullOrEmpty(latestJson)) { diff --git a/Directory.Packages.props b/Directory.Packages.props index f8dafd04d..a20ef87ce 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,6 @@ -