Add TCP-over-WebSocket relay client for Minecraft

- Implemented Win64LceLiveRelay.h and Win64LceLiveSignaling.cpp to facilitate TCP-over-WebSocket communication for Minecraft, allowing game traffic to route through the LCELive relay server when direct TCP is blocked.
- Introduced signaling mechanisms for host and joiner connections, including session management and candidate exchange.
- Added logging functionality in Windows_Log.cpp and Windows_Log.h for better debugging and session tracking.
- Created build-release.bat script for streamlined build and deployment process, including exclusion of unnecessary files.
This commit is contained in:
veroxsity
2026-04-17 23:47:32 +01:00
parent 0281311e79
commit de125e5275
23 changed files with 3519 additions and 171 deletions

View File

@@ -7,6 +7,8 @@
#include "../../Windows64/Network/WinsockNetLayer.h"
#include "../../Windows64/Windows64_Xuid.h"
#include "../../Windows64/Windows64_LceLive.h"
#include "../../Windows64/Windows64_LceLiveP2P.h"
#include "../../Windows64/Windows64_LceLiveSignaling.h"
#include "../../Minecraft.h"
#include "../../User.h"
#include "../../MinecraftServer.h"
@@ -445,6 +447,8 @@ bool CPlatformNetworkManagerStub::LeaveGame(bool bMigrateHost)
SystemFlagReset();
#ifdef _WINDOWS64
Win64LceLiveSignaling::Close(); // close signaling WebSocket before P2P teardown
Win64LceLiveP2P::HostClose(); // tear down P2P socket + remove UPnP mapping
WinsockNetLayer::Shutdown();
WinsockNetLayer::Initialize();
#endif
@@ -499,6 +503,9 @@ void CPlatformNetworkManagerStub::HostGame(int localUsersMask, bool bOnlineGame,
if (WinsockNetLayer::IsActive())
{
// Start P2P discovery (UPnP IGD → STUN fallback) so we have an
// external endpoint ready before the first joiner arrives.
Win64LceLiveP2P::HostOpen();
// For Dedicated Server, refer to `lan-advertise` in `server.properties`
bool enableLanAdvertising = true;
if (g_Win64DedicatedServer)