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

#include <WorldPacket.h>

+ Inheritance diagram for WorldPacket:

Public Member Functions

 WorldPacket ()
 
 WorldPacket (uint32 opcode, ConnectionType connection=CONNECTION_TYPE_DEFAULT)
 
 WorldPacket (uint32 opcode, size_t res, Reserve, ConnectionType connection=CONNECTION_TYPE_DEFAULT)
 
 WorldPacket (uint32 opcode, size_t res, Resize, ConnectionType connection=CONNECTION_TYPE_DEFAULT)
 
 WorldPacket (uint32 opcode, size_t res, ConnectionType connection=CONNECTION_TYPE_DEFAULT)
 
 WorldPacket (WorldPacket &&packet) noexcept
 
 WorldPacket (WorldPacket const &right)=default
 
 WorldPacket (std::vector< uint8 > &&buffer, ConnectionType connection)
 
WorldPacketoperator= (WorldPacket const &right)
 
WorldPacketoperator= (WorldPacket &&right) noexcept
 
void Initialize (uint32 opcode, size_t newres=200, ConnectionType connection=CONNECTION_TYPE_DEFAULT)
 
uint32 GetOpcode () const
 
void SetOpcode (uint32 opcode)
 
ConnectionType GetConnection () const
 
TimePoint GetReceivedTime () const
 
void SetReceiveTime (TimePoint receivedTime)
 
- Public Member Functions inherited from ByteBuffer
 ByteBuffer ()
 
 ByteBuffer (size_t size, Reserve)
 
 ByteBuffer (size_t size, Resize)
 
 ByteBuffer (ByteBuffer const &right)=default
 
 ByteBuffer (ByteBuffer &&buf) noexcept
 
 ByteBuffer (std::vector< uint8 > &&buffer) noexcept
 
std::vector< uint8 > && Release () &&noexcept
 
ByteBufferoperator= (ByteBuffer const &right)=default
 
ByteBufferoperator= (ByteBuffer &&right) noexcept
 
virtual ~ByteBuffer ()=default
 
void clear ()
 
template<ByteBufferNumeric T>
void append (T value)
 
bool HasUnfinishedBitPack () const
 
void FlushBits ()
 
void ResetBitPos ()
 
bool WriteBit (bool bit)
 
bool ReadBit ()
 
void WriteBits (uint64 value, int32 bits)
 
uint32 ReadBits (int32 bits)
 
template<ByteBufferNumeric T>
void put (std::size_t pos, T value)
 
void PutBits (std::size_t pos, std::size_t value, uint32 bitCount)
 
ByteBufferoperator<< (bool)=delete
 
ByteBufferoperator<< (char 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 &)=delete
 
ByteBufferoperator>> (char &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_)
 
size_t bitwpos () const
 Returns position of last written bit.
 
size_t bitwpos (size_t newPos)
 
template<ByteBufferNumeric T>
void read_skip ()
 
void read_skip (size_t skip)
 
template<ByteBufferNumeric T>
read ()
 
template<ByteBufferNumeric T>
read (size_t pos) const
 
template<ByteBufferNumeric T>
void read (T *dest, size_t count)
 
void read (uint8 *dest, size_t len)
 
template<ByteBufferNumeric T, size_t Size>
void read (std::array< T, Size > &arr)
 
void WriteString (std::string const &str)
 
void WriteString (std::string_view str)
 
void WriteString (char const *str, size_t len)
 
void ReadSkipCString (bool requireValidUtf8=true)
 
std::string_view ReadCString (bool requireValidUtf8=true)
 
std::string_view ReadString (uint32 length, bool requireValidUtf8=true)
 
uint8data ()
 
uint8 const * data () const
 
size_t size () const
 
bool empty () const
 
void resize (size_t newsize)
 
void reserve (size_t ressize)
 
void shrink_to_fit ()
 
template<ByteBufferNumeric T>
void append (T const *src, size_t cnt)
 
void append (uint8 const *src, size_t cnt)
 
void append (ByteBuffer const &buffer)
 
template<ByteBufferNumeric T, std::size_t Size>
void append (std::array< T, Size > const &arr)
 
void put (size_t pos, uint8 const *src, size_t cnt)
 
void print_storage () const
 
void textlike () const
 
void hexlike () const
 
void OnInvalidPosition (size_t pos, size_t valueSize) const
 

Protected Attributes

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

Additional Inherited Members

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

Detailed Description

Definition at line 25 of file WorldPacket.h.

Constructor & Destructor Documentation

◆ WorldPacket() [1/8]

WorldPacket::WorldPacket ( )
inlineexplicit

Definition at line 29 of file WorldPacket.h.

◆ WorldPacket() [2/8]

WorldPacket::WorldPacket ( uint32  opcode,
ConnectionType  connection = CONNECTION_TYPE_DEFAULT 
)
inlineexplicit

Definition at line 32 of file WorldPacket.h.

◆ WorldPacket() [3/8]

WorldPacket::WorldPacket ( uint32  opcode,
size_t  res,
Reserve  ,
ConnectionType  connection = CONNECTION_TYPE_DEFAULT 
)
inlineexplicit

Definition at line 35 of file WorldPacket.h.

◆ WorldPacket() [4/8]

WorldPacket::WorldPacket ( uint32  opcode,
size_t  res,
Resize  ,
ConnectionType  connection = CONNECTION_TYPE_DEFAULT 
)
inlineexplicit

Definition at line 38 of file WorldPacket.h.

◆ WorldPacket() [5/8]

WorldPacket::WorldPacket ( uint32  opcode,
size_t  res,
ConnectionType  connection = CONNECTION_TYPE_DEFAULT 
)
inlineexplicit

Definition at line 41 of file WorldPacket.h.

◆ WorldPacket() [6/8]

WorldPacket::WorldPacket ( WorldPacket &&  packet)
inlinenoexcept

Definition at line 43 of file WorldPacket.h.

◆ WorldPacket() [7/8]

WorldPacket::WorldPacket ( WorldPacket const &  right)
default

◆ WorldPacket() [8/8]

WorldPacket::WorldPacket ( std::vector< uint8 > &&  buffer,
ConnectionType  connection 
)
inlineexplicit

Definition at line 48 of file WorldPacket.h.

Member Function Documentation

◆ GetConnection()

ConnectionType WorldPacket::GetConnection ( ) const
inline

Definition at line 86 of file WorldPacket.h.

+ Here is the caller graph for this function:

◆ GetOpcode()

uint32 WorldPacket::GetOpcode ( ) const
inline

Definition at line 83 of file WorldPacket.h.

+ Here is the caller graph for this function:

◆ GetReceivedTime()

TimePoint WorldPacket::GetReceivedTime ( ) const
inline

Definition at line 88 of file WorldPacket.h.

+ Here is the caller graph for this function:

◆ Initialize()

void WorldPacket::Initialize ( uint32  opcode,
size_t  newres = 200,
ConnectionType  connection = CONNECTION_TYPE_DEFAULT 
)
inline

Definition at line 75 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)
inlinenoexcept

Definition at line 63 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 51 of file WorldPacket.h.

+ Here is the call graph for this function:

◆ SetOpcode()

void WorldPacket::SetOpcode ( uint32  opcode)
inline

Definition at line 84 of file WorldPacket.h.

+ Here is the caller graph for this function:

◆ SetReceiveTime()

void WorldPacket::SetReceiveTime ( TimePoint  receivedTime)
inline

Definition at line 89 of file WorldPacket.h.

+ Here is the caller graph for this function:

Member Data Documentation

◆ _connection

ConnectionType WorldPacket::_connection
protected

Definition at line 93 of file WorldPacket.h.

◆ m_opcode

uint32 WorldPacket::m_opcode
protected

Definition at line 92 of file WorldPacket.h.

◆ m_receivedTime

TimePoint WorldPacket::m_receivedTime
protected

Definition at line 94 of file WorldPacket.h.


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