From 80d12a5d581e07e2a5d2ca7f8cc202046090178b Mon Sep 17 00:00:00 2001 From: hondacrx Date: Thu, 4 Mar 2021 14:16:07 -0500 Subject: [PATCH] Core/PacketIO: Use hotfix status enum instead of magic numbers in SMSG_DB_REPLY Port From (https://github.com/TrinityCore/TrinityCore/commit/68bdf1c8309c612257679d63c97e8dc62467dbb5) --- Source/Game/Handlers/HotfixHandler.cs | 2 +- Source/Game/Networking/Packets/HotfixPackets.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Game/Handlers/HotfixHandler.cs b/Source/Game/Handlers/HotfixHandler.cs index 506efe30f..dc5ae4c73 100644 --- a/Source/Game/Handlers/HotfixHandler.cs +++ b/Source/Game/Handlers/HotfixHandler.cs @@ -38,7 +38,7 @@ namespace Game if (store != null && store.HasRecord(record.RecordID)) { - dbReply.Status = 1; + dbReply.Status = HotfixRecord.Status.Valid; dbReply.Timestamp = (uint)GameTime.GetGameTime(); store.WriteRecord(record.RecordID, GetSessionDbcLocale(), dbReply.Data); diff --git a/Source/Game/Networking/Packets/HotfixPackets.cs b/Source/Game/Networking/Packets/HotfixPackets.cs index 8e891e9a4..07fdcde68 100644 --- a/Source/Game/Networking/Packets/HotfixPackets.cs +++ b/Source/Game/Networking/Packets/HotfixPackets.cs @@ -63,7 +63,7 @@ namespace Game.Networking.Packets _worldPacket.WriteUInt32(TableHash); _worldPacket.WriteUInt32(RecordID); _worldPacket.WriteUInt32(Timestamp); - _worldPacket.WriteBits(Status, 2); + _worldPacket.WriteBits((byte)Status, 2); _worldPacket.WriteUInt32(Data.GetSize()); _worldPacket.WriteBytes(Data.GetData()); } @@ -71,7 +71,7 @@ namespace Game.Networking.Packets public uint TableHash; public uint Timestamp; public uint RecordID; - public byte Status = 3; + public HotfixRecord.Status Status = HotfixRecord.Status.Invalid; public ByteBuffer Data = new ByteBuffer(); }