5#include "core/engine_config.h"
6#include "net/wire/bit_stream.h"
11constexpr uint16_t NET_PROTOCOL_TAG = 0x564B;
14constexpr uint8_t NET_PROTOCOL_VERSION = 8;
23enum class NetMessage : uint8_t {
39enum class NetRefusal : uint8_t {
48const char* toString(NetRefusal reason);
51enum class NetSender : uint8_t {
64void writeMessageHeader(
BitWriter& out, NetMessage message, uint64_t token);
78NetSender readMessageHeader(
BitReader& in, NetMessage& message, uint64_t& token);
85enum class NetRole : uint8_t {
102constexpr bool isAuthority(NetRole role) {
103 return role == NetRole::Offline || role == NetRole::Server;
113constexpr float NET_MAX_SCALE = 1024.0f;
122constexpr uint32_t NET_MAX_TICK_JUMP = Config::MAX_TICK_RATE * 60;
127using PlayerId = uint16_t;
128constexpr PlayerId NO_PLAYER = 0;
Reads back what a BitWriter wrote, in the same order.
Definition bit_stream.h:145
Packs values to the bit into a byte buffer.
Definition bit_stream.h:19