TrinityCore
EncryptablePacket Class Reference

#include <WorldSocket.h>

+ Inheritance diagram for EncryptablePacket:

Public Member Functions

 EncryptablePacket (WorldPacket const &packet, bool encrypt)
 
bool NeedsEncryption () const
 
- Public Member Functions inherited from WorldPacket
 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
 
WorldPacketoperator= (WorldPacket const &right)
 
WorldPacketoperator= (WorldPacket &&right) noexcept
 
 WorldPacket (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
 
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 &&buf) noexcept
 
 ByteBuffer (ByteBuffer const &right)=default
 
 ByteBuffer (MessageBuffer &&buffer)
 
std::vector< uint8 > && Move () noexcept
 
ByteBufferoperator= (ByteBuffer const &right)
 
ByteBufferoperator= (ByteBuffer &&right) noexcept
 
virtual ~ByteBuffer ()=default
 
void clear ()
 
template<typename T >
void append (T value)
 
bool HasUnfinishedBitPack () const
 
void FlushBits ()
 
void ResetBitPos ()
 
bool WriteBit (bool bit)
 
bool ReadBit ()
 
void WriteBits (std::size_t value, int32 bits)
 
uint32 ReadBits (int32 bits)
 
template<typename T >
void put (std::size_t pos, T value)
 
template<>
void read_skip ()
 
template<>
void read_skip ()
 
void PutBits (std::size_t pos, std::size_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<< (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_)
 
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 , typename Underlying = T>
read ()
 
template<typename T , typename Underlying = T>
read (size_t pos) const
 
template<class T >
void read (T *dest, size_t count)
 
void read (uint8 *dest, size_t len)
 
template<size_t Size>
void read (std::array< uint8, Size > &arr)
 
void ReadPackedUInt64 (uint64 &guid)
 
void ReadPackedUInt64 (uint8 mask, uint64 &value)
 
void WriteString (std::string const &str)
 
void WriteString (std::string_view str)
 
void WriteString (char const *str, size_t len)
 
std::string ReadCString (bool requireValidUtf8=true)
 
std::string ReadString (uint32 length, 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 AppendPackedUInt64 (uint64 guid)
 
void put (size_t pos, uint8 const *src, size_t cnt)
 
void print_storage () const
 
void textlike () const
 
void hexlike () const
 

Public Attributes

std::atomic< EncryptablePacket * > SocketQueueLink
 

Private Attributes

bool _encrypt
 

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 constexpr size_t DEFAULT_SIZE = 0x1000
 
static constexpr uint8 InitialBitPos = 8
 
- Protected Attributes inherited from WorldPacket
uint32 m_opcode
 
ConnectionType _connection
 
TimePoint m_receivedTime
 
- Protected Attributes inherited from ByteBuffer
size_t _rpos
 
size_t _wpos
 
size_t _bitpos
 
uint8 _curbitval
 
std::vector< uint8_storage
 

Detailed Description

Definition at line 40 of file WorldSocket.h.

Constructor & Destructor Documentation

◆ EncryptablePacket()

EncryptablePacket::EncryptablePacket ( WorldPacket const &  packet,
bool  encrypt 
)
inline

Definition at line 43 of file WorldSocket.h.

Member Function Documentation

◆ NeedsEncryption()

bool EncryptablePacket::NeedsEncryption ( ) const
inline

Definition at line 48 of file WorldSocket.h.

+ Here is the caller graph for this function:

Member Data Documentation

◆ _encrypt

bool EncryptablePacket::_encrypt
private

Definition at line 53 of file WorldSocket.h.

◆ SocketQueueLink

std::atomic<EncryptablePacket*> EncryptablePacket::SocketQueueLink

Definition at line 50 of file WorldSocket.h.


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