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
@@ -1,8 +1,10 @@
// 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 Framework.Constants;
using Game.Networking.Packets;
using System;
namespace Game
{
@@ -68,11 +70,14 @@ namespace Game
public void SendSetTimeZoneInformation()
{
// @todo: replace dummy values
TimeSpan timezoneOffset = Timezone.GetSystemZoneOffset();
string realTimezone = Timezone.GetSystemZoneName();
string clientSupportedTZ = Timezone.FindClosestClientSupportedTimezone(realTimezone, timezoneOffset);
SetTimeZoneInformation packet = new();
packet.ServerTimeTZ = "Europe/Paris";
packet.GameTimeTZ = "Europe/Paris";
packet.ServerRegionalTZ = "Europe/Paris";
packet.ServerTimeTZ = clientSupportedTZ;
packet.GameTimeTZ = clientSupportedTZ;
packet.ServerRegionalTZ = clientSupportedTZ;
SendPacket(packet);//enabled it
}