TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ItemPackets.h File Reference
#include "Packet.h"
#include "Item.h"
#include "PacketUtilities.h"
+ Include dependency graph for ItemPackets.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  WorldPackets::Item::ItemBonusInstanceData
 
struct  WorldPackets::Item::ItemInstance
 
class  WorldPackets::Item::BuyBackItem
 
class  WorldPackets::Item::BuyItem
 
class  WorldPackets::Item::BuySucceeded
 
class  WorldPackets::Item::BuyFailed
 
class  WorldPackets::Item::GetItemPurchaseData
 
struct  WorldPackets::Item::ItemPurchaseRefundItem
 
struct  WorldPackets::Item::ItemPurchaseRefundCurrency
 
struct  WorldPackets::Item::ItemPurchaseContents
 
class  WorldPackets::Item::SetItemPurchaseData
 
class  WorldPackets::Item::ItemPurchaseRefund
 
class  WorldPackets::Item::ItemPurchaseRefundResult
 
class  WorldPackets::Item::ItemExpirePurchaseRefund
 
class  WorldPackets::Item::RepairItem
 
class  WorldPackets::Item::SellItem
 
class  WorldPackets::Item::ItemTimeUpdate
 
class  WorldPackets::Item::SetProficiency
 
struct  WorldPackets::Item::InvUpdate
 
struct  WorldPackets::Item::InvUpdate::InvItem
 
class  WorldPackets::Item::InventoryChangeFailure
 
class  WorldPackets::Item::SplitItem
 
class  WorldPackets::Item::SwapInvItem
 
class  WorldPackets::Item::SwapItem
 
class  WorldPackets::Item::AutoEquipItem
 
class  WorldPackets::Item::AutoEquipItemSlot
 
class  WorldPackets::Item::AutoStoreBagItem
 
class  WorldPackets::Item::DestroyItem
 
class  WorldPackets::Item::SellResponse
 
class  WorldPackets::Item::ItemPushResult
 
class  WorldPackets::Item::ReadItem
 
class  WorldPackets::Item::ReadItemResultFailed
 
class  WorldPackets::Item::ReadItemResultOK
 
class  WorldPackets::Item::WrapItem
 
class  WorldPackets::Item::CancelTempEnchantment
 
class  WorldPackets::Item::ItemCooldown
 
class  WorldPackets::Item::ItemEnchantTimeUpdate
 
struct  WorldPackets::Item::TransmogrifyItem
 
class  WorldPackets::Item::TransmogrifyItems
 
class  WorldPackets::Item::UseCritterItem
 
class  WorldPackets::Item::SocketGems
 
class  WorldPackets::Item::SocketGemsResult
 

Namespaces

 WorldPackets
 
 WorldPackets::Item
 

Functions

ByteBufferWorldPackets::Item::operator>> (ByteBuffer &data, InvUpdate &invUpdate)
 
ByteBufferoperator<< (ByteBuffer &data, WorldPackets::Item::ItemBonusInstanceData const &itemBonusInstanceData)
 
ByteBufferoperator>> (ByteBuffer &data, WorldPackets::Item::ItemBonusInstanceData &itemBonusInstanceData)
 
ByteBufferoperator<< (ByteBuffer &data, WorldPackets::Item::ItemInstance const &itemInstance)
 
ByteBufferoperator>> (ByteBuffer &data, WorldPackets::Item::ItemInstance &itemInstance)
 

Function Documentation

ByteBuffer& operator<< ( ByteBuffer data,
WorldPackets::Item::ItemBonusInstanceData const itemBonusInstanceData 
)
167 {
168  data << itemBonusInstanceData.Context;
169  data << uint32(itemBonusInstanceData.BonusListIDs.size());
170  for (uint32 bonusID : itemBonusInstanceData.BonusListIDs)
171  data << bonusID;
172 
173  return data;
174 }
uint32_t uint32
Definition: Define.h:150
uint32_t uint32
Definition: g3dmath.h:168
ByteBuffer& operator<< ( ByteBuffer data,
WorldPackets::Item::ItemInstance const itemInstance 
)
196 {
197  data << int32(itemInstance.ItemID);
198  data << int32(itemInstance.RandomPropertiesSeed);
199  data << int32(itemInstance.RandomPropertiesID);
200 
201  data.WriteBit(itemInstance.ItemBonus.is_initialized());
202  data.WriteBit(itemInstance.Modifications.is_initialized());
203  data.FlushBits();
204 
205  if (itemInstance.ItemBonus)
206  data << *itemInstance.ItemBonus;
207 
208  if (itemInstance.Modifications)
209  data << *itemInstance.Modifications;
210 
211  return data;
212 }
void FlushBits()
Definition: ByteBuffer.h:150
bool WriteBit(uint32 bit)
Definition: ByteBuffer.h:170
int32_t int32
Definition: g3dmath.h:167

+ Here is the call graph for this function:

ByteBuffer& operator>> ( ByteBuffer data,
WorldPackets::Item::ItemBonusInstanceData itemBonusInstanceData 
)
ByteBuffer& operator>> ( ByteBuffer data,
WorldPackets::Item::ItemInstance itemInstance 
)
215 {
216  data >> itemInstance.ItemID;
217  data >> itemInstance.RandomPropertiesSeed;
218  data >> itemInstance.RandomPropertiesID;
219 
220  bool const hasItemBonus = data.ReadBit();
221  bool const hasModifications = data.ReadBit();
222 
223  if (hasItemBonus)
224  data >> itemInstance.ItemBonus;
225 
226  if (hasModifications)
227  {
228  WorldPackets::CompactArray<int32> modifications;
229  data >> modifications;
230  itemInstance.Modifications = std::move(modifications);
231  }
232 
233  return data;
234 }
Optional< CompactArray< int32 > > Modifications
Definition: ItemPackets.h:50
uint32 RandomPropertiesSeed
Definition: ItemPackets.h:47
Definition: PacketUtilities.h:133
uint32 RandomPropertiesID
Definition: ItemPackets.h:48
Optional< ItemBonusInstanceData > ItemBonus
Definition: ItemPackets.h:49
bool ReadBit()
Definition: ByteBuffer.h:186
uint32 ItemID
Definition: ItemPackets.h:46

+ Here is the call graph for this function: