1#ifndef BOMBERMAN_NET_NETCOMMON_H
2#define BOMBERMAN_NET_NETCOMMON_H
41 constexpr uint16_t kProtocolVersion = 9;
71 constexpr uint8_t kInputUp = 0x01;
72 constexpr uint8_t kInputDown = 0x02;
73 constexpr uint8_t kInputLeft = 0x04;
74 constexpr uint8_t kInputRight = 0x08;
75 constexpr uint8_t kInputBomb = 0x10;
78 constexpr uint8_t
kInputKnownBits = kInputUp | kInputDown | kInputLeft | kInputRight | kInputBomb;
84 if (buttons & kInputRight) dx += 1;
85 if (buttons & kInputLeft) dx -= 1;
93 if (buttons & kInputDown) dy += 1;
94 if (buttons & kInputUp) dy -= 1;
110 GameplayReliable = 1,
112 SnapshotUnreliable = 3,
113 CorrectionUnreliable = 4
122 case static_cast<uint8_t
>(EChannel::ControlReliable):
return "ControlReliable";
123 case static_cast<uint8_t
>(EChannel::GameplayReliable):
return "GameplayReliable";
124 case static_cast<uint8_t
>(EChannel::InputUnreliable):
return "InputUnreliable";
125 case static_cast<uint8_t
>(EChannel::SnapshotUnreliable):
return "SnapshotUnreliable";
126 case static_cast<uint8_t
>(EChannel::CorrectionUnreliable):
return "CorrectionUnreliable";
127 default:
return "Unknown";
137 constexpr std::size_t kPacketHeaderSize =
141 constexpr std::size_t kMsgHelloSize =
145 constexpr std::size_t kMsgWelcomeSize =
150 constexpr std::size_t kMsgRejectSize =
154 constexpr std::size_t kMsgLevelInfoSize =
158 constexpr std::size_t kMsgLobbyReadySize =
161 constexpr std::size_t kMsgMatchLoadedSize =
164 constexpr std::size_t kMsgMatchStartSize =
169 constexpr std::size_t kMsgMatchCancelledSize =
172 constexpr std::size_t kMsgMatchResultSize =
178 constexpr std::size_t kMsgLobbyStateSeatSize =
183 constexpr std::size_t kMsgLobbyStateSize =
189 constexpr std::size_t kMsgInputSize =
194 constexpr std::size_t kMsgSnapshotSize =
215 constexpr std::size_t kMsgCorrectionSize =
224 constexpr std::size_t kMsgBombPlacedSize =
233 constexpr std::size_t kMsgExplosionResolvedSize =
251 static_assert(
sizeof(char) == 1,
"Unexpected char size");
253 static_assert(kPacketHeaderSize == 3,
"PacketHeader size mismatch");
254 static_assert(kMsgHelloSize == 18,
"MsgHello size mismatch");
255 static_assert(kMsgWelcomeSize == 5,
"MsgWelcome size mismatch");
256 static_assert(kMsgRejectSize == 3,
"MsgReject size mismatch");
257 static_assert(kMsgLevelInfoSize == 8,
"MsgLevelInfo size mismatch");
258 static_assert(kMsgLobbyReadySize == 1,
"MsgLobbyReady size mismatch");
259 static_assert(kMsgMatchLoadedSize == 4,
"MsgMatchLoaded size mismatch");
260 static_assert(kMsgMatchStartSize == 12,
"MsgMatchStart size mismatch");
261 static_assert(kMsgMatchCancelledSize == 4,
"MsgMatchCancelled size mismatch");
262 static_assert(kMsgMatchResultSize == 22,
"MsgMatchResult size mismatch");
263 static_assert(kMsgLobbyStateSeatSize == 18,
"MsgLobbyState seat size mismatch");
264 static_assert(kMsgLobbyStateSize == 76,
"MsgLobbyState size mismatch");
265 static_assert(kMsgInputSize == 21,
"MsgInput size mismatch");
266 static_assert(kMsgSnapshotSize == 111,
"MsgSnapshot size mismatch");
267 static_assert(kMsgCorrectionSize == 20,
"MsgCorrection size mismatch");
268 static_assert(kMsgBombPlacedSize == 16,
"MsgBombPlaced size mismatch");
269 static_assert(kMsgExplosionResolvedSize == 497,
"MsgExplosionResolved size mismatch");
277 constexpr std::size_t kSnapshotPlayerEntrySize =
282 constexpr std::size_t kSnapshotBombsOffset =
284 constexpr std::size_t kSnapshotBombEntrySize =
289 constexpr std::size_t kSnapshotPowerupsOffset =
291 constexpr std::size_t kSnapshotPowerupEntrySize =
296 constexpr std::size_t kExplosionBlastCellsOffset =
306 constexpr std::size_t kExplosionCellEntrySize =
309 constexpr std::size_t kExplosionDestroyedBricksOffset =
377 default:
return "Unknown";
401 return EChannel::ControlReliable;
403 return EChannel::InputUnreliable;
405 return EChannel::SnapshotUnreliable;
407 return EChannel::CorrectionUnreliable;
410 return EChannel::GameplayReliable;
412 return EChannel::ControlReliable;
425 return kExplosionBlastCellsOffset + index * kExplosionCellEntrySize;
431 return kExplosionDestroyedBricksOffset + index * kExplosionCellEntrySize;
437 return col < ::bomberman::tileArrayWidth && row < ::bomberman::tileArrayHeight;
441 constexpr uint16_t
tileCellKey(
const uint8_t col,
const uint8_t row)
443 return static_cast<uint16_t
>(row) *
static_cast<uint16_t
>(::bomberman::tileArrayWidth) +
444 static_cast<uint16_t
>(col);
527 VersionMismatch = 0x01,
580 enum class EResult : uint8_t
600 enum class EPhase : uint8_t
608 enum class ESeatFlags : uint8_t
615 static constexpr uint8_t kKnownFlags =
616 static_cast<uint8_t
>(ESeatFlags::Occupied) |
617 static_cast<uint8_t
>(ESeatFlags::Ready);
619 ESeatFlags
flags = ESeatFlags::None;
630 static_assert(
sizeof(MsgLobbyState::SeatEntry) == kMsgLobbyStateSeatSize,
"MsgLobbyState::SeatEntry size mismatch");
631 static_assert(
sizeof(MsgLobbyState) == kMsgLobbyStateSize,
"MsgLobbyState size mismatch");
697 static constexpr uint8_t kKnownFlags =
799 out[0] =
static_cast<uint8_t
>(value & 0xFFu);
800 out[1] =
static_cast<uint8_t
>((value >> 8u) & 0xFFu);
806 out[0] =
static_cast<uint8_t
>(value & 0xFFu);
807 out[1] =
static_cast<uint8_t
>((value >> 8u) & 0xFFu);
808 out[2] =
static_cast<uint8_t
>((value >> 16u) & 0xFFu);
809 out[3] =
static_cast<uint8_t
>((value >> 24u) & 0xFFu);
815 return static_cast<uint16_t
>(in[0]) |
816 (
static_cast<uint16_t
>(in[1]) << 8u);
822 return static_cast<uint32_t
>(in[0]) |
823 (
static_cast<uint32_t
>(in[1]) << 8u) |
824 (
static_cast<uint32_t
>(in[2]) << 16u) |
825 (
static_cast<uint32_t
>(in[3]) << 24u);
831 constexpr std::size_t
boundedStrLen(
const char* s,
const std::size_t maxBytes)
835 std::size_t length = 0;
836 while(length < maxBytes && s[length] !=
'\0')
852 return kSnapshotBombsOffset + index * kSnapshotBombEntrySize;
858 return kSnapshotPowerupsOffset + index * kSnapshotPowerupEntrySize;
867 std::memcpy(hello.
name, name.data(), copyLen);
884 return (flags &
static_cast<uint8_t
>(~MsgLobbyState::SeatEntry::kKnownFlags)) == 0;
890 return rawPhase ==
static_cast<uint8_t
>(MsgLobbyState::EPhase::Idle) ||
891 rawPhase ==
static_cast<uint8_t
>(MsgLobbyState::EPhase::Countdown);
900 std::memcpy(seat.
name, name.data(), copyLen);
909 std::memcpy(matchResult.
winnerName, name.data(), copyLen);
929 return (
static_cast<uint8_t
>(seat.
flags) &
930 static_cast<uint8_t
>(MsgLobbyState::SeatEntry::ESeatFlags::Occupied)) != 0;
936 return (
static_cast<uint8_t
>(seat.
flags) &
937 static_cast<uint8_t
>(MsgLobbyState::SeatEntry::ESeatFlags::Ready)) != 0;
943 return lobbyState.
phase == MsgLobbyState::EPhase::Countdown &&
956 out[0] =
static_cast<uint8_t
>(header.type);
968 if (inSize < kPacketHeaderSize)
973 const uint8_t rawType = in[0];
979 const uint16_t payloadSize =
readU16LE(in + 1);
980 if (inSize != kPacketHeaderSize + payloadSize)
986 const auto msgType =
static_cast<EMsgType>(rawType);
988 if (expected > 0 && payloadSize != expected)
993 outHeader.
type = msgType;
1006 std::memcpy(out + 2, hello.name, nameLen);
1013 if (inSize < kMsgHelloSize)
1033 out[2] = welcome.playerId;
1041 if (inSize < kMsgWelcomeSize)
1058 out[0] =
static_cast<uint8_t
>(reject.reason);
1059 writeU16LE(out + 1, reject.expectedProtocolVersion);
1066 if (inSize < kMsgRejectSize)
1073 switch (outReject.
reason)
1075 case MsgReject::EReason::VersionMismatch:
1078 case MsgReject::EReason::ServerFull:
1079 case MsgReject::EReason::Banned:
1081 case MsgReject::EReason::Other:
1102 if (inSize < kMsgLevelInfoSize)
1124 out[0] = ready.ready != 0 ? 1u : 0u;
1131 if (inSize < kMsgLobbyReadySize)
1141 outReady.
ready = in[0];
1155 if (inSize < kMsgMatchLoadedSize)
1161 return outLoaded.
matchId != 0;
1168 writeU32LE(out + 4, matchStart.goShowServerTick);
1169 writeU32LE(out + 8, matchStart.unlockServerTick);
1176 if (inSize < kMsgMatchStartSize)
1184 return outMatchStart.
matchId != 0 &&
1202 if (inSize < kMsgMatchCancelledSize)
1208 return outCancelled.
matchId != 0;
1215 out[4] =
static_cast<uint8_t
>(matchResult.result);
1216 out[5] = matchResult.winnerPlayerId;
1219 std::memcpy(out + 6, matchResult.winnerName, nameLen);
1226 if (inSize < kMsgMatchResultSize)
1232 outMatchResult.
result =
static_cast<MsgMatchResult::EResult
>(in[4]);
1237 switch (outMatchResult.
result)
1239 case MsgMatchResult::EResult::Draw:
1242 return outMatchResult.
matchId != 0;
1243 case MsgMatchResult::EResult::Win:
1257 out[0] =
static_cast<uint8_t
>(lobbyState.phase);
1258 out[1] = lobbyState.countdownSecondsRemaining;
1263 const auto offset = 4 + i * kMsgLobbyStateSeatSize;
1264 const auto& seat = lobbyState.seats[i];
1266 out[offset] =
static_cast<uint8_t
>(seat.flags);
1267 out[offset + 1] = seat.wins;
1270 std::memcpy(out + offset + 2, seat.name, nameLen);
1278 if (inSize < kMsgLobbyStateSize)
1288 outLobbyState.
phase =
static_cast<MsgLobbyState::EPhase
>(in[0]);
1295 if (outLobbyState.
phase == MsgLobbyState::EPhase::Countdown)
1309 const auto offset = 4 + i * kMsgLobbyStateSeatSize;
1310 auto& seat = outLobbyState.
seats[i];
1312 const uint8_t rawFlags = in[offset];
1317 if ((rawFlags &
static_cast<uint8_t
>(MsgLobbyState::SeatEntry::ESeatFlags::Ready)) != 0 &&
1318 (rawFlags &
static_cast<uint8_t
>(MsgLobbyState::SeatEntry::ESeatFlags::Occupied)) == 0)
1323 seat.
flags =
static_cast<MsgLobbyState::SeatEntry::ESeatFlags
>(rawFlags);
1324 seat.wins = in[offset + 1];
1353 out[4] = input.count;
1361 if (inSize < kMsgInputSize)
1367 outInput.
count = in[4];
1383 for (uint8_t i = 0; i < outInput.
count; ++i)
1408 out[8] = playerCount;
1410 out[10] = powerupCount;
1414 const auto& player = snap.players[i];
1416 out[offset] = player.playerId;
1417 writeU16LE(out + offset + 1,
static_cast<uint16_t
>(player.xQ));
1418 writeU16LE(out + offset + 3,
static_cast<uint16_t
>(player.yQ));
1419 out[offset + 5] =
static_cast<uint8_t
>(player.flags);
1424 const auto& bomb = snap.bombs[i];
1426 out[offset] = bomb.ownerId;
1427 out[offset + 1] = bomb.col;
1428 out[offset + 2] = bomb.row;
1429 out[offset + 3] = bomb.radius;
1434 const auto& powerup = snap.powerups[i];
1436 out[offset] =
static_cast<uint8_t
>(powerup.type);
1437 out[offset + 1] = powerup.col;
1438 out[offset + 2] = powerup.row;
1446 if (inSize < kMsgSnapshotSize)
1469 uint8_t seenPlayerMask = 0;
1470 uint8_t previousPlayerId = 0;
1471 bool hasPreviousPlayer =
false;
1476 auto& player = outSnap.
players[i];
1478 player.xQ =
static_cast<int16_t
>(
readU16LE(in + offset + 1));
1479 player.yQ =
static_cast<int16_t
>(
readU16LE(in + offset + 3));
1480 const uint8_t rawFlags = in[offset + 5];
1489 if (hasPreviousPlayer && player.playerId <= previousPlayerId)
1494 const uint8_t playerBit =
static_cast<uint8_t
>(1u << player.playerId);
1495 if ((seenPlayerMask & playerBit) != 0)
1499 seenPlayerMask |= playerBit;
1500 previousPlayerId = player.playerId;
1501 hasPreviousPlayer =
true;
1503 if ((rawFlags & ~MsgSnapshot::PlayerEntry::kKnownFlags) != 0)
1512 uint16_t previousBombCellKey = 0;
1513 bool hasPreviousBomb =
false;
1517 auto& bomb = outSnap.
bombs[i];
1519 bomb.col = in[offset + 1];
1520 bomb.row = in[offset + 2];
1521 bomb.radius = in[offset + 3];
1529 if (bomb.col >= ::bomberman::tileArrayWidth || bomb.row >= ::bomberman::tileArrayHeight)
1533 if (bomb.radius == 0)
1538 const uint16_t bombCellKey =
1539 static_cast<uint16_t
>(bomb.row) *
static_cast<uint16_t
>(::bomberman::tileArrayWidth) +
1540 static_cast<uint16_t
>(bomb.col);
1541 if (hasPreviousBomb && bombCellKey <= previousBombCellKey)
1546 previousBombCellKey = bombCellKey;
1547 hasPreviousBomb =
true;
1551 uint16_t previousPowerupCellKey = 0;
1552 bool hasPreviousPowerup =
false;
1556 auto& powerup = outSnap.
powerups[i];
1557 const uint8_t rawType = in[offset];
1559 powerup.col = in[offset + 1];
1560 powerup.row = in[offset + 2];
1565 powerup.col >= ::bomberman::tileArrayWidth ||
1566 powerup.row >= ::bomberman::tileArrayHeight)
1571 const uint16_t powerupCellKey =
1572 static_cast<uint16_t
>(powerup.row) *
static_cast<uint16_t
>(::bomberman::tileArrayWidth) +
1573 static_cast<uint16_t
>(powerup.col);
1574 if (hasPreviousPowerup && powerupCellKey <= previousPowerupCellKey)
1579 previousPowerupCellKey = powerupCellKey;
1580 hasPreviousPowerup =
true;
1592 writeU32LE(out + 8, corr.lastProcessedInputSeq);
1593 writeU16LE(out + 12,
static_cast<uint16_t
>(corr.xQ));
1594 writeU16LE(out + 14,
static_cast<uint16_t
>(corr.yQ));
1595 out[16] = corr.playerFlags;
1605 if (inSize < kMsgCorrectionSize)
1612 outCorr.
xQ =
static_cast<int16_t
>(
readU16LE(in + 12));
1613 outCorr.
yQ =
static_cast<int16_t
>(
readU16LE(in + 14));
1624 out[12] = bombPlaced.ownerId;
1625 out[13] = bombPlaced.col;
1626 out[14] = bombPlaced.row;
1627 out[15] = bombPlaced.radius;
1634 if (inSize < kMsgBombPlacedSize)
1642 outBombPlaced.
ownerId = in[12];
1643 outBombPlaced.
col = in[13];
1644 outBombPlaced.
row = in[14];
1645 outBombPlaced.
radius = in[15];
1668 out[8] = explosion.ownerId;
1669 out[9] = explosion.originCol;
1670 out[10] = explosion.originRow;
1671 out[11] = explosion.radius;
1672 out[12] = explosion.killedPlayerMask;
1674 explosion.blastCellCount :
1677 explosion.destroyedBrickCount :
1683 out[offset] = explosion.blastCells[i].col;
1684 out[offset + 1] = explosion.blastCells[i].row;
1690 out[offset] = explosion.destroyedBricks[i].col;
1691 out[offset + 1] = explosion.destroyedBricks[i].row;
1701 if (inSize < kMsgExplosionResolvedSize)
1711 outExplosion.
radius = in[11];
1724 if (outExplosion.
radius == 0)
1742 std::array<bool, static_cast<std::size_t>(::bomberman::tileArrayWidth) *
1743 static_cast<std::size_t
>(::bomberman::tileArrayHeight)> seenBlastCells{};
1744 std::array<bool, static_cast<std::size_t>(::bomberman::tileArrayWidth) *
1745 static_cast<std::size_t
>(::bomberman::tileArrayHeight)> seenDestroyedBricks{};
1751 cell.
col = in[offset];
1752 cell.row = in[offset + 1];
1761 const std::size_t cellIndex =
tileCellKey(cell.col, cell.row);
1762 if (seenBlastCells[cellIndex])
1767 seenBlastCells[cellIndex] =
true;
1781 cell.
col = in[offset];
1782 cell.row = in[offset + 1];
1791 const std::size_t cellIndex =
tileCellKey(cell.col, cell.row);
1792 if (!seenBlastCells[cellIndex] || seenDestroyedBricks[cellIndex])
1797 seenDestroyedBricks[cellIndex] =
true;
1815 header.payloadSize =
static_cast<uint16_t
>(kMsgHelloSize);
1817 std::array<uint8_t, kPacketHeaderSize + kMsgHelloSize> bytes{};
1824 inline std::array<uint8_t, kPacketHeaderSize + kMsgHelloSize>
makeHelloPacket(std::string_view name, uint16_t protocolVersion)
1837 header.payloadSize =
static_cast<uint16_t
>(kMsgWelcomeSize);
1839 std::array<uint8_t, kPacketHeaderSize + kMsgWelcomeSize> bytes{};
1851 header.payloadSize =
static_cast<uint16_t
>(kMsgRejectSize);
1853 std::array<uint8_t, kPacketHeaderSize + kMsgRejectSize> bytes{};
1865 header.payloadSize =
static_cast<uint16_t
>(kMsgLevelInfoSize);
1867 std::array<uint8_t, kPacketHeaderSize + kMsgLevelInfoSize> bytes{};
1879 header.payloadSize =
static_cast<uint16_t
>(kMsgLobbyReadySize);
1881 std::array<uint8_t, kPacketHeaderSize + kMsgLobbyReadySize> bytes{};
1892 msg.
ready = ready ? 1u : 0u;
1901 header.payloadSize =
static_cast<uint16_t
>(kMsgMatchLoadedSize);
1903 std::array<uint8_t, kPacketHeaderSize + kMsgMatchLoadedSize> bytes{};
1923 header.payloadSize =
static_cast<uint16_t
>(kMsgMatchStartSize);
1925 std::array<uint8_t, kPacketHeaderSize + kMsgMatchStartSize> bytes{};
1934 const uint32_t goShowServerTick,
1935 const uint32_t unlockServerTick)
1939 matchStart.goShowServerTick = goShowServerTick;
1940 matchStart.unlockServerTick = unlockServerTick;
1950 header.payloadSize =
static_cast<uint16_t
>(kMsgMatchCancelledSize);
1952 std::array<uint8_t, kPacketHeaderSize + kMsgMatchCancelledSize> bytes{};
1961 const uint32_t matchId)
1974 header.payloadSize =
static_cast<uint16_t
>(kMsgMatchResultSize);
1976 std::array<uint8_t, kPacketHeaderSize + kMsgMatchResultSize> bytes{};
1988 header.payloadSize =
static_cast<uint16_t
>(kMsgLobbyStateSize);
1990 std::array<uint8_t, kPacketHeaderSize + kMsgLobbyStateSize> bytes{};
2004 header.payloadSize =
static_cast<uint16_t
>(kMsgInputSize);
2006 std::array<uint8_t, kPacketHeaderSize + kMsgInputSize> bytes{};
2018 header.payloadSize =
static_cast<uint16_t
>(kMsgSnapshotSize);
2020 std::array<uint8_t, kPacketHeaderSize + kMsgSnapshotSize> bytes{};
2032 header.payloadSize =
static_cast<uint16_t
>(kMsgCorrectionSize);
2034 std::array<uint8_t, kPacketHeaderSize + kMsgCorrectionSize> bytes{};
2046 header.payloadSize =
static_cast<uint16_t
>(kMsgBombPlacedSize);
2048 std::array<uint8_t, kPacketHeaderSize + kMsgBombPlacedSize> bytes{};
2061 header.payloadSize =
static_cast<uint16_t
>(kMsgExplosionResolvedSize);
2063 std::array<uint8_t, kPacketHeaderSize + kMsgExplosionResolvedSize> bytes{};
Game-world configuration constants.
constexpr unsigned int tileArrayWidth
Tile map width in tiles.
Definition Const.h:43
constexpr unsigned int tileArrayHeight
Tile map height in tiles.
Definition Const.h:44
Shared multiplayer powerup types and round-setup tuning.
Shared multiplayer protocol types and transport-facing wire helpers.
Definition ClientPrediction.cpp:13
bool deserializeMsgExplosionResolved(const uint8_t *in, std::size_t inSize, MsgExplosionResolved &outExplosion)
Deserializes MsgExplosionResolved from fixed-size wire payload.
Definition NetCommon.h:1697
constexpr std::string_view msgTypeName(EMsgType type)
Returns a human-readable name for a protocol message type.
Definition NetCommon.h:357
constexpr bool isValidPlayerMask(const uint32_t mask)
Returns true when the given player-id bitmask uses only valid player bits.
Definition NetCommon.h:417
void serializeMsgMatchLoaded(const MsgMatchLoaded &loaded, uint8_t *out) noexcept
Serializes MsgMatchLoaded to fixed-size wire payload.
Definition NetCommon.h:1146
constexpr bool isValidLobbySeatFlags(const uint8_t flags)
Returns true when one lobby-seat flag field contains only known bits.
Definition NetCommon.h:882
bool deserializeHeader(const uint8_t *in, std::size_t inSize, PacketHeader &outHeader)
Deserializes and validates PacketHeader.
Definition NetCommon.h:966
void setHelloName(MsgHello &hello, std::string_view name)
Sets MsgHello::name from string_view with truncation and zero padding.
Definition NetCommon.h:862
constexpr std::size_t boundedStrLen(const char *s, const std::size_t maxBytes)
Returns string length capped to maxBytes for bounded C strings.
Definition NetCommon.h:831
constexpr bool isValidLobbyPhase(const uint8_t rawPhase)
Returns true when one lobby-state phase field contains a known encoding.
Definition NetCommon.h:888
bool deserializeMsgMatchStart(const uint8_t *in, std::size_t inSize, MsgMatchStart &outMatchStart)
Deserializes MsgMatchStart from fixed-size wire payload.
Definition NetCommon.h:1174
bool deserializeMsgCorrection(const uint8_t *in, std::size_t inSize, MsgCorrection &outCorr)
Deserializes MsgCorrection from fixed-size wire payload.
Definition NetCommon.h:1603
constexpr int8_t buttonsToMoveY(uint8_t buttons)
Derives vertical movement {-1, 0, 1} from a button bitmask.
Definition NetCommon.h:90
constexpr bool lobbyCountdownActive(const MsgLobbyState &lobbyState)
Returns true when the authoritative lobby is in the visible pre-match countdown phase.
Definition NetCommon.h:941
constexpr uint8_t kInputKnownBits
Union of all defined input bits. Used for unknown-bit rejection.
Definition NetCommon.h:78
constexpr uint32_t kSnapshotLogEveryN
Snapshot log sampling interval on client and server.
Definition NetCommon.h:46
void serializeMsgLobbyReady(const MsgLobbyReady &ready, uint8_t *out) noexcept
Serializes MsgLobbyReady to a fixed-size wire payload.
Definition NetCommon.h:1122
constexpr bool isValidLobbyReadyValue(const uint8_t ready)
Returns true when one lobby-ready value uses a known wire encoding.
Definition NetCommon.h:1116
constexpr std::size_t kPlayerNameMax
Definition NetCommon.h:53
bool deserializeMsgMatchCancelled(const uint8_t *in, std::size_t inSize, MsgMatchCancelled &outCancelled)
Deserializes MsgMatchCancelled from fixed-size wire payload.
Definition NetCommon.h:1198
bool deserializeMsgMatchResult(const uint8_t *in, std::size_t inSize, MsgMatchResult &outMatchResult)
Deserializes MsgMatchResult from fixed-size wire payload.
Definition NetCommon.h:1224
std::array< uint8_t, kPacketHeaderSize+kMsgMatchCancelledSize > makeMatchCancelledPacket(const MsgMatchCancelled &cancelled)
Builds a full MatchCancelled packet (header + payload).
Definition NetCommon.h:1945
bool deserializeMsgReject(const uint8_t *in, std::size_t inSize, MsgReject &outReject)
Deserializes MsgReject from fixed-size wire payload.
Definition NetCommon.h:1064
void serializeMsgBombPlaced(const MsgBombPlaced &bombPlaced, uint8_t *out) noexcept
Serializes MsgBombPlaced to fixed-size wire payload.
Definition NetCommon.h:1619
constexpr std::size_t explosionBlastCellOffset(std::size_t index)
Returns the payload offset of the explosion blast-cell entry at index.
Definition NetCommon.h:423
constexpr bool isExpectedChannelFor(EMsgType type, uint8_t channelId)
Returns true when a message was received on its expected ENet channel.
Definition NetCommon.h:448
bool deserializeMsgHello(const uint8_t *in, std::size_t inSize, MsgHello &outHello)
Deserializes MsgHello from fixed-size wire payload.
Definition NetCommon.h:1011
bool deserializeMsgWelcome(const uint8_t *in, std::size_t inSize, MsgWelcome &outWelcome)
Deserializes MsgWelcome from fixed-size wire payload.
Definition NetCommon.h:1039
void serializeMsgInput(const MsgInput &input, uint8_t *out) noexcept
Serializes MsgInput to its fixed-size wire payload.
Definition NetCommon.h:1350
std::string_view matchResultWinnerName(const MsgMatchResult &matchResult)
Returns the visible winner display name carried by one match-result payload.
Definition NetCommon.h:921
std::array< uint8_t, kPacketHeaderSize+kMsgExplosionResolvedSize > makeExplosionResolvedPacket(const MsgExplosionResolved &explosion)
Builds a full ExplosionResolved packet (header + payload).
Definition NetCommon.h:2056
constexpr uint8_t kMaxInputBatchSize
Maximum number of inputs in a single batched MsgInput packet.
Definition NetCommon.h:67
constexpr std::size_t kMaxExplosionDestroyedBricks
Upper bound for bricks one blast can destroy.
Definition NetCommon.h:61
std::array< uint8_t, kPacketHeaderSize+kMsgInputSize > makeInputPacket(const MsgInput &input)
Builds a full Input packet (header + payload).
Definition NetCommon.h:2000
bool deserializeMsgInput(const uint8_t *in, std::size_t inSize, MsgInput &outInput)
Deserializes MsgInput from fixed-size wire payload.
Definition NetCommon.h:1359
EChannel
ENet channel identifiers used by the current protocol.
Definition NetCommon.h:108
constexpr bool lobbySeatIsReady(const MsgLobbyState::SeatEntry &seat)
Returns true when one occupied lobby seat is marked ready.
Definition NetCommon.h:934
constexpr std::string_view channelName(uint8_t id)
Returns a human-readable name for a channel ID.
Definition NetCommon.h:118
std::array< uint8_t, kPacketHeaderSize+kMsgMatchResultSize > makeMatchResultPacket(const MsgMatchResult &matchResult)
Builds a full MatchResult packet (header + payload).
Definition NetCommon.h:1969
void serializeMsgLobbyState(const MsgLobbyState &lobbyState, uint8_t *out) noexcept
Serializes MsgLobbyState to fixed-size wire payload.
Definition NetCommon.h:1255
constexpr uint32_t kPeerTimeoutLimit
Consecutive timeout limit before ENet drops a peer.
Definition NetCommon.h:48
constexpr uint32_t readU32LE(const uint8_t *in)
Reads a 32-bit value encoded as little-endian.
Definition NetCommon.h:820
constexpr EChannel expectedChannelFor(EMsgType type)
Returns the required ENet channel for a protocol message type.
Definition NetCommon.h:387
void setMatchResultWinnerName(MsgMatchResult &matchResult, std::string_view name)
Sets one match-result winner display name with truncation and zero padding.
Definition NetCommon.h:904
void serializeMsgReject(const MsgReject &reject, uint8_t *out) noexcept
Serializes MsgReject to fixed-size wire payload.
Definition NetCommon.h:1056
constexpr std::size_t expectedPayloadSize(EMsgType type)
Returns the exact expected payload size for a message type.
Definition NetCommon.h:460
std::array< uint8_t, kPacketHeaderSize+kMsgCorrectionSize > makeCorrectionPacket(const MsgCorrection &corr)
Builds a full Correction packet (header + payload).
Definition NetCommon.h:2028
constexpr uint16_t readU16LE(const uint8_t *in)
Reads a 16-bit value encoded as little-endian.
Definition NetCommon.h:813
constexpr uint32_t kPeerPingIntervalMs
Transport heartbeat interval for connected peers.
Definition NetCommon.h:47
constexpr uint32_t kInputLogEveryN
Input log sampling interval on client and server.
Definition NetCommon.h:45
constexpr std::size_t snapshotBombOffset(std::size_t index)
Returns the payload offset of the snapshot bomb entry at index.
Definition NetCommon.h:850
std::array< uint8_t, kPacketHeaderSize+kMsgHelloSize > makeHelloPacket(const MsgHello &hello)
Builds a full Hello packet (header + payload).
Definition NetCommon.h:1811
void serializeMsgMatchStart(const MsgMatchStart &matchStart, uint8_t *out) noexcept
Serializes MsgMatchStart to fixed-size wire payload.
Definition NetCommon.h:1165
void serializeMsgLevelInfo(const MsgLevelInfo &info, uint8_t *out) noexcept
Serializes MsgLevelInfo to fixed-size wire payload.
Definition NetCommon.h:1092
constexpr int8_t buttonsToMoveX(uint8_t buttons)
Derives horizontal movement {-1, 0, 1} from a button bitmask.
Definition NetCommon.h:81
std::array< uint8_t, kPacketHeaderSize+kMsgMatchStartSize > makeMatchStartPacket(const MsgMatchStart &matchStart)
Builds a full MatchStart packet (header + payload).
Definition NetCommon.h:1919
std::array< uint8_t, kPacketHeaderSize+kMsgWelcomeSize > makeWelcomePacket(const MsgWelcome &welcome)
Builds a full Welcome packet (header + payload).
Definition NetCommon.h:1833
constexpr bool lobbySeatIsOccupied(const MsgLobbyState::SeatEntry &seat)
Returns true when one lobby seat is currently occupied.
Definition NetCommon.h:927
constexpr uint32_t kPeerTimeoutMaximumMs
Upper bound for ENet peer timeout detection.
Definition NetCommon.h:50
constexpr uint16_t tileCellKey(const uint8_t col, const uint8_t row)
Packs one tile cell into a monotonic key for ordering and deduplication.
Definition NetCommon.h:441
constexpr uint32_t kPeerTimeoutMinimumMs
Lower bound for ENet peer timeout detection.
Definition NetCommon.h:49
bool deserializeMsgLevelInfo(const uint8_t *in, std::size_t inSize, MsgLevelInfo &outInfo)
Deserializes MsgLevelInfo from fixed-size wire payload.
Definition NetCommon.h:1100
constexpr std::size_t kMaxPacketSize
Upper packet size bound (below typical 1500-byte MTU).
Definition NetCommon.h:44
void serializeMsgWelcome(const MsgWelcome &welcome, uint8_t *out) noexcept
Serializes MsgWelcome to fixed-size wire payload.
Definition NetCommon.h:1030
constexpr uint8_t kMaxSnapshotPowerups
Maximum revealed powerups carried by one snapshot payload.
Definition NetCommon.h:56
std::array< uint8_t, kPacketHeaderSize+kMsgLevelInfoSize > makeLevelInfoPacket(const MsgLevelInfo &info)
Builds a full LevelInfo packet (header + payload).
Definition NetCommon.h:1861
void serializeMsgCorrection(const MsgCorrection &corr, uint8_t *out) noexcept
Serializes MsgCorrection to fixed-size wire payload.
Definition NetCommon.h:1588
constexpr bool isValidTileCell(const uint8_t col, const uint8_t row)
Returns true when the given cell lies within the current tile-map bounds.
Definition NetCommon.h:435
bool deserializeMsgMatchLoaded(const uint8_t *in, std::size_t inSize, MsgMatchLoaded &outLoaded)
Deserializes MsgMatchLoaded from fixed-size wire payload.
Definition NetCommon.h:1153
std::array< uint8_t, kPacketHeaderSize+kMsgSnapshotSize > makeSnapshotPacket(const MsgSnapshot &snap)
Builds a full Snapshot packet (header + payload).
Definition NetCommon.h:2014
std::array< uint8_t, kPacketHeaderSize+kMsgRejectSize > makeRejectPacket(const MsgReject &reject)
Builds a full Reject packet (header + payload).
Definition NetCommon.h:1847
constexpr std::size_t kChannelCount
Number of ENet channels provisioned by client and server.
Definition NetCommon.h:115
constexpr std::size_t kMaxExplosionBlastCells
Maximum cells a cross-shaped blast can touch.
Definition NetCommon.h:57
EMsgType
Message type identifiers used in packet headers.
Definition NetCommon.h:316
@ LobbyReady
Client message indicating the local player's ready status for the next round.
@ Input
Client message containing a batch of input bitmasks and their base sequence number.
@ MatchStart
Server message indicating the authoritative server tick for round start and the unlock tick for early...
@ LevelInfo
Server message containing map seed and match id for an upcoming round.
@ Invalid
Invalid or uninitialized message type.
@ LobbyState
Server message containing current lobby state.
@ BombPlaced
Server message indicating that a bomb has been placed by a player.
@ MatchResult
Server message containing the result of a completed match.
@ MatchCancelled
Server message indicating that the current match has been cancelled due to a player disconnect.
@ Welcome
Server handshake acceptance message.
@ Hello
Client-initiated handshake message.
@ Correction
Server message containing an authoritative correction to the local player's state.
@ ExplosionResolved
Server message containing the authoritative result of a bomb explosion.
@ MatchLoaded
Server message indicating that all players have loaded the level and the match is ready to start.
@ Snapshot
Server message containing the authoritative game state for a single tick.
@ Reject
Server handshake rejection message.
bool isValidMsgType(uint8_t raw)
Checks whether a raw byte value corresponds to a valid EMsgType.
Definition NetCommon.h:337
void serializeMsgExplosionResolved(const MsgExplosionResolved &explosion, uint8_t *out) noexcept
Serializes MsgExplosionResolved to fixed-size wire payload.
Definition NetCommon.h:1664
constexpr std::size_t snapshotPlayerOffset(std::size_t index)
Returns the payload offset of the snapshot player entry at index.
Definition NetCommon.h:844
void setLobbySeatName(MsgLobbyState::SeatEntry &seat, std::string_view name)
Sets one lobby-seat display name with truncation and zero padding.
Definition NetCommon.h:895
void serializeMsgMatchCancelled(const MsgMatchCancelled &cancelled, uint8_t *out) noexcept
Serializes MsgMatchCancelled to fixed-size wire payload.
Definition NetCommon.h:1191
std::string_view lobbySeatName(const MsgLobbyState::SeatEntry &seat)
Returns the visible lobby-seat display name.
Definition NetCommon.h:914
std::array< uint8_t, kPacketHeaderSize+kMsgBombPlacedSize > makeBombPlacedPacket(const MsgBombPlaced &bombPlaced)
Builds a full BombPlaced packet (header + payload).
Definition NetCommon.h:2042
constexpr std::size_t kSnapshotPlayersOffset
Compile-time checks for expected wire sizes.
Definition NetCommon.h:271
std::array< uint8_t, kPacketHeaderSize+kMsgLobbyStateSize > makeLobbyStatePacket(const MsgLobbyState &lobbyState)
Builds a full LobbyState packet (header + payload).
Definition NetCommon.h:1984
constexpr void writeU16LE(uint8_t *out, uint16_t value)
Writes a 16-bit value using little-endian encoding.
Definition NetCommon.h:797
constexpr std::size_t snapshotPowerupOffset(std::size_t index)
Returns the payload offset of the snapshot powerup entry at index.
Definition NetCommon.h:856
void serializeMsgMatchResult(const MsgMatchResult &matchResult, uint8_t *out) noexcept
Serializes MsgMatchResult to fixed-size wire payload.
Definition NetCommon.h:1212
constexpr uint32_t kFirstInputSeq
First valid input sequence number. Seq 0 means "no input received yet".
Definition NetCommon.h:64
constexpr std::size_t explosionDestroyedBrickOffset(std::size_t index)
Returns the payload offset of the explosion destroyed-brick entry at index.
Definition NetCommon.h:429
constexpr void writeU32LE(uint8_t *out, uint32_t value)
Writes a 32-bit value using little-endian encoding.
Definition NetCommon.h:804
constexpr uint8_t kMaxSnapshotBombs
Maximum bombs carried by one snapshot payload.
Definition NetCommon.h:55
std::array< uint8_t, kPacketHeaderSize+kMsgMatchLoadedSize > makeMatchLoadedPacket(const MsgMatchLoaded &loaded)
Builds a full MatchLoaded packet (header + payload).
Definition NetCommon.h:1897
void serializeMsgHello(const MsgHello &hello, uint8_t *out) noexcept
Serializes MsgHello to fixed-size wire payload.
Definition NetCommon.h:1001
bool deserializeMsgLobbyReady(const uint8_t *in, std::size_t inSize, MsgLobbyReady &outReady)
Deserializes MsgLobbyReady from a fixed-size wire payload.
Definition NetCommon.h:1129
constexpr uint8_t kMaxPlayers
Maximum supported player count in a game instance.
Definition NetCommon.h:54
bool deserializeMsgSnapshot(const uint8_t *in, std::size_t inSize, MsgSnapshot &outSnap)
Deserializes MsgSnapshot from fixed-size wire payload.
Definition NetCommon.h:1444
constexpr uint16_t kDefaultServerPort
Default server port used by both client and server.
Definition NetCommon.h:43
void serializeHeader(const PacketHeader &header, uint8_t *out) noexcept
Serializes PacketHeader into kPacketHeaderSize bytes.
Definition NetCommon.h:954
std::array< uint8_t, kPacketHeaderSize+kMsgLobbyReadySize > makeLobbyReadyPacket(const MsgLobbyReady &ready)
Builds a full LobbyReady packet (header + payload).
Definition NetCommon.h:1875
void serializeMsgSnapshot(const MsgSnapshot &snap, uint8_t *out) noexcept
Serializes MsgSnapshot to its fixed-size wire payload.
Definition NetCommon.h:1401
bool deserializeMsgLobbyState(const uint8_t *in, std::size_t inSize, MsgLobbyState &outLobbyState)
Deserializes MsgLobbyState from fixed-size wire payload.
Definition NetCommon.h:1276
bool deserializeMsgBombPlaced(const uint8_t *in, std::size_t inSize, MsgBombPlaced &outBombPlaced)
Deserializes MsgBombPlaced from fixed-size wire payload.
Definition NetCommon.h:1632
constexpr uint8_t kPowerupsPerRound
Number of hidden powerups seeded into each round when enabled.
Definition PowerupConfig.h:44
PowerupType
Supported temporary multiplayer powerup effects.
Definition PowerupConfig.h:22
constexpr bool isValidPowerupType(const uint8_t rawType)
Returns true when a raw byte encodes one of the defined powerup types.
Definition PowerupConfig.h:81
Reliable discrete bomb-placement event sent by the server.
Definition NetCommon.h:757
uint8_t col
Tile-map column occupied by the bomb.
Definition NetCommon.h:762
uint32_t matchId
Authoritative match identifier that accepted this bomb placement.
Definition NetCommon.h:758
uint8_t radius
Explosion radius snapped at placement time.
Definition NetCommon.h:764
uint32_t serverTick
Server tick at which the bomb placement was accepted.
Definition NetCommon.h:759
uint8_t ownerId
Player identifier [0, kMaxPlayers) that owns this bomb.
Definition NetCommon.h:761
uint32_t explodeTick
Server tick at which this bomb is scheduled to explode.
Definition NetCommon.h:760
uint8_t row
Tile-map row occupied by the bomb.
Definition NetCommon.h:763
Compact tile cell payload reused by reliable gameplay events.
Definition NetCommon.h:650
uint8_t row
Tile-map row.
Definition NetCommon.h:652
uint8_t col
Tile-map column.
Definition NetCommon.h:651
Owner-only correction payload sent by the server.
Definition NetCommon.h:738
int16_t yQ
Corrected Y position in tile-space Q8.
Definition NetCommon.h:743
uint32_t serverTick
Server tick at which this correction applies.
Definition NetCommon.h:740
uint8_t reserved[3]
Currently unused wire padding.
Definition NetCommon.h:745
int16_t xQ
Corrected X position in tile-space Q8.
Definition NetCommon.h:742
uint8_t playerFlags
Owner-local copy of the current replicated player flags.
Definition NetCommon.h:744
uint32_t matchId
Authoritative match identifier that produced this correction.
Definition NetCommon.h:739
uint32_t lastProcessedInputSeq
Highest input seq the server has processed for this player.
Definition NetCommon.h:741
Reliable authoritative explosion-resolution event sent by the server.
Definition NetCommon.h:776
uint8_t ownerId
Player identifier [0, kMaxPlayers) that owned the bomb.
Definition NetCommon.h:779
uint32_t serverTick
Server tick at which the bomb explosion resolved.
Definition NetCommon.h:778
MsgCell destroyedBricks[kMaxExplosionDestroyedBricks]
Brick cells destroyed by this detonation.
Definition NetCommon.h:787
uint8_t originCol
Explosion origin column.
Definition NetCommon.h:780
uint8_t destroyedBrickCount
Number of valid entries stored in destroyedBricks.
Definition NetCommon.h:785
uint8_t originRow
Explosion origin row.
Definition NetCommon.h:781
MsgCell blastCells[kMaxExplosionBlastCells]
Blast footprint cells in propagation order.
Definition NetCommon.h:786
uint8_t blastCellCount
Number of valid entries stored in blastCells.
Definition NetCommon.h:784
uint8_t killedPlayerMask
Bitmask of player ids killed by this resolved explosion.
Definition NetCommon.h:783
uint8_t radius
Radius snapped from the bomb that detonated.
Definition NetCommon.h:782
uint32_t matchId
Authoritative match identifier that resolved this explosion.
Definition NetCommon.h:777
Hello payload sent by client during handshake.
Definition NetCommon.h:501
char name[kPlayerNameMax]
Player display name in a fixed-size wire field.
Definition NetCommon.h:511
uint16_t protocolVersion
Client protocol version.
Definition NetCommon.h:502
Round-start payload sent reliably by the server when a match begins.
Definition NetCommon.h:546
uint32_t matchId
Monotonic authoritative match identifier for this round start.
Definition NetCommon.h:547
uint32_t mapSeed
32-bit seed for the shared tile-map generator.
Definition NetCommon.h:548
Client-authored desired ready state for its currently accepted lobby seat.
Definition NetCommon.h:553
uint8_t ready
1 marks ready, 0 clears ready.
Definition NetCommon.h:554
Definition NetCommon.h:607
uint8_t wins
Server-owned round wins for the current seat occupant.
Definition NetCommon.h:620
char name[kPlayerNameMax]
Seat display name, NUL-terminated and zero-padded when occupied.
Definition NetCommon.h:621
ESeatFlags flags
Occupancy/ready state for this player-id seat.
Definition NetCommon.h:619
Passive lobby seat snapshot sent reliably by the server.
Definition NetCommon.h:599
SeatEntry seats[kMaxPlayers]
Stable player-id keyed lobby seats.
Definition NetCommon.h:627
uint8_t countdownSecondsRemaining
Remaining whole countdown seconds during Countdown.
Definition NetCommon.h:625
uint16_t reserved
Reserved field. Must be zero in the current protocol version.
Definition NetCommon.h:626
EPhase phase
Lobby presentation phase.
Definition NetCommon.h:624
Explicit pre-start cancel edge sent when the current round start is aborted back to lobby.
Definition NetCommon.h:573
uint32_t matchId
Authoritative match identifier that was cancelled before start.
Definition NetCommon.h:574
Client acknowledgement that the gameplay scene for one round start is loaded.
Definition NetCommon.h:559
uint32_t matchId
Authoritative match identifier being acknowledged.
Definition NetCommon.h:560
Reliable end-of-match result edge sent before the automatic return to lobby.
Definition NetCommon.h:579
EResult result
End-of-match result type.
Definition NetCommon.h:587
uint32_t matchId
Authoritative match identifier that just ended.
Definition NetCommon.h:586
char winnerName[kPlayerNameMax]
Winner display name for Win, otherwise zeroed.
Definition NetCommon.h:589
uint8_t winnerPlayerId
Winning player id for Win, otherwise 0xFF.
Definition NetCommon.h:588
Explicit reliable start edge sent once all current match participants have loaded.
Definition NetCommon.h:565
uint32_t matchId
Authoritative match identifier being started.
Definition NetCommon.h:566
uint32_t unlockServerTick
Authoritative server tick at which gameplay input unlocks.
Definition NetCommon.h:568
uint32_t goShowServerTick
Authoritative server tick at which GO! should appear.
Definition NetCommon.h:567
Reject payload sent by server in response to Hello on failure.
Definition NetCommon.h:524
EReason
Definition NetCommon.h:526
@ GameInProgress
Server is not admitting new players outside lobby/pre-start flow.
EReason reason
Rejection reason code.
Definition NetCommon.h:534
uint16_t expectedProtocolVersion
Expected protocol version.
Definition NetCommon.h:536
Definition NetCommon.h:711
uint8_t radius
Explosion radius snapped at placement time.
Definition NetCommon.h:715
uint8_t col
Tile-map column occupied by the bomb.
Definition NetCommon.h:713
uint8_t row
Tile-map row occupied by the bomb.
Definition NetCommon.h:714
uint8_t ownerId
Player identifier [0, kMaxPlayers) that owns this bomb.
Definition NetCommon.h:712
Definition NetCommon.h:681
int16_t yQ
Player Y position in tile-space Q8 (center position).
Definition NetCommon.h:684
int16_t xQ
Player X position in tile-space Q8 (center position).
Definition NetCommon.h:683
uint8_t playerId
Player identifier [0, kMaxPlayers).
Definition NetCommon.h:682
EPlayerFlags flags
Player alive status and other state flags.
Definition NetCommon.h:705
EPlayerFlags
Definition NetCommon.h:687
@ Invulnerable
Player is invulnerable if set.
@ None
No replicated player flags are set.
@ Alive
Player is alive if set, dead if unset.
@ MaxBombsBoost
Player currently has the max-bombs boost active.
@ BombRangeBoost
Player currently has the bomb-range boost active.
@ SpeedBoost
Player currently has the speed boost active.
@ InputLocked
Player input/movement is server-locked if set.
Definition NetCommon.h:721
sim::PowerupType type
Revealed powerup type occupying this cell.
Definition NetCommon.h:722
uint8_t row
Tile-map row occupied by the revealed powerup.
Definition NetCommon.h:724
uint8_t col
Tile-map column occupied by the revealed powerup.
Definition NetCommon.h:723
Snapshot payload broadcast by the server to all clients.
Definition NetCommon.h:673
uint8_t playerCount
Number of active entries stored in players.
Definition NetCommon.h:676
uint32_t matchId
Authoritative match identifier that produced this snapshot.
Definition NetCommon.h:674
PlayerEntry players[kMaxPlayers]
Packed active-player entries; slots beyond playerCount are ignored.
Definition NetCommon.h:708
uint8_t bombCount
Number of active entries stored in bombs.
Definition NetCommon.h:677
PowerupEntry powerups[kMaxSnapshotPowerups]
Packed revealed powerups; slots beyond powerupCount are ignored.
Definition NetCommon.h:727
uint32_t serverTick
Authoritative server tick at which this snapshot was produced.
Definition NetCommon.h:675
uint8_t powerupCount
Number of active revealed entries stored in powerups.
Definition NetCommon.h:678
BombEntry bombs[kMaxSnapshotBombs]
Packed active bombs; slots beyond bombCount are ignored.
Definition NetCommon.h:718
Welcome payload sent by server in response to Hello.
Definition NetCommon.h:516
uint16_t protocolVersion
Server protocol version.
Definition NetCommon.h:517
uint8_t playerId
Server-assigned player identifier [0, kMaxPlayers).
Definition NetCommon.h:518
uint16_t serverTickRate
Authoritative server simulation tick rate. Must be greater than zero.
Definition NetCommon.h:519