Core/PacketIO: Updated packet structures to 9.2.0

Port From (https://github.com/TrinityCore/TrinityCore/commit/9f30afe3528441571f89cb2e1775c756774fa0cd)
This commit is contained in:
hondacrx
2022-05-09 23:14:38 -04:00
parent 1ca851db26
commit 0bbabbd667
32 changed files with 1309 additions and 1023 deletions
+20 -13
View File
@@ -33,24 +33,31 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.QueryPlayerName, Processing = PacketProcessing.Inplace)]
void HandleNameQueryRequest(QueryPlayerName queryPlayerName)
{
SendNameQuery(queryPlayerName.Player);
}
public void SendNameQuery(ObjectGuid guid)
{
Player player = Global.ObjAccessor.FindPlayer(guid);
QueryPlayerNameResponse response = new();
response.Player = guid;
if (response.Data.Initialize(guid, player))
response.Result = ResponseCodes.Success;
else
response.Result = ResponseCodes.Failure; // name unknown
foreach (ObjectGuid guid in queryPlayerName.Players)
{
BuildNameQueryData(guid, out NameCacheLookupResult nameCacheLookupResult);
response.Players.Add(nameCacheLookupResult);
}
SendPacket(response);
}
public void BuildNameQueryData(ObjectGuid guid, out NameCacheLookupResult lookupData)
{
lookupData = new();
Player player = Global.ObjAccessor.FindPlayer(guid);
lookupData.Player = guid;
lookupData.Data = new();
if (lookupData.Data.Initialize(guid, player))
lookupData.Result = (byte)ResponseCodes.Success;
else
lookupData.Result = (byte)ResponseCodes.Failure; // name unknown
}
[WorldPacketHandler(ClientOpcodes.QueryTime, Processing = PacketProcessing.Inplace)]
void HandleQueryTime(QueryTime packet)
{