R-Type 0.1
Loading...
Searching...
No Matches
PongMessage.hpp
1#pragma once
2
8#include "PacketReader.hpp"
9#include "PacketWriter.hpp"
10
11#include <cstddef>
12#include <cstdint>
13
23 std::uint32_t timestamp = 0;
24
26 static constexpr std::size_t SIZE = 4;
27
33 bool serialize(PacketWriter &writer) const;
34
40 bool deserialize(PacketReader &reader);
41};
42
Bounds checked reader of big-endian values over a byte buffer.
Definition PacketReader.hpp:15
Growable buffer of big-endian values, capped at MAX_PAYLOAD_SIZE.
Definition PacketWriter.hpp:16
Payload of a Pong message, 4 bytes, sent by the server in answer to a Ping.
Definition PongMessage.hpp:22
bool serialize(PacketWriter &writer) const
Writes the payload in network byte order.
Definition PongMessage.cpp:3
std::uint32_t timestamp
Value copied from the Ping.
Definition PongMessage.hpp:23
bool deserialize(PacketReader &reader)
Reads the payload from a buffer.
Definition PongMessage.cpp:7
static constexpr std::size_t SIZE
Encoded size of the payload, in bytes.
Definition PongMessage.hpp:26