From 64a8d6cb5dc559b3b5e6f3e4ae1221c0d5e330a6 Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Wed, 24 Jan 2024 17:17:45 -0800 Subject: [PATCH] fix: Fixes order of execution with AutoSave and TZ (#1665) --- Projects/Server/TimeZones/TimeZoneHandler.cs | 7 +++++-- Projects/UOContent/World Saves/AutoSave.cs | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Projects/Server/TimeZones/TimeZoneHandler.cs b/Projects/Server/TimeZones/TimeZoneHandler.cs index 6872deac4..5e56cddff 100644 --- a/Projects/Server/TimeZones/TimeZoneHandler.cs +++ b/Projects/Server/TimeZones/TimeZoneHandler.cs @@ -20,12 +20,15 @@ namespace Server; public static class TimeZoneHandler { - public static TimeZoneInfo SystemTimeZone { get; private set; } + public static TimeZoneInfo SystemTimeZone { get; private set; } = TimeZoneInfo.Local; public static void Configure() { var tzId = ServerConfiguration.GetSetting("system.localTimeZone", TimeZoneInfo.Local.Id); - SystemTimeZone = FindTimeZoneById(tzId); + if (tzId != SystemTimeZone.Id) + { + SystemTimeZone = FindTimeZoneById(tzId); + } } [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/Projects/UOContent/World Saves/AutoSave.cs b/Projects/UOContent/World Saves/AutoSave.cs index b76df8b2e..e737f0ed0 100644 --- a/Projects/UOContent/World Saves/AutoSave.cs +++ b/Projects/UOContent/World Saves/AutoSave.cs @@ -35,9 +35,9 @@ namespace Server.Saves public static void Configure() { - SavesEnabled = ServerConfiguration.GetOrUpdateSetting("autosave.enabled", true); Delay = ServerConfiguration.GetOrUpdateSetting("autosave.saveDelay", TimeSpan.FromMinutes(5.0)); Warning = ServerConfiguration.GetOrUpdateSetting("autosave.warningDelay", TimeSpan.Zero); + SavesEnabled = ServerConfiguration.GetOrUpdateSetting("autosave.enabled", true); } public static void ResetAutoSave(TimeSpan saveDelay, TimeSpan warningDelay)