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

#include <SpellPackets.h>

Public Member Functions

 AuraUpdate ()
 
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 UpdateAll = false
 
ObjectGuid UnitGUID
 
std::vector< AuraInfoAuras
 

Additional Inherited Members

- Protected Attributes inherited from WorldPackets::Packet
WorldPacket _worldPacket
 

Constructor & Destructor Documentation

WorldPackets::Spells::AuraUpdate::AuraUpdate ( )
inline
Definition: Opcodes.h:772
ServerPacket(OpcodeServer opcode, size_t initialSize=200, ConnectionType connection=CONNECTION_TYPE_DEFAULT)
Definition: Packet.h:49

Member Function Documentation

WorldPacket const * WorldPackets::Spells::AuraUpdate::Write ( )
overridevirtual

Implements WorldPackets::Packet.

118 {
121  _worldPacket << uint32(Auras.size());
122  for (auto& aura : Auras)
123  {
124  _worldPacket << aura.Slot;
125  if (_worldPacket.WriteBit(aura.AuraData.is_initialized()))
126  {
127  AuraDataInfo const& data = *aura.AuraData;
128  _worldPacket << uint32(data.SpellID);
129  _worldPacket << uint32(data.SpellXSpellVisualID);
130  _worldPacket << uint8(data.Flags);
131  _worldPacket << uint32(data.ActiveFlags);
132  _worldPacket << uint16(data.CastLevel);
133  _worldPacket << uint8(data.Applications);
134  _worldPacket << uint32(data.Points.size());
135  _worldPacket << uint32(data.EstimatedPoints.size());
136 
137  if (!data.Points.empty())
138  _worldPacket.append(data.Points.data(), data.Points.size());
139 
140  if (!data.EstimatedPoints.empty())
141  _worldPacket.append(data.EstimatedPoints.data(), data.EstimatedPoints.size());
142 
143  _worldPacket.WriteBit(data.CastUnit.is_initialized());
144  _worldPacket.WriteBit(data.Duration.is_initialized());
145  _worldPacket.WriteBit(data.Remaining.is_initialized());
146 
147  if (data.CastUnit)
148  _worldPacket << *data.CastUnit;
149 
150  if (data.Duration)
151  _worldPacket << uint32(*data.Duration);
152 
153  if (data.Remaining)
154  _worldPacket << uint32(*data.Remaining);
155  }
156 
158  }
159 
160  return &_worldPacket;
161 }
void FlushBits()
Definition: ByteBuffer.h:150
WorldPacket _worldPacket
Definition: Packet.h:43
uint16_t uint16
Definition: g3dmath.h:166
bool WriteBit(uint32 bit)
Definition: ByteBuffer.h:170
std::vector< AuraInfo > Auras
Definition: SpellPackets.h:214
bool UpdateAll
Definition: SpellPackets.h:212
void append(T value)
Definition: ByteBuffer.h:143
uint8_t uint8
Definition: g3dmath.h:164
ObjectGuid UnitGUID
Definition: SpellPackets.h:213
uint32_t uint32
Definition: g3dmath.h:168

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

std::vector<AuraInfo> WorldPackets::Spells::AuraUpdate::Auras
ObjectGuid WorldPackets::Spells::AuraUpdate::UnitGUID
bool WorldPackets::Spells::AuraUpdate::UpdateAll = false

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