fake_client: track players & handle disconnects
Add in-memory remote player state tracking and disconnect handling to fake_client.py: validate and store transform packets by playerId (position, angle, movementType, cellId, worldspaceId, clientTime, serverTime, lastReceivedLocalTime), print readable per-player summaries, and remove players on disconnect packets. Also add warning/log helpers and route packets to the new handlers. Update server/README.md and docs/dev-log.md to document the new behavior, test results, and next steps (clientTime verification and disconnect broadcasting).
This commit is contained in:
+64
-1
@@ -353,4 +353,67 @@ Player position: X=2048.00, Y=2048.00, Z=0.00, AngleZ=0.00
|
||||
- Make `fake_client.py` store remote player state instead of only printing packets.
|
||||
- Track remote players by `playerId`.
|
||||
- Store position, rotation, cellId, worldspaceId, movementType, and last update time.
|
||||
- Print a readable remote player state table.
|
||||
- Print a readable remote player state table.
|
||||
|
||||
## 2026-05-31
|
||||
|
||||
### What Changed
|
||||
|
||||
- Updated `fake_client.py` so it stores remote player state by `playerId`.
|
||||
- Remote player state now tracks position, angle, movement type, cell ID, worldspace ID, server time, and local receive time.
|
||||
- Tested the full relay flow from Fallout 4 plugin to server to fake client.
|
||||
|
||||
### What Worked
|
||||
|
||||
- The server received transform packets from the Fallout 4 plugin.
|
||||
- The server assigned the Fallout 4 plugin a player ID.
|
||||
- The server broadcast transform packets to the fake client.
|
||||
- The fake client received transform packets.
|
||||
- The fake client updated remote player state for player 2.
|
||||
- Cell changes and worldspace metadata were preserved.
|
||||
|
||||
### What Broke
|
||||
|
||||
- Nothing recorded.
|
||||
|
||||
### Notes
|
||||
|
||||
- `clientTime` currently appears as `None` in fake client output.
|
||||
- This should be investigated before building the Fallout-side receive loop.
|
||||
- The fake client now models the kind of remote player state table that the eventual Fallout 4 receiving client will need.
|
||||
|
||||
### Next Steps
|
||||
|
||||
- Fix or verify `clientTime` in outgoing plugin transform packets.
|
||||
- Add disconnect packet broadcasting so fake clients can remove disconnected remote players.
|
||||
- Then begin planning a plugin receive loop for server messages.
|
||||
|
||||
## 2026-05-31
|
||||
|
||||
### What Changed
|
||||
|
||||
- Fixed `clientTime` in transform packets.
|
||||
- Confirmed the Fallout 4 plugin sends `clientTime`.
|
||||
- Confirmed the server preserves and broadcasts `clientTime`.
|
||||
- Confirmed the fake client receives and stores `clientTime`.
|
||||
|
||||
### What Worked
|
||||
|
||||
- `clientTime` now appears in server output.
|
||||
- `clientTime` now appears in fake client remote player state.
|
||||
- `serverTime` is still added by the server.
|
||||
- Remote player state now has both client-side and server-side timing data.
|
||||
|
||||
### What Broke
|
||||
|
||||
- Nothing recorded.
|
||||
|
||||
### Notes
|
||||
|
||||
- The packet timing fields are now suitable for later interpolation experiments.
|
||||
- The next lifecycle feature should be disconnect broadcasting.
|
||||
|
||||
### Next Steps
|
||||
|
||||
- Add disconnect packets when a client leaves.
|
||||
- Have fake clients remove remote players when disconnect packets are received.
|
||||
Reference in New Issue
Block a user