TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
WorldPacket Class Reference

#include <WorldPacket.h>

Public Member Functions

 WorldPacket ()
 
 WorldPacket (uint32 opcode, size_t res=200, ConnectionType connection=CONNECTION_TYPE_DEFAULT)
 
 WorldPacket (WorldPacket &&packet)
 
 WorldPacket (WorldPacket const &right)
 
WorldPacketoperator= (WorldPacket const &right)
 
WorldPacketoperator= (WorldPacket &&right)
 
 WorldPacket (uint32 opcode, MessageBuffer &&buffer, ConnectionType connection)
 
void Initialize (uint32 opcode, size_t newres=200, ConnectionType connection=CONNECTION_TYPE_DEFAULT)
 
uint32 GetOpcode () const
 
void SetOpcode (uint32 opcode)
 
ConnectionType GetConnection () const
 
- Public Member Functions inherited from ByteBuffer
 ByteBuffer ()
 
 ByteBuffer (size_t reserve)
 
 ByteBuffer (ByteBuffer &&buf)
 
 ByteBuffer (ByteBuffer const &right)
 
 ByteBuffer (MessageBuffer &&buffer)
 
std::vector< uint8 > && Move ()
 
ByteBufferoperator= (ByteBuffer const &right)
 
ByteBufferoperator= (ByteBuffer &&right)
 
virtual ~ByteBuffer ()
 
void clear ()
 
template<typename T >
void append (T value)
 
void FlushBits ()
 
void ResetBitPos ()
 
bool WriteBit (uint32 bit)
 
bool ReadBit ()
 
template<typename T >
void WriteBits (T value, int32 bits)
 
uint32 ReadBits (int32 bits)
 
void ReadByteSeq (uint8 &b)
 
void WriteByteSeq (uint8 b)
 
template<typename T >
void put (size_t pos, T value)
 
template<>
void read_skip ()
 
template<>
void read_skip ()
 
template<typename T >
void PutBits (size_t pos, T value, uint32 bitCount)
 
ByteBufferoperator<< (uint8 value)
 
ByteBufferoperator<< (uint16 value)
 
ByteBufferoperator<< (uint32 value)
 
ByteBufferoperator<< (uint64 value)
 
ByteBufferoperator<< (int8 value)
 
ByteBufferoperator<< (int16 value)
 
ByteBufferoperator<< (int32 value)
 
ByteBufferoperator<< (int64 value)
 
ByteBufferoperator<< (float value)
 
ByteBufferoperator<< (double value)
 
ByteBufferoperator<< (const std::string &value)
 
ByteBufferoperator<< (const char *str)
 
ByteBufferoperator>> (bool &value)
 
ByteBufferoperator>> (uint8 &value)
 
ByteBufferoperator>> (uint16 &value)
 
ByteBufferoperator>> (uint32 &value)
 
ByteBufferoperator>> (uint64 &value)
 
ByteBufferoperator>> (int8 &value)
 
ByteBufferoperator>> (int16 &value)
 
ByteBufferoperator>> (int32 &value)
 
ByteBufferoperator>> (int64 &value)
 
ByteBufferoperator>> (float &value)
 
ByteBufferoperator>> (double &value)
 
ByteBufferoperator>> (std::string &value)
 
uint8operator[] (size_t const pos)
 
uint8 constoperator[] (size_t const pos) const
 
size_t rpos () const
 
size_t rpos (size_t rpos_)
 
void rfinish ()
 
size_t wpos () const
 
size_t wpos (size_t wpos_)
 
size_t bitwpos () const
 Returns position of last written bit. More...
 
size_t bitwpos (size_t newPos)
 
template<typename T >
void read_skip ()
 
void read_skip (size_t skip)
 
template<typename T >
read ()
 
template<typename T >
read (size_t pos) const
 
void read (uint8 *dest, size_t len)
 
void ReadPackedUInt64 (uint64 &guid)
 
void ReadPackedUInt64 (uint8 mask, uint64 &value)
 
std::string ReadString (uint32 length)
 
void WriteString (std::string const &str)
 
void WriteString (char const *str, size_t len)
 
uint32 ReadPackedTime ()
 
ByteBufferReadPackedTime (uint32 &time)
 
uint8contents ()
 
uint8 constcontents () const
 
size_t size () const
 
bool empty () const
 
void resize (size_t newsize)
 
void reserve (size_t ressize)
 
void append (const char *src, size_t cnt)
 
template<class T >
void append (const T *src, size_t cnt)
 
void append (const uint8 *src, size_t cnt)
 
void append (const ByteBuffer &buffer)
 
void appendPackXYZ (float x, float y, float z)
 
void AppendPackedUInt64 (uint64 guid)
 
void AppendPackedTime (time_t time)
 
void put (size_t pos, const uint8 *src, size_t cnt)
 
void print_storage () const
 
void textlike () const
 
void hexlike () const
 

Protected Attributes

uint32 m_opcode
 
ConnectionType _connection
 
- Protected Attributes inherited from ByteBuffer
size_t _rpos
 
size_t _wpos
 
size_t _bitpos
 
uint8 _curbitval
 
std::vector< uint8_storage
 

Additional Inherited Members

- Static Public Member Functions inherited from ByteBuffer
static size_t PackUInt64 (uint64 value, uint8 *mask, uint8 *result)
 
- Static Public Attributes inherited from ByteBuffer
static size_t const DEFAULT_SIZE = 0x1000
 
static uint8 const InitialBitPos = 8
 

Constructor & Destructor Documentation

WorldPacket::WorldPacket ( )
inline
31  {
32  }
uint32 m_opcode
Definition: WorldPacket.h:85
Definition: Opcodes.h:42
ByteBuffer()
Definition: ByteBuffer.h:77
ConnectionType _connection
Definition: WorldPacket.h:86
Definition: Opcodes.h:35
WorldPacket::WorldPacket ( uint32  opcode,
size_t  res = 200,
ConnectionType  connection = CONNECTION_TYPE_DEFAULT 
)
inline
34  : ByteBuffer(res),
35  m_opcode(opcode), _connection(connection) { }
uint32 m_opcode
Definition: WorldPacket.h:85
ByteBuffer()
Definition: ByteBuffer.h:77
ConnectionType _connection
Definition: WorldPacket.h:86
WorldPacket::WorldPacket ( WorldPacket &&  packet)
inline
37  : ByteBuffer(std::move(packet)), m_opcode(packet.m_opcode), _connection(packet._connection)
38  {
39  }
uint32 m_opcode
Definition: WorldPacket.h:85
ByteBuffer()
Definition: ByteBuffer.h:77
ConnectionType _connection
Definition: WorldPacket.h:86
WorldPacket::WorldPacket ( WorldPacket const right)
inline
41  : ByteBuffer(right), m_opcode(right.m_opcode), _connection(right._connection)
42  {
43  }
uint32 m_opcode
Definition: WorldPacket.h:85
ByteBuffer()
Definition: ByteBuffer.h:77
ConnectionType _connection
Definition: WorldPacket.h:86
WorldPacket::WorldPacket ( uint32  opcode,
MessageBuffer &&  buffer,
ConnectionType  connection 
)
inline
69 : ByteBuffer(std::move(buffer)), m_opcode(opcode), _connection(connection) { }
uint32 m_opcode
Definition: WorldPacket.h:85
ByteBuffer()
Definition: ByteBuffer.h:77
ConnectionType _connection
Definition: WorldPacket.h:86

Member Function Documentation

ConnectionType WorldPacket::GetConnection ( ) const
inline
82 { return _connection; }
ConnectionType _connection
Definition: WorldPacket.h:86

+ Here is the caller graph for this function:

uint32 WorldPacket::GetOpcode ( ) const
inline
79 { return m_opcode; }
uint32 m_opcode
Definition: WorldPacket.h:85

+ Here is the caller graph for this function:

void WorldPacket::Initialize ( uint32  opcode,
size_t  newres = 200,
ConnectionType  connection = CONNECTION_TYPE_DEFAULT 
)
inline
72  {
73  clear();
74  _storage.reserve(newres);
75  m_opcode = opcode;
76  _connection = connection;
77  }
uint32 m_opcode
Definition: WorldPacket.h:85
std::vector< uint8 > _storage
Definition: ByteBuffer.h:707
ConnectionType _connection
Definition: WorldPacket.h:86
void clear()
Definition: ByteBuffer.h:134

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

WorldPacket& WorldPacket::operator= ( WorldPacket const right)
inline
46  {
47  if (this != &right)
48  {
49  m_opcode = right.m_opcode;
50  _connection = right._connection;
52  }
53 
54  return *this;
55  }
uint32 m_opcode
Definition: WorldPacket.h:85
ByteBuffer & operator=(ByteBuffer const &right)
Definition: ByteBuffer.h:104
ConnectionType _connection
Definition: WorldPacket.h:86

+ Here is the call graph for this function:

WorldPacket& WorldPacket::operator= ( WorldPacket &&  right)
inline
58  {
59  if (this != &right)
60  {
61  m_opcode = right.m_opcode;
62  _connection = right._connection;
63  ByteBuffer::operator=(std::move(right));
64  }
65 
66  return *this;
67  }
uint32 m_opcode
Definition: WorldPacket.h:85
ByteBuffer & operator=(ByteBuffer const &right)
Definition: ByteBuffer.h:104
ConnectionType _connection
Definition: WorldPacket.h:86

+ Here is the call graph for this function:

void WorldPacket::SetOpcode ( uint32  opcode)
inline
80 { m_opcode = opcode; }
uint32 m_opcode
Definition: WorldPacket.h:85

Member Data Documentation

ConnectionType WorldPacket::_connection
protected
uint32 WorldPacket::m_opcode
protected

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