Broadcast disconnects; update fake client
Implement server-side disconnect lifecycle and update client handling. Added disconnect_client and broadcast_disconnect in server.py to remove clients, close sockets, and notify remaining clients with a disconnect packet; broadcast_transform now uses disconnect_client for failed recipients and logs delivery counts. Updated fake_client.py to handle disconnect packets, remove remote players from its in-memory table, and improve logging. Documentation (docs/dev-log.md and server/README.md) updated to record the change and next steps.
This commit is contained in:
+34
-1
@@ -416,4 +416,37 @@ Player position: X=2048.00, Y=2048.00, Z=0.00, AngleZ=0.00
|
||||
### Next Steps
|
||||
|
||||
- Add disconnect packets when a client leaves.
|
||||
- Have fake clients remove remote players when disconnect packets are received.
|
||||
- Have fake clients remove remote players when disconnect packets are received.
|
||||
|
||||
## 2026-05-31
|
||||
|
||||
### What Changed
|
||||
|
||||
- Added server-side disconnect packet broadcasting.
|
||||
- Updated the fake client to handle disconnect packets.
|
||||
- Fake client now removes disconnected remote players from its remote player state table.
|
||||
- Tested disconnect lifecycle using the Fallout 4 plugin and fake client.
|
||||
|
||||
### What Worked
|
||||
|
||||
- Server detected the Fallout 4 plugin disconnecting.
|
||||
- Server removed the disconnected client.
|
||||
- Server broadcast a disconnect packet to remaining clients.
|
||||
- Fake client received the disconnect packet.
|
||||
- Fake client removed remote player 2 from its state table.
|
||||
- Fake client correctly reported that no remote players were currently tracked.
|
||||
|
||||
### What Broke
|
||||
|
||||
- Nothing recorded.
|
||||
|
||||
### Notes
|
||||
|
||||
- The fake client reported `WinError 10054` after the server was stopped manually. This is expected during shutdown and is not a protocol issue.
|
||||
- The basic networking lifecycle now works: connect, welcome, transform, disconnect, cleanup.
|
||||
|
||||
### Next Steps
|
||||
|
||||
- Add protocol documentation for welcome, transform, and disconnect packets.
|
||||
- Begin planning a Fallout 4 plugin receive loop.
|
||||
- Store remote player state inside the plugin, without spawning actors yet.
|
||||
Reference in New Issue
Block a user