Checking in Unreal Engine source. Also some work on LuprexServer

This commit is contained in:
2025-06-19 18:01:05 -04:00
parent e8ec9c9707
commit 4fe229ebd1
7 changed files with 60 additions and 47 deletions

View File

@@ -36,10 +36,6 @@ ALuprexGameModeBase::ALuprexGameModeBase()
ResetToInitialState();
OnWorldPreActorTickHandle = FWorldDelegates::OnWorldPreActorTick.AddUObject(this, &ALuprexGameModeBase::OnWorldPreActorTick);
OnWorldPostActorTickHandle = FWorldDelegates::OnWorldPostActorTick.AddUObject(this, &ALuprexGameModeBase::OnWorldPostActorTick);
FString LuprexServer;
FParse::Value(FCommandLine::Get(), TEXT("-LuprexServer="), LuprexServer);
UE_LOG(LogTemp, Display, TEXT("LuprexServer = %s"), *LuprexServer)
}
ALuprexGameModeBase::~ALuprexGameModeBase()
@@ -317,6 +313,19 @@ void ALuprexGameModeBase::InitializeGlobalState()
}
}
// Possibly tell the engine to connect to a server.
if (Playing) {
FString LuprexServer;
FParse::Value(FCommandLine::Get(), TEXT("-LuprexServer="), LuprexServer);
LuprexServer = LuprexServer.ToLower();
UE_LOG(LogTemp, Display, TEXT("LuprexServer = %s"), *LuprexServer)
if (LuprexServer != TEXT("standalone"))
{
FTCHARToUTF8 utf8server(LuprexServer);
w->play_access(w.Get(), AccessKind::CONNECT_TO_SERVER, 0, utf8server.Length(), utf8server.Get(), nullptr, nullptr);
}
}
// If we successfully created a luprex engine, create a socket system and a worker thread.
if (Playing) {
Sockets.Reset(FlxSockets::Create(w));