From ed7eff2abe21dc4b626d49dacbc2baeade73ad76 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Mon, 15 Feb 2021 14:14:15 -0500 Subject: [PATCH] Core/ClientConfig: Fixes chat window not showing chat, also not saving any config options when you select them, like auto loot, zoom, etc. --- Source/Game/Handlers/MiscHandler.cs | 10 ++++++---- Source/Game/Networking/Packets/ClientConfigPackets.cs | 11 ++++++++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Source/Game/Handlers/MiscHandler.cs b/Source/Game/Handlers/MiscHandler.cs index 0cfa0abc1..7b7d2adb2 100644 --- a/Source/Game/Handlers/MiscHandler.cs +++ b/Source/Game/Handlers/MiscHandler.cs @@ -42,15 +42,17 @@ namespace Game return; AccountData adata = GetAccountData(request.DataType); - if (adata.Data == null) - return; UpdateAccountData data = new UpdateAccountData(); data.Player = GetPlayer() ? GetPlayer().GetGUID() : ObjectGuid.Empty; data.Time = (uint)adata.Time; - data.Size = (uint)adata.Data.Length; data.DataType = request.DataType; - data.CompressedData = new ByteBuffer(ZLib.Compress(Encoding.UTF8.GetBytes(adata.Data))); + + if (!adata.Data.IsEmpty()) + { + data.Size = (uint)adata.Data.Length; + data.CompressedData = new ByteBuffer(ZLib.Compress(Encoding.UTF8.GetBytes(adata.Data))); + } SendPacket(data); } diff --git a/Source/Game/Networking/Packets/ClientConfigPackets.cs b/Source/Game/Networking/Packets/ClientConfigPackets.cs index ef35b638d..2a5be7453 100644 --- a/Source/Game/Networking/Packets/ClientConfigPackets.cs +++ b/Source/Game/Networking/Packets/ClientConfigPackets.cs @@ -76,9 +76,14 @@ namespace Game.Networking.Packets _worldPacket.WriteUInt32(Size); _worldPacket.WriteBits(DataType, 3); - var bytes = CompressedData.GetData(); - _worldPacket.WriteInt32(bytes.Length); - _worldPacket.WriteBytes(bytes); + if (CompressedData == null) + _worldPacket.WriteUInt32(0); + else + { + var bytes = CompressedData.GetData(); + _worldPacket.WriteInt32(bytes.Length); + _worldPacket.WriteBytes(bytes); + } } public ObjectGuid Player;