player connect-disconnect

This commit is contained in:
Vladislav Khorev committed 2026-11-06 22:07:47 +06:00
1 parent 3f68a8ba07
commit 2e6b93f3ac
16 files changed
+305 -62

No files matched your search

+12 -7
View File
@@ -5,11 +5,12 @@
The Windows WebSocket transport uses Boost.Asio and Boost.Beast to run a
server-sequenced deterministic lockstep simulation. A client receives one
authoritative state at a completed tick boundary. After that, the server sends
only numbered tick messages containing ordered player commands (or an empty
command list).
only numbered tick messages containing ordered destination and presence
commands (or an empty command list).
The current command surface is intentionally limited to
`SetCharacterDestinationCommand`.
Client intent is intentionally limited to `SetCharacterDestinationCommand`.
The server also sends `SetCharacterEnabledCommand` in tick bundles when a
configured player slot connects or disconnects.
## Runtime Architecture
@@ -21,6 +22,9 @@ The current command surface is intentionally limited to
- Each accepted connection is assigned the first free character ID from the
campaign's `networkPlayerSlots`; the connection is rejected when all slots
are occupied.
- Player slots start disabled. The server consumes and broadcasts an enabled
command on the next tick for each connection and disconnection, including to
the newly connected client.
- The initial message contains the state, completed snapshot tick, assigned
player ID, tick duration, two-tick input delay, and compatibility fingerprint.
- Destination inputs cross from the Asio thread through a queue. The simulation
@@ -102,8 +106,8 @@ Message types are:
- `initial_state` (server to client): one state snapshot and lockstep metadata;
- `destination_input` (client to server): monotonic client sequence and a
centimetre-normalized finite target;
- `tick` (server to client): tick ID, globally sequenced commands, and
post-tick diagnostic state hash;
- `tick` (server to client): tick ID, globally sequenced destination and
character-presence commands, and post-tick diagnostic state hash;
- `error` (server to client): invalid input, incompatibility, or full server.
Protocol v1 is not compatible. Malformed payloads, non-finite or out-of-range
@@ -161,7 +165,8 @@ Launch the Windows game and select `battle_zone_multiplayer`. The client connect
CTest covers protocol-v2 round trips and validation, input-delay ordering,
fixed-tick replica behavior, campaign slot metadata, initial connection and
slot assignment, destination submission, and contiguous tick consumption.
slot assignment, connection/disconnection presence propagation, destination
submission, and contiguous tick consumption.
## Current Limitations