29 void sent(std::shared_ptr<const Snapshot> snapshot, std::span<const std::uint16_t> sequences);
34 void acknowledge(std::uint16_t ack, std::uint32_t ack_bits)
noexcept;
42 [[nodiscard]] const
Snapshot*
find(std::uint32_t tick) const noexcept;
46 [[nodiscard]]
bool acknowledged(std::uint32_t tick) const noexcept;
49 [[nodiscard]] std::
size_t size() const noexcept;
53 std::shared_ptr<const Snapshot> snapshot;
55 std::vector<std::uint16_t> waiting;
57 [[nodiscard]]
const Sent* entry(std::uint32_t tick)
const noexcept;
59 std::deque<Sent> sent_;
The last snapshots sent to one client, and the ones it acknowledged.
Definition snapshot_history.hpp:21
void acknowledge(std::uint16_t ack, std::uint32_t ack_bits) noexcept
Records the acknowledgements of a datagram received from the client.
std::size_t size() const noexcept
Number of snapshots kept.
static constexpr std::size_t capacity
Snapshots kept per client.
Definition snapshot_history.hpp:24
void sent(std::shared_ptr< const Snapshot > snapshot, std::span< const std::uint16_t > sequences)
Records a snapshot sent to the client, forgetting the oldest beyond capacity.
bool acknowledged(std::uint32_t tick) const noexcept
Tells whether the client acknowledged a snapshot.
const Snapshot * find(std::uint32_t tick) const noexcept
A snapshot kept, acknowledged or not.
const Snapshot * latest_acknowledged() const noexcept
The most recent snapshot the client acknowledged, among those kept.
R-Type game code, built on the Aegis2D engine.
Definition enemy_scripts.hpp:16