Core/Calendar: Implement different timezone support for ingame calendar
Port From (https://github.com/TrinityCore/TrinityCore/commit/b888b1b09f71a8b8b4a9d45c804a1f164fb65ac3)
This commit is contained in:
@@ -4,11 +4,13 @@
|
||||
using Bgs.Protocol;
|
||||
using Bgs.Protocol.Authentication.V1;
|
||||
using Bgs.Protocol.Challenge.V1;
|
||||
using Framework;
|
||||
using Framework.Constants;
|
||||
using Framework.Database;
|
||||
using Framework.Realm;
|
||||
using Google.Protobuf;
|
||||
using System;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace BNetServer.Networking
|
||||
{
|
||||
@@ -39,6 +41,20 @@ namespace BNetServer.Networking
|
||||
os = logonRequest.Platform;
|
||||
build = (uint)logonRequest.ApplicationVersion;
|
||||
|
||||
_timezoneOffset = TimeSpan.Zero;
|
||||
if (logonRequest.HasDeviceId)
|
||||
{
|
||||
var doc = JsonSerializer.Deserialize<JsonDocument>(logonRequest.DeviceId);
|
||||
if (doc != null)
|
||||
{
|
||||
var itr = doc.RootElement.GetProperty("UTCO");
|
||||
{
|
||||
if (itr.TryGetUInt32(out uint value))
|
||||
_timezoneOffset = Timezone.GetOffsetByHash(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ChallengeExternalRequest externalChallenge = new();
|
||||
externalChallenge.PayloadType = "web_auth_url";
|
||||
externalChallenge.Payload = ByteString.CopyFromUtf8($"https://{Global.LoginService.GetHostnameForClient(GetRemoteIpAddress())}:{Global.LoginService.GetPort()}/bnetserver/login/");
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
// 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 BNetServer.Networking;
|
||||
using Framework.Configuration;
|
||||
using Framework.Cryptography;
|
||||
using Framework.Database;
|
||||
using Framework.Networking;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Timers;
|
||||
|
||||
Reference in New Issue
Block a user