TrinityCore
Loading...
Searching...
No Matches
WorldPacket Class Reference

#include <WorldPacket.h>

+ Inheritance diagram for WorldPacket:

Public Member Functions

 WorldPacket ()
 
 WorldPacket (uint16 opcode, size_t res=200)
 
 WorldPacket (WorldPacket &&packet)
 
 WorldPacket (WorldPacket &&packet, TimePoint receivedTime)
 
 WorldPacket (WorldPacket const &right)
 
WorldPacketoperator= (WorldPacket const &right)
 
WorldPacketoperator= (WorldPacket &&right)
 
 WorldPacket (uint16 opcode, MessageBuffer &&buffer)
 
void Initialize (uint16 opcode, size_t newres=200)
 
uint16 GetOpcode () const
 
void SetOpcode (uint16 opcode)
 
TimePoint GetReceivedTime () const
 
- Public Member Functions inherited from ByteBuffer
 ByteBuffer ()
 
 ByteBuffer (size_t reserve)
 
 ByteBuffer (ByteBuffer &&buf) noexcept
 
 ByteBuffer (ByteBuffer const &right)=default
 
 ByteBuffer (MessageBuffer &&buffer)
 
ByteBufferoperator= (ByteBuffer const &right)
 
ByteBufferoperator= (ByteBuffer &&right) noexcept
 
virtual ~ByteBuffer ()=default
 
void clear ()
 
template<typename T >
void append (T value)
 
template<typename T >
void put (std::size_t pos, T value)
 
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_view value)
 
ByteBufferoperator<< (std::string const &str)
 
ByteBufferoperator<< (char const *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 const & operator[] (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_)
 
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)
 
template<size_t Size>
void read (std::array< uint8, Size > &arr)
 
void readPackGUID (uint64 &guid)
 
std::string ReadCString (bool requireValidUtf8=true)
 
uint8contents ()
 
uint8 const * contents () const
 
size_t size () const
 
bool empty () const
 
void resize (size_t newsize)
 
void reserve (size_t ressize)
 
void shrink_to_fit ()
 
void append (const char *src, size_t cnt)
 
template<class T >
void append (const T *src, size_t cnt)
 
void append (uint8 const *src, size_t cnt)
 
void append (ByteBuffer const &buffer)
 
template<size_t Size>
void append (std::array< uint8, Size > const &arr)
 
void appendPackXYZ (float x, float y, float z)
 
void appendPackGUID (uint64 guid)
 
void put (size_t pos, const uint8 *src, size_t cnt)
 
void print_storage () const
 
void textlike () const
 
void hexlike () const
 
template<>
void read_skip ()
 
template<>
void read_skip ()
 

Protected Attributes

uint16 m_opcode
 
TimePoint m_receivedTime
 
- Protected Attributes inherited from ByteBuffer
size_t _rpos
 
size_t _wpos
 
std::vector< uint8_storage
 

Additional Inherited Members

- Static Public Attributes inherited from ByteBuffer
static constexpr size_t DEFAULT_SIZE = 0x1000
 

Detailed Description

Definition at line 26 of file WorldPacket.h.

Constructor & Destructor Documentation

◆ WorldPacket() [1/6]

WorldPacket::WorldPacket ( )
inline

Definition at line 30 of file WorldPacket.h.

◆ WorldPacket() [2/6]

WorldPacket::WorldPacket ( uint16  opcode,
size_t  res = 200 
)
inline

Definition at line 34 of file WorldPacket.h.

◆ WorldPacket() [3/6]

WorldPacket::WorldPacket ( WorldPacket &&  packet)
inline

Definition at line 37 of file WorldPacket.h.

◆ WorldPacket() [4/6]

WorldPacket::WorldPacket ( WorldPacket &&  packet,
TimePoint  receivedTime 
)
inline

Definition at line 41 of file WorldPacket.h.

◆ WorldPacket() [5/6]

WorldPacket::WorldPacket ( WorldPacket const &  right)
inline

Definition at line 45 of file WorldPacket.h.

◆ WorldPacket() [6/6]

WorldPacket::WorldPacket ( uint16  opcode,
MessageBuffer &&  buffer 
)
inline

Definition at line 71 of file WorldPacket.h.

Member Function Documentation

◆ GetOpcode()

uint16 WorldPacket::GetOpcode ( ) const
inline

Definition at line 80 of file WorldPacket.h.

+ Here is the caller graph for this function:

◆ GetReceivedTime()

TimePoint WorldPacket::GetReceivedTime ( ) const
inline

Definition at line 83 of file WorldPacket.h.

+ Here is the caller graph for this function:

◆ Initialize()

void WorldPacket::Initialize ( uint16  opcode,
size_t  newres = 200 
)
inline

Definition at line 73 of file WorldPacket.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=() [1/2]

WorldPacket & WorldPacket::operator= ( WorldPacket &&  right)
inline

Definition at line 60 of file WorldPacket.h.

+ Here is the call graph for this function:

◆ operator=() [2/2]

WorldPacket & WorldPacket::operator= ( WorldPacket const &  right)
inline

Definition at line 49 of file WorldPacket.h.

+ Here is the call graph for this function:

◆ SetOpcode()

void WorldPacket::SetOpcode ( uint16  opcode)
inline

Definition at line 81 of file WorldPacket.h.

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_opcode

uint16 WorldPacket::m_opcode
protected

Definition at line 86 of file WorldPacket.h.

◆ m_receivedTime

TimePoint WorldPacket::m_receivedTime
protected

Definition at line 87 of file WorldPacket.h.


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