78 const std::vector<uint8_t> &
getPayload()
const;
115 const std::string
print()
const;
121 std::vector<uint8_t> payload;
This is the file that links the EntityNode children.
Macro definitions for logging messages with varying levels of detail and formatting.
This is the file in charge of containing the Log class (the one in charge of outputing info only when...
Enum for the different types of messages that can be eschanged with the server.
Represents a packet for the custom binary UDP protocol.
const std::string print() const
Prints a string representation of the packet's contents, for debugging purposes.
uint16_t getSize() const
Gets the size of the packet's payload.
MessageType getType() const
Gets the message type of the packet.
static std::vector< uint8_t > serialize(const Packet &packet)
Serializes a Packet object into a vector of bytes suitable for network transmission.
~Packet()=default
Destructor for the Packet class.
static Packet deserialize(const std::vector< uint8_t > &data)
Deserializes a packet from a vector of bytes received over the network.
Packet(MessageType type=MessageType::P_ERROR, const std::vector< uint8_t > &payload={})
Constructs a Packet with a specified message type and payload.
const std::vector< uint8_t > & getPayload() const
Gets the payload of the packet.
MessageType
Enum for the different message types in the UDP protocol.