Add local networking and test server

Introduce a localhost-only networking milestone and a tiny Python test server to verify packet flow from the plugin to an external process. Added F4T::Networking API (include and src) which uses non-blocking Winsock to connect to 127.0.0.1:7777, send JSON newline-separated transform packets, and handle reconnect/backoff and disconnects safely. Plugin changes: call ConnectToLocalServer() at load, register DisconnectFromLocalServer on exit, and send transform packets from main.cpp when logging player movement. Build: xmake updated to include new headers and link ws2_32. Server: server/server.py implements a simple multi-client TCP server that prints parsed transform packets; server/README.md and docs/dev-log.md updated to document the test setup and results. All networking failures are non-fatal so the game continues if the server isn't running.
This commit is contained in:
2026-05-31 18:50:38 +12:00
parent 88506e0415
commit b24ce17751
7 changed files with 395 additions and 7 deletions
+38 -3
View File
@@ -174,10 +174,9 @@ Use this format for future updates:
### Notes
- The first successful player position log was:
```text
Player position: X=2048.00, Y=2048.00, Z=0.00, AngleZ=0.00
## 2026-05-31
### What Changed
@@ -206,4 +205,40 @@ Player position: X=2048.00, Y=2048.00, Z=0.00, AngleZ=0.00
- Create a local test server.
- Send player transform data from the plugin to the server.
- Keep the first network test local-only.
- Keep the first network test local-only.
## 2026-05-31
### What Changed
- Added a local Python test server.
- Added basic networking from the Fallout 4 Together plugin to the local server.
- Sent player transform data from Fallout 4 to the server.
- Server now prints received transform packets.
### What Worked
- `server/server.py` runs successfully.
- Server listens on `127.0.0.1:7777`.
- Fallout 4 launches through F4SE.
- The plugin connects to the local server.
- Moving the player sends transform packets to the server.
- Server prints X, Y, Z, and AngleZ values.
- Server handles client disconnects safely.
### What Broke
- Nothing recorded.
### Notes
- First successful server connection used local client port `55912`.
- The server received live player transform data from Fallout 4.
- This confirms the basic data path from game plugin to external server.
### Next Steps
- Add a player ID or client ID to transform packets.
- Add timestamps to transform packets.
- Have the server echo/broadcast transform packets to connected clients.
- Add a fake test client before attempting a second Fallout 4 client.