35 m_Out(a_Protocol.m_OutPacketBuffer),
36 m_Lock(a_Protocol.m_CSPacket),
122 inline void WriteBuf(
const char * a_Data,
size_t a_Size)
cProtocol::ePacketType GetPacketType() const
bool WriteVarInt32(UInt32 a_Value)
void WriteBEInt8(Int8 a_Value)
void WriteFPInt(double a_Value)
Writes the double value as a 27:5 fixed-point integer.
bool WriteBEDouble(double a_Value)
void WriteUUID(const cUUID &a_UUID)
Writes the specified UUID as a 128-bit BigEndian integer.
bool WriteVarUTF8String(const AString &a_Value)
void WriteBuf(const char *a_Data, size_t a_Size)
static AString PacketTypeToStr(cProtocol::ePacketType a_PacketType)
Returns the human-readable representation of the packet type.
void WriteBEInt16(Int16 a_Value)
void WriteBEUInt8(UInt8 a_Value)
void WriteString(const AString &a_Value)
cProtocol & m_Protocol
The protocol instance in which the packet is being constructed.
bool WriteBEInt16(Int16 a_Value)
void WriteBEInt32(Int32 a_Value)
bool WritePosition64(Int32 a_BlockX, Int32 a_BlockY, Int32 a_BlockZ)
bool Write(const void *a_Bytes, size_t a_Count)
Writes the bytes specified to the ringbuffer.
~cPacketizer()
Sends the packet via the contained protocol's SendPacket() function.
bool WriteBEUInt64(UInt64 a_Value)
void WriteBEUInt32(UInt32 a_Value)
cByteBuffer & m_Out
The protocol's buffer for the constructed packet data.
void WriteByteAngle(double a_Angle)
Writes the specified angle using a single byte.
unsigned long long UInt64
void WriteBEUInt16(UInt16 a_Value)
cCSLock m_Lock
The RAII lock preventing multithreaded access to the protocol buffer while constructing the packet...
An object that can store incoming bytes and lets its clients read the bytes sequentially The bytes ar...
void WriteBEDouble(double a_Value)
bool WriteBEInt64(Int64 a_Value)
bool WriteBEUInt8(UInt8 a_Value)
bool WriteBEInt8(Int8 a_Value)
cPacketizer(cProtocol &a_Protocol, cProtocol::ePacketType a_PacketType)
Starts serializing a new packet into the protocol's m_OutPacketBuffer.
bool WriteBEFloat(float a_Value)
Composes an individual packet in the protocol's m_OutPacketBuffer; sends it just before being destruc...
void WritePosition64(int a_BlockX, int a_BlockY, int a_BlockZ)
Writes the specified block position as a single encoded 64-bit BigEndian integer. ...
void WriteVarInt32(UInt32 a_Value)
bool WriteBEInt32(Int32 a_Value)
RAII for cCriticalSection - locks the CS on creation, unlocks on destruction.
void WriteBEFloat(float a_Value)
virtual UInt32 GetPacketID(ePacketType a_Packet)=0
Returns the protocol-specific packet ID given the protocol-agnostic packet enum.
bool WriteBEUInt32(UInt32 a_Value)
void WriteBool(bool a_Value)
bool WriteBool(bool a_Value)
void WriteBEUInt64(UInt64 a_Value)
ePacketType
Logical types of outgoing packets.
void WriteBEInt64(Int64 a_Value)
cProtocol::ePacketType m_PacketType
Type of the contained packet.
bool WriteBEUInt16(UInt16 a_Value)