![]() |
Cuberite
A lightweight, fast and extensible game server for Minecraft
|
Composes an individual packet in the protocol's m_OutPacketBuffer; sends it just before being destructed. More...
#include <Packetizer.h>
Public Member Functions | |
cPacketizer (cProtocol &a_Protocol, cProtocol::ePacketType a_PacketType) | |
Starts serializing a new packet into the protocol's m_OutPacketBuffer. More... | |
cProtocol::ePacketType | GetPacketType () const |
void | WriteBEDouble (double a_Value) |
void | WriteBEFloat (float a_Value) |
void | WriteBEInt16 (Int16 a_Value) |
void | WriteBEInt32 (Int32 a_Value) |
void | WriteBEInt64 (Int64 a_Value) |
void | WriteBEInt8 (Int8 a_Value) |
void | WriteBEUInt16 (UInt16 a_Value) |
void | WriteBEUInt32 (UInt32 a_Value) |
void | WriteBEUInt64 (UInt64 a_Value) |
void | WriteBEUInt8 (UInt8 a_Value) |
void | WriteBool (bool a_Value) |
void | WriteBuf (const ContiguousByteBufferView a_Data) |
void | WriteByteAngle (double a_Angle) |
Writes the specified angle using a single byte. More... | |
void | WriteFPInt (double a_Value) |
Writes the double value as a 27:5 fixed-point integer. More... | |
void | WriteString (const AString &a_Value) |
void | WriteUUID (const cUUID &a_UUID) |
Writes the specified UUID as a 128-bit BigEndian integer. More... | |
void | WriteVarInt32 (UInt32 a_Value) |
void | WriteXYZPosition64 (const Vector3i a_Position) |
Writes the specified block position as a single encoded 64-bit BigEndian integer. More... | |
void | WriteXYZPosition64 (int a_BlockX, int a_BlockY, int a_BlockZ) |
Writes the specified block position as a single encoded 64-bit BigEndian integer. More... | |
void | WriteXZYPosition64 (const Vector3i a_Position) |
Writes the specified block position as a single encoded 64-bit BigEndian integer. More... | |
void | WriteXZYPosition64 (int a_BlockX, int a_BlockY, int a_BlockZ) |
Writes the specified block position as a single encoded 64-bit BigEndian integer. More... | |
~cPacketizer () | |
Sends the packet via the contained protocol's SendPacket() function. More... | |
Static Public Member Functions | |
static AString | PacketTypeToStr (cProtocol::ePacketType a_PacketType) |
Returns the human-readable representation of the packet type. More... | |
Protected Attributes | |
cCSLock | m_Lock |
The RAII lock preventing multithreaded access to the protocol buffer while constructing the packet. More... | |
cByteBuffer & | m_Out |
The protocol's buffer for the constructed packet data. More... | |
cProtocol::ePacketType | m_PacketType |
Type of the contained packet. More... | |
cProtocol & | m_Protocol |
The protocol instance in which the packet is being constructed. More... | |
Composes an individual packet in the protocol's m_OutPacketBuffer; sends it just before being destructed.
Definition at line 59 of file Packetizer.h.
|
inline |
Starts serializing a new packet into the protocol's m_OutPacketBuffer.
Locks the protocol's m_CSPacket to avoid multithreading issues.
Definition at line 64 of file Packetizer.h.
cPacketizer::~cPacketizer | ( | ) |
Sends the packet via the contained protocol's SendPacket() function.
Definition at line 17 of file Packetizer.cpp.
|
inline |
Definition at line 196 of file Packetizer.h.
|
static |
Returns the human-readable representation of the packet type.
Used for logging the packets.
Definition at line 56 of file Packetizer.cpp.
|
inline |
Definition at line 135 of file Packetizer.h.
|
inline |
Definition at line 129 of file Packetizer.h.
|
inline |
Definition at line 93 of file Packetizer.h.
|
inline |
Definition at line 105 of file Packetizer.h.
|
inline |
Definition at line 117 of file Packetizer.h.
|
inline |
Definition at line 87 of file Packetizer.h.
|
inline |
Definition at line 99 of file Packetizer.h.
|
inline |
Definition at line 111 of file Packetizer.h.
|
inline |
Definition at line 123 of file Packetizer.h.
|
inline |
Definition at line 81 of file Packetizer.h.
|
inline |
Definition at line 76 of file Packetizer.h.
|
inline |
Definition at line 153 of file Packetizer.h.
void cPacketizer::WriteByteAngle | ( | double | a_Angle | ) |
Writes the specified angle using a single byte.
Definition at line 26 of file Packetizer.cpp.
void cPacketizer::WriteFPInt | ( | double | a_Value | ) |
Writes the double value as a 27:5 fixed-point integer.
Definition at line 35 of file Packetizer.cpp.
|
inline |
Definition at line 147 of file Packetizer.h.
void cPacketizer::WriteUUID | ( | const cUUID & | a_UUID | ) |
Writes the specified UUID as a 128-bit BigEndian integer.
Definition at line 44 of file Packetizer.cpp.
|
inline |
Definition at line 141 of file Packetizer.h.
|
inline |
Writes the specified block position as a single encoded 64-bit BigEndian integer.
The three coordinates are written in XYZ order.
Definition at line 168 of file Packetizer.h.
|
inline |
Writes the specified block position as a single encoded 64-bit BigEndian integer.
The three coordinates are written in XYZ order.
Definition at line 161 of file Packetizer.h.
|
inline |
Writes the specified block position as a single encoded 64-bit BigEndian integer.
The three coordinates are written in XZY order, in 1.14+.
Definition at line 182 of file Packetizer.h.
|
inline |
Writes the specified block position as a single encoded 64-bit BigEndian integer.
The three coordinates are written in XZY order, in 1.14+.
Definition at line 175 of file Packetizer.h.
|
protected |
The RAII lock preventing multithreaded access to the protocol buffer while constructing the packet.
Definition at line 210 of file Packetizer.h.
|
protected |
The protocol's buffer for the constructed packet data.
Definition at line 207 of file Packetizer.h.
|
protected |
Type of the contained packet.
Used for logging purposes, the packet type is encoded into m_Out immediately in constructor.
Definition at line 214 of file Packetizer.h.
|
protected |
The protocol instance in which the packet is being constructed.
Definition at line 204 of file Packetizer.h.