Core/Calendar: Implement different timezone support for ingame calendar

Port From (https://github.com/TrinityCore/TrinityCore/commit/b888b1b09f71a8b8b4a9d45c804a1f164fb65ac3)
This commit is contained in:
hondacrx
2024-02-21 16:36:19 -05:00
parent 47a64b8782
commit 0f4130704a
25 changed files with 831 additions and 322 deletions
+21 -1
View File
@@ -1,4 +1,8 @@
using System;
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
using Framework;
using System;
public class GameTime
{
@@ -12,6 +16,9 @@ public class GameTime
static DateTime _dateTime;
static WowTime UtcWow;
static WowTime Wow;
public static long GetStartTime()
{
return StartTime;
@@ -47,6 +54,16 @@ public class GameTime
return _dateTime;
}
public static WowTime GetUtcWowTime()
{
return UtcWow;
}
public static WowTime GetWowTime()
{
return Wow;
}
public static void UpdateGameTimers()
{
_gameTime = Time.UnixTime;
@@ -55,5 +72,8 @@ public class GameTime
_gameTimeSteadyPoint = DateTime.Now;
_dateTime = Time.UnixTimeToDateTime(_gameTime);
UtcWow.SetUtcTimeFromUnixTime(_gameTime);
Wow = UtcWow + Timezone.GetSystemZoneOffsetAt(_gameTimeSystemPoint);
}
}