diff --git a/.gitattributes b/.gitattributes index cb3cbbf5..3fc57f91 100644 --- a/.gitattributes +++ b/.gitattributes @@ -16,3 +16,5 @@ *.sln filter=lfs diff=lfs merge=lfs -text *.uasset filter=lfs diff=lfs merge=lfs -text *.umap filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore index a37e4f80..37fc3667 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,8 @@ Integration.uproject Integration.code-workspace Integration.code-workspace.ubt Makefile +UnrealEngine-*-release +UnrealEngine *~ \#*# diff --git a/EnginePatches/EnginePatch b/EnginePatches/EnginePatch index 22b0a2da..bc7e7360 100644 --- a/EnginePatches/EnginePatch +++ b/EnginePatches/EnginePatch @@ -1,8 +1,7 @@ -diff --git a/Engine/Extras/LLDBDataFormatters/UEDataFormatters_2ByteChars.py b/Engine/Extras/LLDBDataFormatters/UEDataFormatters_2ByteChars.py -index f56f5ea9cac4..ff1c4030b38f 100644 ---- a/Engine/Extras/LLDBDataFormatters/UEDataFormatters_2ByteChars.py -+++ b/Engine/Extras/LLDBDataFormatters/UEDataFormatters_2ByteChars.py -@@ -32,7 +32,7 @@ def UETCharSummaryProvider(valobj,dict): +diff -u --recursive UnrealEngine-5.3.1-release/Engine/Extras/LLDBDataFormatters/UEDataFormatters_2ByteChars.py UnrealEngine/Engine/Extras/LLDBDataFormatters/UEDataFormatters_2ByteChars.py +--- UnrealEngine-5.3.1-release/Engine/Extras/LLDBDataFormatters/UEDataFormatters_2ByteChars.py 2023-09-27 09:48:07.000000000 -0400 ++++ UnrealEngine/Engine/Extras/LLDBDataFormatters/UEDataFormatters_2ByteChars.py 2025-06-19 17:47:01.619969745 -0400 +@@ -32,7 +32,7 @@ if DataVal == 0: Val = 'NULL' else: @@ -11,7 +10,7 @@ index f56f5ea9cac4..ff1c4030b38f 100644 ValRef = valobj.CreateValueFromExpression('string', Expr) Val = ValRef.GetSummary() elif Type.IsReferenceType(): -@@ -47,6 +47,11 @@ def UETCharSummaryProvider(valobj,dict): +@@ -47,6 +47,11 @@ Expr = '(char16_t*)(%s)' % valobj.GetAddress() ValRef = valobj.CreateValueFromExpression('string', Expr) Val = ValRef.GetSummary() @@ -23,11 +22,10 @@ index f56f5ea9cac4..ff1c4030b38f 100644 return Val def UESignedCharSummaryProvider(valobj,dict): -diff --git a/Engine/Source/Runtime/ApplicationCore/Private/Linux/LinuxPlatformApplicationMisc.cpp b/Engine/Source/Runtime/ApplicationCore/Private/Linux/LinuxPlatformApplicationMisc.cpp -index ca5f4b5fb5ff..a436a624d5b7 100644 ---- a/Engine/Source/Runtime/ApplicationCore/Private/Linux/LinuxPlatformApplicationMisc.cpp -+++ b/Engine/Source/Runtime/ApplicationCore/Private/Linux/LinuxPlatformApplicationMisc.cpp -@@ -299,6 +299,9 @@ bool FLinuxPlatformApplicationMisc::InitSDL() +diff -u --recursive UnrealEngine-5.3.1-release/Engine/Source/Runtime/ApplicationCore/Private/Linux/LinuxPlatformApplicationMisc.cpp UnrealEngine/Engine/Source/Runtime/ApplicationCore/Private/Linux/LinuxPlatformApplicationMisc.cpp +--- UnrealEngine-5.3.1-release/Engine/Source/Runtime/ApplicationCore/Private/Linux/LinuxPlatformApplicationMisc.cpp 2023-09-27 09:48:07.000000000 -0400 ++++ UnrealEngine/Engine/Source/Runtime/ApplicationCore/Private/Linux/LinuxPlatformApplicationMisc.cpp 2025-06-19 17:47:01.621969761 -0400 +@@ -299,6 +299,9 @@ SDL_SetHint(SDL_HINT_MOUSE_RELATIVE_MODE_SHOW_CURSOR, "1"); // When relative mouse mode is acive, don't hide cursor. SDL_SetHint(SDL_HINT_MOUSE_RELATIVE_MODE_WARP, "0"); // Don't warp the cursor to the center in relative mouse mode. @@ -37,11 +35,10 @@ index ca5f4b5fb5ff..a436a624d5b7 100644 // If we're rendering offscreen, use the "dummy" SDL video driver if (FParse::Param(FCommandLine::Get(), TEXT("RenderOffScreen")) && !getenv("SDL_VIDEODRIVER")) { -diff --git a/Setup.bat b/Setup.bat -index 34e1cea1e7d2..16bfbe803ac1 100755 ---- a/Setup.bat -+++ b/Setup.bat -@@ -28,7 +28,7 @@ start /wait Engine\Extras\Redist\en-us\UEPrereqSetup_x64.exe /quiet /norestart +diff -u --recursive UnrealEngine-5.3.1-release/Setup.bat UnrealEngine/Setup.bat +--- UnrealEngine-5.3.1-release/Setup.bat 2023-09-27 09:48:07.000000000 -0400 ++++ UnrealEngine/Setup.bat 2025-06-19 17:50:32.284629525 -0400 +@@ -28,7 +28,7 @@ rem Register the engine installation... if not exist .\Engine\Binaries\Win64\UnrealVersionSelector-Win64-Shipping.exe goto :no_unreal_version_selector @@ -50,11 +47,10 @@ index 34e1cea1e7d2..16bfbe803ac1 100755 :no_unreal_version_selector rem Done! -diff --git a/Setup.sh b/Setup.sh -index f91a96aaac6b..12897001c96b 100755 ---- a/Setup.sh -+++ b/Setup.sh -@@ -80,7 +80,7 @@ else +diff -u --recursive UnrealEngine-5.3.1-release/Setup.sh UnrealEngine/Setup.sh +--- UnrealEngine-5.3.1-release/Setup.sh 2023-09-27 09:48:07.000000000 -0400 ++++ UnrealEngine/Setup.sh 2025-06-19 17:47:01.621969761 -0400 +@@ -80,7 +80,7 @@ echo Register the engine installation... if [ -f Engine/Binaries/Linux/UnrealVersionSelector-Linux-Shipping ]; then pushd Engine/Binaries/Linux > /dev/null diff --git a/Integration.code-workspace.tpl.json b/Integration.code-workspace.tpl.json index 9a16a8b8..c406405e 100644 --- a/Integration.code-workspace.tpl.json +++ b/Integration.code-workspace.tpl.json @@ -86,7 +86,7 @@ "configurations": { "for-each": [ { "SERVER" : "Standalone" }, - { "SERVER" : "192.168.0.100" } + { "SERVER" : "LocalHost" } ], "body": { "name": "Server=[SERVER]", diff --git a/Source/Integration/LuprexGameModeBase.cpp b/Source/Integration/LuprexGameModeBase.cpp index ee558a5b..bfa68433 100644 --- a/Source/Integration/LuprexGameModeBase.cpp +++ b/Source/Integration/LuprexGameModeBase.cpp @@ -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)); diff --git a/UnrealEngine.zip b/UnrealEngine.zip new file mode 100644 index 00000000..879c2133 --- /dev/null +++ b/UnrealEngine.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dca0b6a7d73a8ea4e789be8dc336ae60ddc18cce8d31a92e09101b4781fb71a8 +size 622629164 diff --git a/build.py b/build.py index f85e2ca7..e6db71aa 100755 --- a/build.py +++ b/build.py @@ -10,7 +10,8 @@ # -import sys, os, json, shutil, subprocess, re, time, tarfile, itertools, hashlib +import sys, os, json, shutil, subprocess, re, time, tarfile +import itertools, hashlib, zipfile, fnmatch from pathlib import Path from types import SimpleNamespace @@ -113,6 +114,12 @@ def autodetect_system_config(): configuration settings. We haven't tested the Windows version. """ config = SimpleNamespace() + # Make sure we're actually inside an integration repository. + config.INTEGRATION = os.path.dirname(os.path.abspath(sys.argv[0])) + if not Path(f"{config.INTEGRATION}/Source/Integration").is_dir(): + sys.exit(f"Integration repository is not valid: {config.INTEGRATION}") + config.UNREALENGINE = os.path.join(config.INTEGRATION, "UnrealEngine") + # Configure other parameters. if sys.platform == "windows": config.OS = "Windows" config.DLL = "dll" @@ -127,12 +134,6 @@ def autodetect_system_config(): config.DOT_EXE = "" config.USER = os.environ["USER"] config.BUILD_BAT = "Linux/Build.sh" - config.INTEGRATION = os.path.dirname(os.path.abspath(sys.argv[0])) - config.UNREALENGINE = os.path.join(os.path.dirname(config.INTEGRATION), "UnrealEngine") - test1 = Path(f"{config.INTEGRATION}/Source/Integration") - test2 = Path(f"{config.UNREALENGINE}/Engine/Source/Editor") - if not test1.is_dir(): sys.exit(f"Integration repository is not valid: {config.INTEGRATION}") - if not test2.is_dir(): sys.exit(f"UnrealEngine repository is not valid: {config.UNREALENGINE}") return config @@ -154,21 +155,21 @@ def store_system_config_in_globals(config): # The actual build steps. # -def checkout_correct_unreal_engine_branch_and_apply_patch(): +def unzip_unreal_engine_and_apply_patch(): """ - Check out the correct branch, then apply a patch to the UnrealEngine - source code. Patch application consists of two steps: first, checkout clean, - unpatched versions of the files from git. Then, apply the patch to the clean code. - Note: don't git-commit the patch in UnrealEngine. Instead, - just let this script reapply this patch as necessary. + Unzip the unreal engine source, then apply a patch. """ - patch = Path(f"{INTEGRATION}/EnginePatches/EnginePatch") - patch_lines = patch.read_text().splitlines() - patched_files = [line[6:] for line in patch_lines if line.startswith("--- a/")] - for file in patched_files: - shell(UNREALENGINE, f"git show HEAD:{file} > {file}") - shell(UNREALENGINE, f"git checkout 5.3.1-release") - shell(UNREALENGINE, f"git apply {INTEGRATION}/EnginePatches/EnginePatch") + # Find out the unreal version that we're using + if not Path(UNREALENGINE).is_dir(): + zipfn = f"{INTEGRATION}/UnrealEngine.zip"; + with zipfile.ZipFile(zipfn, 'r') as z: + version = z.namelist()[0].split('/')[0] + if not fnmatch.fnmatch(version, 'UnrealEngine-*-release'): + sys.exit("UnrealEngine.zip does not contain UnrealEngine-*-release") + shell(INTEGRATION, f"rm -rf {version}") + shell(INTEGRATION, f"unzip UnrealEngine.zip") + shell(INTEGRATION, f"mv {version} UnrealEngine") + shell(UNREALENGINE, f"patch -p1 < {INTEGRATION}/EnginePatches/EnginePatch") def generate_buildconfiguration_xml(): @@ -303,7 +304,7 @@ if MODE == "experiment": build_intellisense_database_for_clangd() if MODE == "all": - checkout_correct_unreal_engine_branch_and_apply_patch() + unzip_unreal_engine_and_apply_patch() generate_buildconfiguration_xml() generate_lpx_paths() generate_integration_uproject()