TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
WorldPackets::Toy::AccountToysUpdate Class Referencefinal

#include <ToyPackets.h>

Public Member Functions

 AccountToysUpdate ()
 
WorldPacket constWrite () override
 
- Public Member Functions inherited from WorldPackets::ServerPacket
 ServerPacket (OpcodeServer opcode, size_t initialSize=200, ConnectionType connection=CONNECTION_TYPE_DEFAULT)
 
void Read () overridefinal
 
void Clear ()
 
WorldPacket && Move ()
 
OpcodeServer GetOpcode () const
 
- Public Member Functions inherited from WorldPackets::Packet
 Packet (WorldPacket &&worldPacket)
 
virtual ~Packet ()=default
 
 Packet (Packet const &right)=delete
 
Packetoperator= (Packet const &right)=delete
 
WorldPacket constGetRawPacket () const
 
size_t GetSize () const
 
ConnectionType GetConnection () const
 

Public Attributes

bool IsFullUpdate = false
 
ToyBoxContainer constToys = nullptr
 

Additional Inherited Members

- Protected Attributes inherited from WorldPackets::Packet
WorldPacket _worldPacket
 

Constructor & Destructor Documentation

WorldPackets::Toy::AccountToysUpdate::AccountToysUpdate ( )
inline
54 : ServerPacket(SMSG_ACCOUNT_TOYS_UPDATE, 1 + 4 + 1) { }
ServerPacket(OpcodeServer opcode, size_t initialSize=200, ConnectionType connection=CONNECTION_TYPE_DEFAULT)
Definition: Packet.h:49
Definition: Opcodes.h:731

Member Function Documentation

WorldPacket const * WorldPackets::Toy::AccountToysUpdate::Write ( )
overridevirtual

Implements WorldPackets::Packet.

32 {
35 
36  // both lists have to have the same size
37  _worldPacket << int32(Toys->size());
38  _worldPacket << int32(Toys->size());
39 
40  for (auto const& item : *Toys)
41  _worldPacket << uint32(item.first);
42 
43  for (auto const& favourite : *Toys)
44  _worldPacket.WriteBit(favourite.second);
45 
47 
48  return &_worldPacket;
49 }
bool IsFullUpdate
Definition: ToyPackets.h:58
ToyBoxContainer const * Toys
Definition: ToyPackets.h:59
void FlushBits()
Definition: ByteBuffer.h:150
WorldPacket _worldPacket
Definition: Packet.h:43
bool WriteBit(uint32 bit)
Definition: ByteBuffer.h:170
int32_t int32
Definition: g3dmath.h:167
uint32_t uint32
Definition: g3dmath.h:168

+ Here is the call graph for this function:

Member Data Documentation

bool WorldPackets::Toy::AccountToysUpdate::IsFullUpdate = false
ToyBoxContainer const* WorldPackets::Toy::AccountToysUpdate::Toys = nullptr

The documentation for this class was generated from the following files: