mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
Core/PacketIO: ported several 11.0.5 packet changes which also apply to Classic
This commit is contained in:
@@ -667,7 +667,6 @@ void WorldSession::SendListInventory(ObjectGuid vendorGuid)
|
||||
price -= CalculatePct(price, priceMod);
|
||||
|
||||
item.MuID = slot + 1; // client expects counting to start at 1
|
||||
item.Durability = itemTemplate->MaxDurability;
|
||||
item.ExtendedCostID = vendorItem->ExtendedCost;
|
||||
item.Type = vendorItem->Type;
|
||||
item.Quantity = leftInStock;
|
||||
|
||||
@@ -628,18 +628,22 @@ WorldPacket const* AuctionListBucketsResult::Write()
|
||||
|
||||
WorldPacket const* AuctionListItemsResult::Write()
|
||||
{
|
||||
_worldPacket << uint32(Items.size());
|
||||
_worldPacket << uint32(Unknown830);
|
||||
_worldPacket << uint32(TotalCount);
|
||||
_worldPacket << uint32(DesiredDelay);
|
||||
_worldPacket.WriteBits(AsUnderlyingType(ListType), 2);
|
||||
_worldPacket.WriteBit(HasMoreResults);
|
||||
_worldPacket.FlushBits();
|
||||
{
|
||||
_worldPacket << uint32(Items.size());
|
||||
_worldPacket << uint32(Unknown830);
|
||||
_worldPacket << uint32(DesiredDelay);
|
||||
for (AuctionItem const& item : Items)
|
||||
_worldPacket << item;
|
||||
}
|
||||
|
||||
_worldPacket << BucketKey;
|
||||
{
|
||||
_worldPacket.WriteBits(AsUnderlyingType(ListType), 2);
|
||||
_worldPacket.WriteBit(HasMoreResults);
|
||||
_worldPacket.FlushBits();
|
||||
|
||||
for (AuctionItem const& item : Items)
|
||||
_worldPacket << item;
|
||||
_worldPacket << BucketKey;
|
||||
_worldPacket << uint32(TotalCount);
|
||||
}
|
||||
|
||||
return &_worldPacket;
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ WorldPacket const* WorldPackets::Channel::UserlistUpdate::Write()
|
||||
_worldPacket << UpdatedUserGUID;
|
||||
_worldPacket << uint8(UserFlags);
|
||||
_worldPacket << uint32(_ChannelFlags);
|
||||
_worldPacket << uint32(ChannelID);
|
||||
_worldPacket << int32(ChannelID);
|
||||
_worldPacket.WriteBits(ChannelName.length(), 7);
|
||||
_worldPacket.FlushBits();
|
||||
_worldPacket.WriteString(ChannelName);
|
||||
|
||||
@@ -94,6 +94,8 @@ ByteBuffer& operator<<(ByteBuffer& data, SpellCastLogData const& spellCastLogDat
|
||||
data << int32(spellCastLogData.AttackPower);
|
||||
data << int32(spellCastLogData.SpellPower);
|
||||
data << int32(spellCastLogData.Armor);
|
||||
data << int32(spellCastLogData.Unknown_1105_1);
|
||||
data << int32(spellCastLogData.Unknown_1105_2);
|
||||
data << BitsSize<9>(spellCastLogData.PowerData);
|
||||
data.FlushBits();
|
||||
|
||||
|
||||
@@ -43,6 +43,8 @@ namespace WorldPackets
|
||||
int32 AttackPower = 0;
|
||||
int32 SpellPower = 0;
|
||||
int32 Armor = 0;
|
||||
int32 Unknown_1105_1 = 0;
|
||||
int32 Unknown_1105_2 = 0;
|
||||
std::vector<SpellLogPowerData> PowerData;
|
||||
|
||||
void Initialize(Unit const* unit);
|
||||
|
||||
@@ -48,7 +48,7 @@ WorldPacket const* WorldPackets::Item::BuyFailed::Write()
|
||||
{
|
||||
_worldPacket << VendorGUID;
|
||||
_worldPacket << uint32(Muid);
|
||||
_worldPacket << uint8(Reason);
|
||||
_worldPacket << int32(Reason);
|
||||
|
||||
return &_worldPacket;
|
||||
}
|
||||
|
||||
@@ -1011,7 +1011,7 @@ WorldPacket const* WorldPackets::Movement::ResumeToken::Write()
|
||||
|
||||
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Movement::MoveSetCompoundState::MoveStateChange const& stateChange)
|
||||
{
|
||||
data << uint16(stateChange.MessageID);
|
||||
data << uint32(stateChange.MessageID);
|
||||
data << uint32(stateChange.SequenceIndex);
|
||||
data.WriteBit(stateChange.Speed.has_value());
|
||||
data.WriteBit(stateChange.SpeedRange.has_value());
|
||||
|
||||
@@ -667,7 +667,7 @@ namespace WorldPackets
|
||||
{
|
||||
MoveStateChange(OpcodeServer messageId, uint32 sequenceIndex) : MessageID(messageId), SequenceIndex(sequenceIndex) { }
|
||||
|
||||
uint16 MessageID = 0;
|
||||
uint32 MessageID = 0;
|
||||
uint32 SequenceIndex = 0;
|
||||
Optional<float> Speed;
|
||||
Optional<MoveSetCompoundState::SpeedRange> SpeedRange;
|
||||
|
||||
@@ -143,7 +143,6 @@ ByteBuffer& operator<<(ByteBuffer& data, VendorItem const& item)
|
||||
data << uint64(item.Price);
|
||||
data << uint32(item.MuID);
|
||||
data << int32(item.Type);
|
||||
data << int32(item.Durability);
|
||||
data << int32(item.StackCount);
|
||||
data << int32(item.Quantity);
|
||||
data << int32(item.ExtendedCostID);
|
||||
@@ -161,7 +160,7 @@ ByteBuffer& operator<<(ByteBuffer& data, VendorItem const& item)
|
||||
WorldPacket const* VendorInventory::Write()
|
||||
{
|
||||
_worldPacket << Vendor;
|
||||
_worldPacket << uint8(Reason);
|
||||
_worldPacket << int32(Reason);
|
||||
_worldPacket << uint32(Items.size());
|
||||
for (VendorItem const& item : Items)
|
||||
_worldPacket << item;
|
||||
|
||||
@@ -170,7 +170,6 @@ namespace WorldPackets
|
||||
WorldPackets::Item::ItemInstance Item;
|
||||
int32 Quantity = -1;
|
||||
uint64 Price = 0;
|
||||
int32 Durability = 0;
|
||||
int32 StackCount = 0;
|
||||
int32 ExtendedCostID = 0;
|
||||
int32 PlayerConditionFailed = 0;
|
||||
@@ -186,7 +185,7 @@ namespace WorldPackets
|
||||
|
||||
WorldPacket const* Write() override;
|
||||
|
||||
uint8 Reason = 0;
|
||||
int32 Reason = 0;
|
||||
std::vector<VendorItem> Items;
|
||||
ObjectGuid Vendor;
|
||||
};
|
||||
|
||||
@@ -30,7 +30,8 @@ ByteBuffer& operator<<(ByteBuffer& data, PerksVendorItem const& perksVendorItem)
|
||||
data << int32(perksVendorItem.Field_18);
|
||||
data << int32(perksVendorItem.Price);
|
||||
data << perksVendorItem.AvailableUntil;
|
||||
data.WriteBit(perksVendorItem.Disabled);
|
||||
data << Bits<1>(perksVendorItem.Disabled);
|
||||
data << Bits<1>(perksVendorItem.Field_41);
|
||||
data.FlushBits();
|
||||
|
||||
return data;
|
||||
|
||||
@@ -34,6 +34,7 @@ struct PerksVendorItem
|
||||
int32 Price = 0;
|
||||
Timestamp<> AvailableUntil;
|
||||
bool Disabled = false;
|
||||
bool Field_41 = false;
|
||||
};
|
||||
|
||||
ByteBuffer& operator<<(ByteBuffer& data, PerksVendorItem const& perksVendorItem);
|
||||
|
||||
@@ -969,7 +969,7 @@ namespace WorldPackets
|
||||
|
||||
ObjectGuid Guid;
|
||||
ObjectGuid CastID;
|
||||
uint16 MoveMsgID = 0;
|
||||
uint32 MoveMsgID = 0;
|
||||
int32 SpellID = 0;
|
||||
float Pitch = 0.0f;
|
||||
float Speed = 0.0f;
|
||||
|
||||
Reference in New Issue
Block a user