From b888b1b09f71a8b8b4a9d45c804a1f164fb65ac3 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 21 Nov 2023 12:25:22 +0100 Subject: Core/Calendar: Implement different timezone support for ingame calendar Closes #8390 Closes #29427 --- src/server/game/Handlers/AuthHandler.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/server/game/Handlers/AuthHandler.cpp') diff --git a/src/server/game/Handlers/AuthHandler.cpp b/src/server/game/Handlers/AuthHandler.cpp index 7be557d368b..13db0718450 100644 --- a/src/server/game/Handlers/AuthHandler.cpp +++ b/src/server/game/Handlers/AuthHandler.cpp @@ -26,6 +26,7 @@ #include "RBAC.h" #include "Realm.h" #include "SystemPackets.h" +#include "Timezone.h" #include "World.h" void WorldSession::SendAuthResponse(uint32 code, bool queued, uint32 queuePos) @@ -89,12 +90,14 @@ void WorldSession::SendClientCacheVersion(uint32 version) void WorldSession::SendSetTimeZoneInformation() { - /// @todo: replace dummy values - WorldPackets::System::SetTimeZoneInformation packet; - packet.ServerTimeTZ = "Europe/Paris"; - packet.GameTimeTZ = "Europe/Paris"; - packet.ServerRegionalTZ = "Europe/Paris"; + Minutes timezoneOffset = Trinity::Timezone::GetSystemZoneOffset(false); + std::string realTimezone = Trinity::Timezone::GetSystemZoneName(); + std::string_view clientSupportedTZ = Trinity::Timezone::FindClosestClientSupportedTimezone(realTimezone, timezoneOffset); + WorldPackets::System::SetTimeZoneInformation packet; + packet.ServerTimeTZ = clientSupportedTZ; + packet.GameTimeTZ = clientSupportedTZ; + packet.ServerRegionalTZ = clientSupportedTZ; SendPacket(packet.Write()); } -- cgit v1.2.3