Add Windows cross-platform support alongside Linux

Replace POSIX-specific socket and process APIs with portable
abstractions so the project builds on both Windows and Linux.

- Add include/network/net_platform.hpp: Winsock2/POSIX socket
  abstraction (socket types, non-blocking, error handling,
  WSAStartup lifecycle)
- Add include/platform/process.hpp: CreateProcess/fork+exec
  abstraction for spawning ffplay subprocesses
- Update network module (tcp_socket, world_socket) to use
  portable socket helpers instead of raw POSIX calls
- Update audio module (music_manager, footstep_manager,
  activity_sound_manager) to use portable process helpers
  instead of fork/exec/kill/waitpid
- Replace hardcoded /tmp/ paths with std::filesystem::temp_directory_path()
- Link ws2_32 and SDL2main on Windows in CMakeLists.txt
This commit is contained in:
Kelsi 2026-02-03 22:24:17 -08:00
parent dd126c6e4b
commit 6bf3fa4ed4
14 changed files with 416 additions and 186 deletions

View file

@ -2,6 +2,7 @@
#include "network/socket.hpp"
#include "network/packet.hpp"
#include "network/net_platform.hpp"
#include "auth/rc4.hpp"
#include <functional>
#include <vector>
@ -73,7 +74,7 @@ private:
*/
void tryParsePackets();
int sockfd = -1;
socket_t sockfd = INVALID_SOCK;
bool connected = false;
bool encryptionEnabled = false;