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 = 12;
23enum class NetMessage : uint8_t {
39enum class NetRefusal : uint8_t {
48const char* toString(NetRefusal reason);
51enum class NetSender : uint8_t {
58constexpr uint32_t NET_MESSAGE_HEADER_BITS = 16 + 8 + 8 + 64;
67void writeMessageHeader(
BitWriter& out, NetMessage message, uint64_t token);
81NetSender readMessageHeader(
BitReader& in, NetMessage& message, uint64_t& token);
88enum class NetRole : uint8_t {
105constexpr bool isAuthority(NetRole role) {
106 return role == NetRole::Offline || role == NetRole::Server;
116constexpr float NET_MAX_SCALE = 1024.0f;
125constexpr uint32_t NET_MAX_TICK_JUMP = Config::MAX_TICK_RATE * 60;
130using PlayerId = uint16_t;
131constexpr 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