Add server broadcasts, fake client, timestamps
Enable transform broadcast testing and time syncing: server now assigns incrementing player IDs, sends a welcome packet with playerId and serverTime, and appends serverTime/playerId to incoming transform packets before broadcasting them to all other connected clients. Added thread-safe client tracking, send_packet helper, client removal on send errors, and improved logging. Plugin now includes a clientTime timestamp in transform packets. Added server/fake_client.py to receive and print welcome and broadcasted transform packets, and updated server README and dev-log with usage and test notes.
This commit is contained in:
+39
-1
@@ -277,4 +277,42 @@ Player position: X=2048.00, Y=2048.00, Z=0.00, AngleZ=0.00
|
||||
- Add packet timestamps.
|
||||
- Add server-side client IDs.
|
||||
- Make the server broadcast transform packets to other connected clients.
|
||||
- Create a fake client to receive broadcast packets.
|
||||
- Create a fake client to receive broadcast packets.
|
||||
## 2026-05-31
|
||||
|
||||
### What Changed
|
||||
|
||||
- Updated the local server to assign incrementing player IDs.
|
||||
- Added welcome packets for newly connected clients.
|
||||
- Added server-side timestamps to transform packets.
|
||||
- Added server broadcast support for transform packets.
|
||||
- Added a receiver-only fake client.
|
||||
- Added client-side timestamps to plugin transform packets.
|
||||
- Updated server documentation with the fake-client test flow.
|
||||
|
||||
### What Worked
|
||||
|
||||
- `server/server.py` compiles with `python -m py_compile`.
|
||||
- `server/fake_client.py` compiles with `python -m py_compile`.
|
||||
- The server accepts multiple clients.
|
||||
- The server assigns player IDs.
|
||||
- The server broadcasts transform packets to clients other than the sender.
|
||||
- The fake client receives broadcast transform packets.
|
||||
- The plugin still builds successfully with `xmake build`.
|
||||
|
||||
### What Broke
|
||||
|
||||
- Nothing recorded.
|
||||
|
||||
### Notes
|
||||
|
||||
- The plugin does not yet read welcome packets from the server.
|
||||
- Server-to-plugin receive handling is intentionally left as a TODO.
|
||||
- The fake client exists so transform broadcast can be tested before running two Fallout 4 clients.
|
||||
|
||||
### Next Steps
|
||||
|
||||
- Run the full test with Fallout 4, the server, and the fake client.
|
||||
- Confirm the fake client receives live transform packets from the Fallout 4 plugin.
|
||||
- Add protocol documentation for `playerId`, `clientTime`, and `serverTime`.
|
||||
- Begin planning remote player state storage on the receiving client.
|
||||
Reference in New Issue
Block a user