Document local networking prototype and protocol
Expand documentation to describe the current local networking prototype and its protocol. Adds a Current Architecture section and Fake Client responsibilities, clarifies that the Fallout 4 plugin currently only sends transforms (no receive loop yet), and documents implemented message types (welcome, transform, disconnect) with packet field descriptions and examples. Update player-sync and packets docs to reflect movementType, server/client timestamps, and the in-memory remote player state model used by server/fake_client.py. Flesh out server/README with run/test flow and implemented behavior. Revise dev-log with milestone entries, testing notes, and an entry template for future updates.
This commit is contained in:
+35
-18
@@ -4,8 +4,13 @@ This folder is for the external multiplayer test server.
|
||||
|
||||
The current server is a tiny local-only TCP test server. It listens on
|
||||
`127.0.0.1:7777`, accepts one or more clients, reads newline-separated JSON
|
||||
packets, prints received player transform packets, and broadcasts transform
|
||||
packets to every other connected client.
|
||||
packets, assigns incrementing `playerId` values, sends `welcome` packets, adds
|
||||
`playerId` and `serverTime` to transform packets, broadcasts transform packets
|
||||
to every other connected client, and broadcasts disconnect packets when clients
|
||||
disconnect.
|
||||
|
||||
This is still a local prototype. It does not make Fallout 4 multiplayer
|
||||
playable yet.
|
||||
|
||||
## Run
|
||||
|
||||
@@ -14,14 +19,14 @@ cd server
|
||||
python server.py
|
||||
```
|
||||
|
||||
Then launch Fallout 4 through F4SE and move the player. The plugin should keep
|
||||
logging player position changes to `Fallout4Together.log`, and this server
|
||||
should print matching `transform` packets.
|
||||
Then launch Fallout 4 through F4SE and move the player. The plugin should send
|
||||
local player transform packets, and this server should print matching
|
||||
`transform` packets.
|
||||
|
||||
If the server is not running, the plugin should log a warning and Fallout 4
|
||||
should continue launching normally.
|
||||
|
||||
## Broadcast Test
|
||||
## Current Test Flow
|
||||
|
||||
Terminal 1:
|
||||
|
||||
@@ -39,39 +44,51 @@ python fake_client.py
|
||||
|
||||
Then launch Fallout 4 through F4SE and move the player.
|
||||
|
||||
Expected result:
|
||||
Expected behavior:
|
||||
|
||||
- The server assigns a `playerId` to each connected client and sends each client
|
||||
a `welcome` packet.
|
||||
- The fake client prints its `welcome` packet.
|
||||
- The server prints transform packets received from Fallout 4.
|
||||
- The server adds `playerId` and `serverTime` to each transform packet.
|
||||
- The server receives transforms from the Fallout 4 plugin.
|
||||
- The server adds `playerId` and `serverTime` to each transform packet before
|
||||
broadcast.
|
||||
- The server broadcasts those transform packets to connected clients except the
|
||||
sender.
|
||||
- `fake_client.py` receives and prints the broadcast transform packets.
|
||||
- `fake_client.py` stores the latest remote player state for each `playerId`
|
||||
in memory and prints a readable state summary after each transform update.
|
||||
- `fake_client.py` receives broadcast transform packets.
|
||||
- `fake_client.py` stores remote player state by `playerId`.
|
||||
- When a client disconnects, the server removes that client and broadcasts a
|
||||
`disconnect` packet with the departed `playerId` to the remaining clients.
|
||||
- `fake_client.py` removes disconnected players from its in-memory
|
||||
`remote_players` table and prints the remaining tracked players.
|
||||
`remote_players` table.
|
||||
|
||||
The fake client exists so broadcast behavior can be tested before coordinating a
|
||||
second Fallout 4/F4SE instance. It stores remote player transform state only; it
|
||||
does not spawn remote actors or send movement.
|
||||
|
||||
## Current Server Goals
|
||||
## Implemented
|
||||
|
||||
- Start local server
|
||||
- Accept client connections
|
||||
- Receive transform packets
|
||||
- Assign server-owned player IDs
|
||||
- Send welcome packets
|
||||
- Receive transform packets
|
||||
- Add server timestamps
|
||||
- Broadcast transforms to other connected clients
|
||||
- Handle disconnects
|
||||
- Broadcast disconnect packets
|
||||
- Handle disconnect cleanup
|
||||
|
||||
## Not Planned Yet
|
||||
## Working In Fake Client Only
|
||||
|
||||
- Receiving welcome packets
|
||||
- Receiving transform broadcasts
|
||||
- Storing remote player state
|
||||
- Removing disconnected remote players
|
||||
|
||||
The Fallout 4 plugin does not yet receive remote transforms from the server.
|
||||
|
||||
## Planned Later
|
||||
|
||||
- Fallout 4 plugin receive loop
|
||||
- Plugin-side remote player state storage
|
||||
- Remote actor spawning
|
||||
- Gameplay synchronization
|
||||
- Authentication
|
||||
|
||||
Reference in New Issue
Block a user