Core/Calendar: Implement different timezone support for ingame calendar
Port From (https://github.com/TrinityCore/TrinityCore/commit/b888b1b09f71a8b8b4a9d45c804a1f164fb65ac3)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user