Core/ClientConfig: Fixes chat window not showing chat, also not saving any config options when you select them, like auto loot, zoom, etc.

This commit is contained in:
hondacrx
2021-02-15 14:14:15 -05:00
parent 67210c06fa
commit ed7eff2abe
2 changed files with 14 additions and 7 deletions
+6 -4
View File
@@ -42,15 +42,17 @@ namespace Game
return; return;
AccountData adata = GetAccountData(request.DataType); AccountData adata = GetAccountData(request.DataType);
if (adata.Data == null)
return;
UpdateAccountData data = new UpdateAccountData(); UpdateAccountData data = new UpdateAccountData();
data.Player = GetPlayer() ? GetPlayer().GetGUID() : ObjectGuid.Empty; data.Player = GetPlayer() ? GetPlayer().GetGUID() : ObjectGuid.Empty;
data.Time = (uint)adata.Time; data.Time = (uint)adata.Time;
data.Size = (uint)adata.Data.Length;
data.DataType = request.DataType; 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); SendPacket(data);
} }
@@ -76,9 +76,14 @@ namespace Game.Networking.Packets
_worldPacket.WriteUInt32(Size); _worldPacket.WriteUInt32(Size);
_worldPacket.WriteBits(DataType, 3); _worldPacket.WriteBits(DataType, 3);
var bytes = CompressedData.GetData(); if (CompressedData == null)
_worldPacket.WriteInt32(bytes.Length); _worldPacket.WriteUInt32(0);
_worldPacket.WriteBytes(bytes); else
{
var bytes = CompressedData.GetData();
_worldPacket.WriteInt32(bytes.Length);
_worldPacket.WriteBytes(bytes);
}
} }
public ObjectGuid Player; public ObjectGuid Player;