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:
@@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
namespace F4T::Networking
|
||||
{
|
||||
bool ConnectToLocalServer();
|
||||
void DisconnectFromLocalServer();
|
||||
bool IsConnectedToServer();
|
||||
bool SendTransformPacket(float a_x, float a_y, float a_z, float a_angleZ);
|
||||
}
|
||||
Reference in New Issue
Block a user