Core/PacketIO: Update some files

Port From (https://github.com/TrinityCore/TrinityCore/commit/76352cb391b4ff239ef70ff85ede4f09fcffc069)
This commit is contained in:
Hondacrx
2025-06-15 20:24:24 -04:00
parent 56e3f80366
commit f105edae7c
9 changed files with 43 additions and 37 deletions
@@ -512,18 +512,18 @@ namespace Game.Networking.Packets
class AuctionHelloResponse : ServerPacket
{
public ObjectGuid Guid;
public uint PurchasedItemDeliveryDelay;
public uint CancelledItemDeliveryDelay;
public ObjectGuid Auctioneer;
public uint PurchaseDeliveryDelay;
public uint CancelDeliveryDelay;
public bool OpenForBusiness = true;
public AuctionHelloResponse() : base(ServerOpcodes.AuctionHelloResponse) { }
public override void Write()
{
_worldPacket.WritePackedGuid(Guid);
_worldPacket.WriteUInt32(PurchasedItemDeliveryDelay);
_worldPacket.WriteUInt32(CancelledItemDeliveryDelay);
_worldPacket.WritePackedGuid(Auctioneer);
_worldPacket.WriteUInt32(PurchaseDeliveryDelay);
_worldPacket.WriteUInt32(CancelDeliveryDelay);
_worldPacket.WriteBit(OpenForBusiness);
_worldPacket.FlushBits();
}
@@ -2,7 +2,6 @@
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
using Framework.Constants;
using Framework.Dynamic;
using Game.Entities;
using System;
using System.Collections.Generic;
@@ -147,6 +146,7 @@ namespace Game.Networking.Packets
_worldPacket.WriteUInt32(StartTimer);
_worldPacket.WriteBit(ArenaFaction != 0);
_worldPacket.WriteBit(LeftEarly);
_worldPacket.WriteBit(Brawl);
_worldPacket.FlushBits();
}
@@ -154,6 +154,7 @@ namespace Game.Networking.Packets
public uint ShutdownTimer;
public byte ArenaFaction;
public bool LeftEarly;
public bool Brawl;
public uint StartTimer;
public uint Mapid;
}
@@ -1,29 +1,23 @@
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
using Framework.Constants;
namespace Game.Networking.Packets
{
public enum CollectionType
{
None = -1,
Toybox = 1,
Appearance = 3,
TransmogSet = 4
}
class CollectionItemSetFavorite : ClientPacket
{
public CollectionItemSetFavorite(WorldPacket packet) : base(packet) { }
public override void Read()
{
Type = (CollectionType)_worldPacket.ReadUInt32();
Type = (ItemCollectionType)_worldPacket.ReadUInt32();
Id = _worldPacket.ReadUInt32();
IsFavorite = _worldPacket.HasBit();
}
public CollectionType Type;
public ItemCollectionType Type;
public uint Id;
public bool IsFavorite;
}
}
}
@@ -608,6 +608,8 @@ namespace Game.Networking.Packets
_worldPacket.WriteXYZ(OldMapPosition);
_worldPacket.WriteBit(Ship.HasValue);
_worldPacket.WriteBit(TransferSpellID.HasValue);
_worldPacket.FlushBits();
if (Ship.HasValue)
{
_worldPacket.WriteUInt32(Ship.Value.Id);
@@ -616,8 +618,6 @@ namespace Game.Networking.Packets
if (TransferSpellID.HasValue)
_worldPacket.WriteInt32(TransferSpellID.Value);
_worldPacket.FlushBits();
}
public int MapID = -1;
@@ -1225,7 +1225,7 @@ namespace Game.Networking.Packets
public float InitVertSpeed;
}
public class SpeedRange
public class StateChangeRangeInfo
{
public float Min;
public float Max;
@@ -1244,7 +1244,7 @@ namespace Game.Networking.Packets
data.WriteUInt32((uint)MessageID);
data.WriteUInt32(SequenceIndex);
data.WriteBit(Speed.HasValue);
data.WriteBit(SpeedRange != null);
data.WriteBit(Range != null);
data.WriteBit(KnockBack.HasValue);
data.WriteBit(VehicleRecID.HasValue);
data.WriteBit(CollisionHeight.HasValue);
@@ -1260,10 +1260,10 @@ namespace Game.Networking.Packets
if (Speed.HasValue)
data.WriteFloat(Speed.Value);
if (SpeedRange != null)
if (Range != null)
{
data.WriteFloat(SpeedRange.Min);
data.WriteFloat(SpeedRange.Max);
data.WriteFloat(Range.Min);
data.WriteFloat(Range.Max);
}
if (KnockBack.HasValue)
@@ -1297,7 +1297,7 @@ namespace Game.Networking.Packets
public ServerOpcodes MessageID;
public uint SequenceIndex;
public float? Speed;
public SpeedRange SpeedRange;
public StateChangeRangeInfo Range;
public KnockBackInfo? KnockBack;
public int? VehicleRecID;
public CollisionHeightInfo? CollisionHeight;
+6 -6
View File
@@ -42,10 +42,10 @@ namespace Game.Networking.Packets
public override void Read()
{
uint areasCount = _worldPacket.ReadBits<uint>(4);
IsFromAddOn = _worldPacket.HasBit();
IsAddon = _worldPacket.HasBit();
Request.Read(_worldPacket);
RequestID = _worldPacket.ReadUInt32();
Token = _worldPacket.ReadUInt32();
Origin = _worldPacket.ReadUInt8();
for (int i = 0; i < areasCount; ++i)
@@ -53,9 +53,9 @@ namespace Game.Networking.Packets
}
public WhoRequest Request = new();
public uint RequestID;
public uint Token;
public byte Origin; // 1 = Social, 2 = Chat, 3 = Item
public bool IsFromAddOn;
public bool IsAddon;
public List<int> Areas= new();
}
@@ -65,14 +65,14 @@ namespace Game.Networking.Packets
public override void Write()
{
_worldPacket.WriteUInt32(RequestID);
_worldPacket.WriteUInt32(Token);
_worldPacket.WriteBits(Response.Count, 6);
_worldPacket.FlushBits();
Response.ForEach(p => p.Write(_worldPacket));
}
public uint RequestID;
public uint Token;
public List<WhoEntry> Response = new();
}