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

2
.gitattributes vendored
View File

@@ -16,3 +16,5 @@
*.sln filter=lfs diff=lfs merge=lfs -text *.sln filter=lfs diff=lfs merge=lfs -text
*.uasset filter=lfs diff=lfs merge=lfs -text *.uasset filter=lfs diff=lfs merge=lfs -text
*.umap 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

2
.gitignore vendored
View File

@@ -6,6 +6,8 @@ Integration.uproject
Integration.code-workspace Integration.code-workspace
Integration.code-workspace.ubt Integration.code-workspace.ubt
Makefile Makefile
UnrealEngine-*-release
UnrealEngine
*~ *~
\#*# \#*#

View File

@@ -1,8 +1,7 @@
diff --git a/Engine/Extras/LLDBDataFormatters/UEDataFormatters_2ByteChars.py b/Engine/Extras/LLDBDataFormatters/UEDataFormatters_2ByteChars.py diff -u --recursive UnrealEngine-5.3.1-release/Engine/Extras/LLDBDataFormatters/UEDataFormatters_2ByteChars.py UnrealEngine/Engine/Extras/LLDBDataFormatters/UEDataFormatters_2ByteChars.py
index f56f5ea9cac4..ff1c4030b38f 100644 --- UnrealEngine-5.3.1-release/Engine/Extras/LLDBDataFormatters/UEDataFormatters_2ByteChars.py 2023-09-27 09:48:07.000000000 -0400
--- a/Engine/Extras/LLDBDataFormatters/UEDataFormatters_2ByteChars.py +++ UnrealEngine/Engine/Extras/LLDBDataFormatters/UEDataFormatters_2ByteChars.py 2025-06-19 17:47:01.619969745 -0400
+++ b/Engine/Extras/LLDBDataFormatters/UEDataFormatters_2ByteChars.py @@ -32,7 +32,7 @@
@@ -32,7 +32,7 @@ def UETCharSummaryProvider(valobj,dict):
if DataVal == 0: if DataVal == 0:
Val = 'NULL' Val = 'NULL'
else: else:
@@ -11,7 +10,7 @@ index f56f5ea9cac4..ff1c4030b38f 100644
ValRef = valobj.CreateValueFromExpression('string', Expr) ValRef = valobj.CreateValueFromExpression('string', Expr)
Val = ValRef.GetSummary() Val = ValRef.GetSummary()
elif Type.IsReferenceType(): elif Type.IsReferenceType():
@@ -47,6 +47,11 @@ def UETCharSummaryProvider(valobj,dict): @@ -47,6 +47,11 @@
Expr = '(char16_t*)(%s)' % valobj.GetAddress() Expr = '(char16_t*)(%s)' % valobj.GetAddress()
ValRef = valobj.CreateValueFromExpression('string', Expr) ValRef = valobj.CreateValueFromExpression('string', Expr)
Val = ValRef.GetSummary() Val = ValRef.GetSummary()
@@ -23,11 +22,10 @@ index f56f5ea9cac4..ff1c4030b38f 100644
return Val return Val
def UESignedCharSummaryProvider(valobj,dict): def UESignedCharSummaryProvider(valobj,dict):
diff --git a/Engine/Source/Runtime/ApplicationCore/Private/Linux/LinuxPlatformApplicationMisc.cpp b/Engine/Source/Runtime/ApplicationCore/Private/Linux/LinuxPlatformApplicationMisc.cpp 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
index ca5f4b5fb5ff..a436a624d5b7 100644 --- UnrealEngine-5.3.1-release/Engine/Source/Runtime/ApplicationCore/Private/Linux/LinuxPlatformApplicationMisc.cpp 2023-09-27 09:48:07.000000000 -0400
--- a/Engine/Source/Runtime/ApplicationCore/Private/Linux/LinuxPlatformApplicationMisc.cpp +++ UnrealEngine/Engine/Source/Runtime/ApplicationCore/Private/Linux/LinuxPlatformApplicationMisc.cpp 2025-06-19 17:47:01.621969761 -0400
+++ b/Engine/Source/Runtime/ApplicationCore/Private/Linux/LinuxPlatformApplicationMisc.cpp @@ -299,6 +299,9 @@
@@ -299,6 +299,9 @@ bool FLinuxPlatformApplicationMisc::InitSDL()
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_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. 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 we're rendering offscreen, use the "dummy" SDL video driver
if (FParse::Param(FCommandLine::Get(), TEXT("RenderOffScreen")) && !getenv("SDL_VIDEODRIVER")) if (FParse::Param(FCommandLine::Get(), TEXT("RenderOffScreen")) && !getenv("SDL_VIDEODRIVER"))
{ {
diff --git a/Setup.bat b/Setup.bat diff -u --recursive UnrealEngine-5.3.1-release/Setup.bat UnrealEngine/Setup.bat
index 34e1cea1e7d2..16bfbe803ac1 100755 --- UnrealEngine-5.3.1-release/Setup.bat 2023-09-27 09:48:07.000000000 -0400
--- a/Setup.bat +++ UnrealEngine/Setup.bat 2025-06-19 17:50:32.284629525 -0400
+++ b/Setup.bat @@ -28,7 +28,7 @@
@@ -28,7 +28,7 @@ start /wait Engine\Extras\Redist\en-us\UEPrereqSetup_x64.exe /quiet /norestart
rem Register the engine installation... rem Register the engine installation...
if not exist .\Engine\Binaries\Win64\UnrealVersionSelector-Win64-Shipping.exe goto :no_unreal_version_selector 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 :no_unreal_version_selector
rem Done! rem Done!
diff --git a/Setup.sh b/Setup.sh diff -u --recursive UnrealEngine-5.3.1-release/Setup.sh UnrealEngine/Setup.sh
index f91a96aaac6b..12897001c96b 100755 --- UnrealEngine-5.3.1-release/Setup.sh 2023-09-27 09:48:07.000000000 -0400
--- a/Setup.sh +++ UnrealEngine/Setup.sh 2025-06-19 17:47:01.621969761 -0400
+++ b/Setup.sh @@ -80,7 +80,7 @@
@@ -80,7 +80,7 @@ else
echo Register the engine installation... echo Register the engine installation...
if [ -f Engine/Binaries/Linux/UnrealVersionSelector-Linux-Shipping ]; then if [ -f Engine/Binaries/Linux/UnrealVersionSelector-Linux-Shipping ]; then
pushd Engine/Binaries/Linux > /dev/null pushd Engine/Binaries/Linux > /dev/null

View File

@@ -86,7 +86,7 @@
"configurations": { "configurations": {
"for-each": [ "for-each": [
{ "SERVER" : "Standalone" }, { "SERVER" : "Standalone" },
{ "SERVER" : "192.168.0.100" } { "SERVER" : "LocalHost" }
], ],
"body": { "body": {
"name": "Server=[SERVER]", "name": "Server=[SERVER]",

View File

@@ -36,10 +36,6 @@ ALuprexGameModeBase::ALuprexGameModeBase()
ResetToInitialState(); ResetToInitialState();
OnWorldPreActorTickHandle = FWorldDelegates::OnWorldPreActorTick.AddUObject(this, &ALuprexGameModeBase::OnWorldPreActorTick); OnWorldPreActorTickHandle = FWorldDelegates::OnWorldPreActorTick.AddUObject(this, &ALuprexGameModeBase::OnWorldPreActorTick);
OnWorldPostActorTickHandle = FWorldDelegates::OnWorldPostActorTick.AddUObject(this, &ALuprexGameModeBase::OnWorldPostActorTick); 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() 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 we successfully created a luprex engine, create a socket system and a worker thread.
if (Playing) { if (Playing) {
Sockets.Reset(FlxSockets::Create(w)); Sockets.Reset(FlxSockets::Create(w));

BIN
UnrealEngine.zip LFS Normal file

Binary file not shown.

View File

@@ -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 pathlib import Path
from types import SimpleNamespace from types import SimpleNamespace
@@ -113,6 +114,12 @@ def autodetect_system_config():
configuration settings. We haven't tested the Windows version. configuration settings. We haven't tested the Windows version.
""" """
config = SimpleNamespace() 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": if sys.platform == "windows":
config.OS = "Windows" config.OS = "Windows"
config.DLL = "dll" config.DLL = "dll"
@@ -127,12 +134,6 @@ def autodetect_system_config():
config.DOT_EXE = "" config.DOT_EXE = ""
config.USER = os.environ["USER"] config.USER = os.environ["USER"]
config.BUILD_BAT = "Linux/Build.sh" 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 return config
@@ -154,21 +155,21 @@ def store_system_config_in_globals(config):
# The actual build steps. # 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 Unzip the unreal engine source, then apply a patch.
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.
""" """
patch = Path(f"{INTEGRATION}/EnginePatches/EnginePatch") # Find out the unreal version that we're using
patch_lines = patch.read_text().splitlines() if not Path(UNREALENGINE).is_dir():
patched_files = [line[6:] for line in patch_lines if line.startswith("--- a/")] zipfn = f"{INTEGRATION}/UnrealEngine.zip";
for file in patched_files: with zipfile.ZipFile(zipfn, 'r') as z:
shell(UNREALENGINE, f"git show HEAD:{file} > {file}") version = z.namelist()[0].split('/')[0]
shell(UNREALENGINE, f"git checkout 5.3.1-release") if not fnmatch.fnmatch(version, 'UnrealEngine-*-release'):
shell(UNREALENGINE, f"git apply {INTEGRATION}/EnginePatches/EnginePatch") 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(): def generate_buildconfiguration_xml():
@@ -303,7 +304,7 @@ if MODE == "experiment":
build_intellisense_database_for_clangd() build_intellisense_database_for_clangd()
if MODE == "all": if MODE == "all":
checkout_correct_unreal_engine_branch_and_apply_patch() unzip_unreal_engine_and_apply_patch()
generate_buildconfiguration_xml() generate_buildconfiguration_xml()
generate_lpx_paths() generate_lpx_paths()
generate_integration_uproject() generate_integration_uproject()