|
|
constexpr bool | isFailedState (EConnectState state) |
| | Returns true if the state represents a terminal failure.
|
| |
|
constexpr std::string_view | connectStateName (EConnectState state) |
| | Returns a human-readable label for a connection state.
|
| |
|
constexpr int8_t | buttonsToMoveX (uint8_t buttons) |
| | Derives horizontal movement {-1, 0, 1} from a button bitmask.
|
| |
|
constexpr int8_t | buttonsToMoveY (uint8_t buttons) |
| | Derives vertical movement {-1, 0, 1} from a button bitmask.
|
| |
|
constexpr std::string_view | channelName (uint8_t id) |
| | Returns a human-readable name for a channel ID.
|
| |
|
bool | isValidMsgType (uint8_t raw) |
| | Checks whether a raw byte value corresponds to a valid EMsgType.
|
| |
|
constexpr std::string_view | msgTypeName (EMsgType type) |
| | Returns a human-readable name for a protocol message type.
|
| |
| constexpr EChannel | expectedChannelFor (EMsgType type) |
| | Returns the required ENet channel for a protocol message type.
|
| |
|
constexpr bool | isValidPlayerMask (const uint32_t mask) |
| | Returns true when the given player-id bitmask uses only valid player bits.
|
| |
|
constexpr std::size_t | explosionBlastCellOffset (std::size_t index) |
| | Returns the payload offset of the explosion blast-cell entry at index.
|
| |
|
constexpr std::size_t | explosionDestroyedBrickOffset (std::size_t index) |
| | Returns the payload offset of the explosion destroyed-brick entry at index.
|
| |
|
constexpr bool | isValidTileCell (const uint8_t col, const uint8_t row) |
| | Returns true when the given cell lies within the current tile-map bounds.
|
| |
|
constexpr uint16_t | tileCellKey (const uint8_t col, const uint8_t row) |
| | Packs one tile cell into a monotonic key for ordering and deduplication.
|
| |
|
constexpr bool | isExpectedChannelFor (EMsgType type, uint8_t channelId) |
| | Returns true when a message was received on its expected ENet channel.
|
| |
| constexpr std::size_t | expectedPayloadSize (EMsgType type) |
| | Returns the exact expected payload size for a message type.
|
| |
|
constexpr void | writeU16LE (uint8_t *out, uint16_t value) |
| | Writes a 16-bit value using little-endian encoding.
|
| |
|
constexpr void | writeU32LE (uint8_t *out, uint32_t value) |
| | Writes a 32-bit value using little-endian encoding.
|
| |
|
constexpr uint16_t | readU16LE (const uint8_t *in) |
| | Reads a 16-bit value encoded as little-endian.
|
| |
|
constexpr uint32_t | readU32LE (const uint8_t *in) |
| | Reads a 32-bit value encoded as little-endian.
|
| |
|
constexpr std::size_t | boundedStrLen (const char *s, const std::size_t maxBytes) |
| | Returns string length capped to maxBytes for bounded C strings.
|
| |
|
constexpr std::size_t | snapshotPlayerOffset (std::size_t index) |
| | Returns the payload offset of the snapshot player entry at index.
|
| |
|
constexpr std::size_t | snapshotBombOffset (std::size_t index) |
| | Returns the payload offset of the snapshot bomb entry at index.
|
| |
|
constexpr std::size_t | snapshotPowerupOffset (std::size_t index) |
| | Returns the payload offset of the snapshot powerup entry at index.
|
| |
|
void | setHelloName (MsgHello &hello, std::string_view name) |
| | Sets MsgHello::name from string_view with truncation and zero padding.
|
| |
|
void | setHelloName (MsgHello &hello, const char *name) |
| | C-string overload of setHelloName.
|
| |
|
constexpr bool | isValidLobbySeatFlags (const uint8_t flags) |
| | Returns true when one lobby-seat flag field contains only known bits.
|
| |
|
constexpr bool | isValidLobbyPhase (const uint8_t rawPhase) |
| | Returns true when one lobby-state phase field contains a known encoding.
|
| |
|
void | setLobbySeatName (MsgLobbyState::SeatEntry &seat, std::string_view name) |
| | Sets one lobby-seat display name with truncation and zero padding.
|
| |
|
void | setMatchResultWinnerName (MsgMatchResult &matchResult, std::string_view name) |
| | Sets one match-result winner display name with truncation and zero padding.
|
| |
|
std::string_view | lobbySeatName (const MsgLobbyState::SeatEntry &seat) |
| | Returns the visible lobby-seat display name.
|
| |
|
std::string_view | matchResultWinnerName (const MsgMatchResult &matchResult) |
| | Returns the visible winner display name carried by one match-result payload.
|
| |
|
constexpr bool | lobbySeatIsOccupied (const MsgLobbyState::SeatEntry &seat) |
| | Returns true when one lobby seat is currently occupied.
|
| |
|
constexpr bool | lobbySeatIsReady (const MsgLobbyState::SeatEntry &seat) |
| | Returns true when one occupied lobby seat is marked ready.
|
| |
|
constexpr bool | lobbyCountdownActive (const MsgLobbyState &lobbyState) |
| | Returns true when the authoritative lobby is in the visible pre-match countdown phase.
|
| |
|
void | serializeHeader (const PacketHeader &header, uint8_t *out) noexcept |
| | Serializes PacketHeader into kPacketHeaderSize bytes.
|
| |
| bool | deserializeHeader (const uint8_t *in, std::size_t inSize, PacketHeader &outHeader) |
| | Deserializes and validates PacketHeader.
|
| |
|
void | serializeMsgHello (const MsgHello &hello, uint8_t *out) noexcept |
| | Serializes MsgHello to fixed-size wire payload.
|
| |
|
bool | deserializeMsgHello (const uint8_t *in, std::size_t inSize, MsgHello &outHello) |
| | Deserializes MsgHello from fixed-size wire payload.
|
| |
|
void | serializeMsgWelcome (const MsgWelcome &welcome, uint8_t *out) noexcept |
| | Serializes MsgWelcome to fixed-size wire payload.
|
| |
|
bool | deserializeMsgWelcome (const uint8_t *in, std::size_t inSize, MsgWelcome &outWelcome) |
| | Deserializes MsgWelcome from fixed-size wire payload.
|
| |
|
void | serializeMsgReject (const MsgReject &reject, uint8_t *out) noexcept |
| | Serializes MsgReject to fixed-size wire payload.
|
| |
|
bool | deserializeMsgReject (const uint8_t *in, std::size_t inSize, MsgReject &outReject) |
| | Deserializes MsgReject from fixed-size wire payload.
|
| |
|
void | serializeMsgLevelInfo (const MsgLevelInfo &info, uint8_t *out) noexcept |
| | Serializes MsgLevelInfo to fixed-size wire payload.
|
| |
|
bool | deserializeMsgLevelInfo (const uint8_t *in, std::size_t inSize, MsgLevelInfo &outInfo) |
| | Deserializes MsgLevelInfo from fixed-size wire payload.
|
| |
|
constexpr bool | isValidLobbyReadyValue (const uint8_t ready) |
| | Returns true when one lobby-ready value uses a known wire encoding.
|
| |
|
void | serializeMsgLobbyReady (const MsgLobbyReady &ready, uint8_t *out) noexcept |
| | Serializes MsgLobbyReady to a fixed-size wire payload.
|
| |
|
bool | deserializeMsgLobbyReady (const uint8_t *in, std::size_t inSize, MsgLobbyReady &outReady) |
| | Deserializes MsgLobbyReady from a fixed-size wire payload.
|
| |
|
void | serializeMsgMatchLoaded (const MsgMatchLoaded &loaded, uint8_t *out) noexcept |
| | Serializes MsgMatchLoaded to fixed-size wire payload.
|
| |
|
bool | deserializeMsgMatchLoaded (const uint8_t *in, std::size_t inSize, MsgMatchLoaded &outLoaded) |
| | Deserializes MsgMatchLoaded from fixed-size wire payload.
|
| |
|
void | serializeMsgMatchStart (const MsgMatchStart &matchStart, uint8_t *out) noexcept |
| | Serializes MsgMatchStart to fixed-size wire payload.
|
| |
|
bool | deserializeMsgMatchStart (const uint8_t *in, std::size_t inSize, MsgMatchStart &outMatchStart) |
| | Deserializes MsgMatchStart from fixed-size wire payload.
|
| |
|
void | serializeMsgMatchCancelled (const MsgMatchCancelled &cancelled, uint8_t *out) noexcept |
| | Serializes MsgMatchCancelled to fixed-size wire payload.
|
| |
|
bool | deserializeMsgMatchCancelled (const uint8_t *in, std::size_t inSize, MsgMatchCancelled &outCancelled) |
| | Deserializes MsgMatchCancelled from fixed-size wire payload.
|
| |
|
void | serializeMsgMatchResult (const MsgMatchResult &matchResult, uint8_t *out) noexcept |
| | Serializes MsgMatchResult to fixed-size wire payload.
|
| |
|
bool | deserializeMsgMatchResult (const uint8_t *in, std::size_t inSize, MsgMatchResult &outMatchResult) |
| | Deserializes MsgMatchResult from fixed-size wire payload.
|
| |
|
void | serializeMsgLobbyState (const MsgLobbyState &lobbyState, uint8_t *out) noexcept |
| | Serializes MsgLobbyState to fixed-size wire payload.
|
| |
|
bool | deserializeMsgLobbyState (const uint8_t *in, std::size_t inSize, MsgLobbyState &outLobbyState) |
| | Deserializes MsgLobbyState from fixed-size wire payload.
|
| |
| void | serializeMsgInput (const MsgInput &input, uint8_t *out) noexcept |
| | Serializes MsgInput to its fixed-size wire payload.
|
| |
|
bool | deserializeMsgInput (const uint8_t *in, std::size_t inSize, MsgInput &outInput) |
| | Deserializes MsgInput from fixed-size wire payload.
|
| |
| void | serializeMsgSnapshot (const MsgSnapshot &snap, uint8_t *out) noexcept |
| | Serializes MsgSnapshot to its fixed-size wire payload.
|
| |
|
bool | deserializeMsgSnapshot (const uint8_t *in, std::size_t inSize, MsgSnapshot &outSnap) |
| | Deserializes MsgSnapshot from fixed-size wire payload.
|
| |
|
void | serializeMsgCorrection (const MsgCorrection &corr, uint8_t *out) noexcept |
| | Serializes MsgCorrection to fixed-size wire payload.
|
| |
|
bool | deserializeMsgCorrection (const uint8_t *in, std::size_t inSize, MsgCorrection &outCorr) |
| | Deserializes MsgCorrection from fixed-size wire payload.
|
| |
|
void | serializeMsgBombPlaced (const MsgBombPlaced &bombPlaced, uint8_t *out) noexcept |
| | Serializes MsgBombPlaced to fixed-size wire payload.
|
| |
|
bool | deserializeMsgBombPlaced (const uint8_t *in, std::size_t inSize, MsgBombPlaced &outBombPlaced) |
| | Deserializes MsgBombPlaced from fixed-size wire payload.
|
| |
|
void | serializeMsgExplosionResolved (const MsgExplosionResolved &explosion, uint8_t *out) noexcept |
| | Serializes MsgExplosionResolved to fixed-size wire payload.
|
| |
|
bool | deserializeMsgExplosionResolved (const uint8_t *in, std::size_t inSize, MsgExplosionResolved &outExplosion) |
| | Deserializes MsgExplosionResolved from fixed-size wire payload.
|
| |
|
std::array< uint8_t, kPacketHeaderSize+kMsgHelloSize > | makeHelloPacket (const MsgHello &hello) |
| | Builds a full Hello packet (header + payload).
|
| |
|
std::array< uint8_t, kPacketHeaderSize+kMsgHelloSize > | makeHelloPacket (std::string_view name, uint16_t protocolVersion) |
| | Convenience overload building Hello from name and version.
|
| |
|
std::array< uint8_t, kPacketHeaderSize+kMsgWelcomeSize > | makeWelcomePacket (const MsgWelcome &welcome) |
| | Builds a full Welcome packet (header + payload).
|
| |
|
std::array< uint8_t, kPacketHeaderSize+kMsgRejectSize > | makeRejectPacket (const MsgReject &reject) |
| | Builds a full Reject packet (header + payload).
|
| |
|
std::array< uint8_t, kPacketHeaderSize+kMsgLevelInfoSize > | makeLevelInfoPacket (const MsgLevelInfo &info) |
| | Builds a full LevelInfo packet (header + payload).
|
| |
|
std::array< uint8_t, kPacketHeaderSize+kMsgLobbyReadySize > | makeLobbyReadyPacket (const MsgLobbyReady &ready) |
| | Builds a full LobbyReady packet (header + payload).
|
| |
|
std::array< uint8_t, kPacketHeaderSize+kMsgLobbyReadySize > | makeLobbyReadyPacket (const bool ready) |
| | Convenience overload building LobbyReady directly from the desired ready state.
|
| |
|
std::array< uint8_t, kPacketHeaderSize+kMsgMatchLoadedSize > | makeMatchLoadedPacket (const MsgMatchLoaded &loaded) |
| | Builds a full MatchLoaded packet (header + payload).
|
| |
|
std::array< uint8_t, kPacketHeaderSize+kMsgMatchLoadedSize > | makeMatchLoadedPacket (const uint32_t matchId) |
| | Convenience overload building MatchLoaded directly from a match identifier.
|
| |
|
std::array< uint8_t, kPacketHeaderSize+kMsgMatchStartSize > | makeMatchStartPacket (const MsgMatchStart &matchStart) |
| | Builds a full MatchStart packet (header + payload).
|
| |
|
std::array< uint8_t, kPacketHeaderSize+kMsgMatchStartSize > | makeMatchStartPacket (const uint32_t matchId, const uint32_t goShowServerTick, const uint32_t unlockServerTick) |
| | Convenience overload building MatchStart directly from match timing values.
|
| |
|
std::array< uint8_t, kPacketHeaderSize+kMsgMatchCancelledSize > | makeMatchCancelledPacket (const MsgMatchCancelled &cancelled) |
| | Builds a full MatchCancelled packet (header + payload).
|
| |
|
std::array< uint8_t, kPacketHeaderSize+kMsgMatchCancelledSize > | makeMatchCancelledPacket (const uint32_t matchId) |
| | Convenience overload building MatchCancelled directly from a match identifier.
|
| |
|
std::array< uint8_t, kPacketHeaderSize+kMsgMatchResultSize > | makeMatchResultPacket (const MsgMatchResult &matchResult) |
| | Builds a full MatchResult packet (header + payload).
|
| |
|
std::array< uint8_t, kPacketHeaderSize+kMsgLobbyStateSize > | makeLobbyStatePacket (const MsgLobbyState &lobbyState) |
| | Builds a full LobbyState packet (header + payload).
|
| |
|
std::array< uint8_t, kPacketHeaderSize+kMsgInputSize > | makeInputPacket (const MsgInput &input) |
| | Builds a full Input packet (header + payload).
|
| |
|
std::array< uint8_t, kPacketHeaderSize+kMsgSnapshotSize > | makeSnapshotPacket (const MsgSnapshot &snap) |
| | Builds a full Snapshot packet (header + payload).
|
| |
|
std::array< uint8_t, kPacketHeaderSize+kMsgCorrectionSize > | makeCorrectionPacket (const MsgCorrection &corr) |
| | Builds a full Correction packet (header + payload).
|
| |
|
std::array< uint8_t, kPacketHeaderSize+kMsgBombPlacedSize > | makeBombPlacedPacket (const MsgBombPlaced &bombPlaced) |
| | Builds a full BombPlaced packet (header + payload).
|
| |
|
std::array< uint8_t, kPacketHeaderSize+kMsgExplosionResolvedSize > | makeExplosionResolvedPacket (const MsgExplosionResolved &explosion) |
| | Builds a full ExplosionResolved packet (header + payload).
|
| |
| template<std::size_t N> |
| bool | queueOnChannel (ENetPeer *peer, EChannel channel, uint32_t flags, const std::array< uint8_t, N > &bytes) |
| | Queues a pre-serialized byte buffer on an explicit channel.
|
| |
|
void | flush (ENetHost *host) |
| | Flushes all currently queued packets for this host.
|
| |
|
template<std::size_t N> |
| bool | queueReliableControl (ENetPeer *peer, const std::array< uint8_t, N > &bytes) |
| | Queues a reliable control packet.
|
| |
|
template<std::size_t N> |
| bool | queueReliableGame (ENetPeer *peer, const std::array< uint8_t, N > &bytes) |
| | Queues a reliable gameplay packet.
|
| |
|
template<std::size_t N> |
| bool | queueUnreliableInput (ENetPeer *peer, const std::array< uint8_t, N > &bytes) |
| | Queues an unreliable input packet.
|
| |
|
template<std::size_t N> |
| bool | queueUnreliableSnapshot (ENetPeer *peer, const std::array< uint8_t, N > &bytes) |
| | Queues an unreliable snapshot packet.
|
| |
|
template<std::size_t N> |
| bool | queueUnreliableCorrection (ENetPeer *peer, const std::array< uint8_t, N > &bytes) |
| | Queues an unreliable owner-correction packet.
|
| |
| void | applyDefaultPeerTransportConfig (ENetPeer *peer) |
| | Applies the project's default transport-level liveness policy to one ENet peer.
|
| |
| bool | tryParsePacket (const uint8_t *data, std::size_t dataLength, PacketHeader &outHeader, const uint8_t *&outPayload, std::size_t &outPayloadSize) |
| | Validates and parses a raw packet into header and payload view.
|
| |