Core/DataStores: Updated hotfix packet structures to 9.1.5
Port From (https://github.com/TrinityCore/TrinityCore/commit/78e627e413cb4ff34402fbb2e7a4668d434cd226)
This commit is contained in:
@@ -663,7 +663,7 @@ namespace Game.DataStorage
|
|||||||
{
|
{
|
||||||
uint oldMSTime = Time.GetMSTime();
|
uint oldMSTime = Time.GetMSTime();
|
||||||
|
|
||||||
SQLResult result = DB.Hotfix.Query("SELECT Id, TableHash, RecordId, Status FROM hotfix_data ORDER BY Id");
|
SQLResult result = DB.Hotfix.Query("SELECT Id, UniqueId, TableHash, RecordId, Status FROM hotfix_data ORDER BY Id");
|
||||||
if (result.IsEmpty())
|
if (result.IsEmpty())
|
||||||
{
|
{
|
||||||
Log.outInfo(LogFilter.ServerLoading, "Loaded 0 hotfix info entries.");
|
Log.outInfo(LogFilter.ServerLoading, "Loaded 0 hotfix info entries.");
|
||||||
@@ -676,9 +676,10 @@ namespace Game.DataStorage
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
int id = result.Read<int>(0);
|
int id = result.Read<int>(0);
|
||||||
uint tableHash = result.Read<uint>(1);
|
uint uniqueId = result.Read<uint>(1);
|
||||||
int recordId = result.Read<int>(2);
|
uint tableHash = result.Read<uint>(2);
|
||||||
HotfixRecord.Status status = (HotfixRecord.Status)result.Read<byte>(3);
|
int recordId = result.Read<int>(3);
|
||||||
|
HotfixRecord.Status status = (HotfixRecord.Status)result.Read<byte>(4);
|
||||||
if (status == HotfixRecord.Status.Valid && !_storage.ContainsKey(tableHash))
|
if (status == HotfixRecord.Status.Valid && !_storage.ContainsKey(tableHash))
|
||||||
{
|
{
|
||||||
if (!_hotfixBlob.Any(p => p.ContainsKey((tableHash, recordId))))
|
if (!_hotfixBlob.Any(p => p.ContainsKey((tableHash, recordId))))
|
||||||
@@ -691,7 +692,8 @@ namespace Game.DataStorage
|
|||||||
HotfixRecord hotfixRecord = new();
|
HotfixRecord hotfixRecord = new();
|
||||||
hotfixRecord.TableHash = tableHash;
|
hotfixRecord.TableHash = tableHash;
|
||||||
hotfixRecord.RecordID = recordId;
|
hotfixRecord.RecordID = recordId;
|
||||||
hotfixRecord.HotfixID = id;
|
hotfixRecord.ID.PushID = id;
|
||||||
|
hotfixRecord.ID.UniqueID = uniqueId;
|
||||||
hotfixRecord.HotfixStatus = status;
|
hotfixRecord.HotfixStatus = status;
|
||||||
_hotfixData.Add(id, hotfixRecord);
|
_hotfixData.Add(id, hotfixRecord);
|
||||||
deletedRecords[(tableHash, recordId)] = status == HotfixRecord.Status.RecordRemoved;
|
deletedRecords[(tableHash, recordId)] = status == HotfixRecord.Status.RecordRemoved;
|
||||||
@@ -2586,21 +2588,21 @@ namespace Game.DataStorage
|
|||||||
{
|
{
|
||||||
public uint TableHash;
|
public uint TableHash;
|
||||||
public int RecordID;
|
public int RecordID;
|
||||||
public int HotfixID;
|
public HotfixId ID;
|
||||||
public Status HotfixStatus = Status.Invalid;
|
public Status HotfixStatus = Status.Invalid;
|
||||||
|
|
||||||
public void Write(WorldPacket data)
|
public void Write(WorldPacket data)
|
||||||
{
|
{
|
||||||
|
ID.Write(data);
|
||||||
data.WriteUInt32(TableHash);
|
data.WriteUInt32(TableHash);
|
||||||
data.WriteInt32(RecordID);
|
data.WriteInt32(RecordID);
|
||||||
data.WriteInt32(HotfixID);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Read(WorldPacket data)
|
public void Read(WorldPacket data)
|
||||||
{
|
{
|
||||||
|
ID.Read(data);
|
||||||
TableHash = data.ReadUInt32();
|
TableHash = data.ReadUInt32();
|
||||||
RecordID = data.ReadInt32();
|
RecordID = data.ReadInt32();
|
||||||
HotfixID = data.ReadInt32();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum Status
|
public enum Status
|
||||||
@@ -2613,6 +2615,24 @@ namespace Game.DataStorage
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public struct HotfixId
|
||||||
|
{
|
||||||
|
public int PushID;
|
||||||
|
public uint UniqueID;
|
||||||
|
|
||||||
|
public void Write(WorldPacket data)
|
||||||
|
{
|
||||||
|
data.WriteInt32(PushID);
|
||||||
|
data.WriteUInt32(UniqueID);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Read(WorldPacket data)
|
||||||
|
{
|
||||||
|
PushID = data.ReadInt32();
|
||||||
|
UniqueID = data.ReadUInt32();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public class HotfixOptionalData
|
public class HotfixOptionalData
|
||||||
{
|
{
|
||||||
public uint Key;
|
public uint Key;
|
||||||
|
|||||||
@@ -89,8 +89,8 @@ namespace Game.Networking.Packets
|
|||||||
_worldPacket.WriteUInt32(VirtualRealmAddress);
|
_worldPacket.WriteUInt32(VirtualRealmAddress);
|
||||||
_worldPacket.WriteInt32(Hotfixes.Keys.Count);
|
_worldPacket.WriteInt32(Hotfixes.Keys.Count);
|
||||||
|
|
||||||
foreach (var key in Hotfixes.Keys)
|
foreach (var record in Hotfixes.Values)
|
||||||
_worldPacket.WriteInt32(key);
|
record.ID.Write(_worldPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
public uint VirtualRealmAddress;
|
public uint VirtualRealmAddress;
|
||||||
|
|||||||
Reference in New Issue
Block a user