From 8298ef6e729047a8bbed1cd58b776f85ff7f20d6 Mon Sep 17 00:00:00 2001 From: jyelon Date: Fri, 27 Jun 2025 15:11:54 -0400 Subject: [PATCH] Add the ability to run the luprex server from vscode --- Integration.code-workspace.tpl.json | 63 ++++++++++++++++++----------- build.py | 7 ++++ 2 files changed, 47 insertions(+), 23 deletions(-) diff --git a/Integration.code-workspace.tpl.json b/Integration.code-workspace.tpl.json index 092042e8..df1f8baa 100644 --- a/Integration.code-workspace.tpl.json +++ b/Integration.code-workspace.tpl.json @@ -84,30 +84,47 @@ "launch": { "version": "0.2.0", "configurations": { - "for-each": [ - { "SERVER" : "Standalone" }, - { "SERVER" : "LocalHost" }, - { "SERVER" : "192.168.1.155" }, - { "SERVER" : "192.168.1.156" } - ], - "body": { - "name": "Server=[SERVER]", - "request": "launch", - "program": "[UNREALENGINE]/Engine/Binaries/Linux/UnrealEditor-Linux-DebugGame", - "preLaunchTask": "python3 build.py c++", - "args": [ - "[INTEGRATION]/Integration.uproject", - "-userdir=User/[USER]", - "-LuprexServer=[SERVER]" + "append1" : { + "for-each": [ + { "SERVER" : "Standalone" }, + { "SERVER" : "LocalHost" }, + { "SERVER" : "192.168.1.155" }, + { "SERVER" : "192.168.1.156" } ], - "cwd": "[INTEGRATION]", - "type": "lldb", - "initCommands": [ - "command script import [UNREALENGINE]/Engine/Extras/LLDBDataFormatters/UEDataFormatters_2ByteChars.py", - "settings set target.inline-breakpoint-strategy always", - "target stop-hook add --one-liner \"p ::UngrabAllInputImpl()\"" - ] - } + "body": { + "name": "Server=[SERVER]", + "request": "launch", + "program": "[UNREALENGINE]/Engine/Binaries/Linux/UnrealEditor-Linux-DebugGame", + "preLaunchTask": "python3 build.py c++", + "args": [ + "[INTEGRATION]/Integration.uproject", + "-userdir=User/[USER]", + "-LuprexServer=[SERVER]" + ], + "cwd": "[INTEGRATION]", + "type": "lldb", + "initCommands": [ + "command script import [UNREALENGINE]/Engine/Extras/LLDBDataFormatters/UEDataFormatters_2ByteChars.py", + "settings set target.inline-breakpoint-strategy always", + "target stop-hook add --one-liner \"p ::UngrabAllInputImpl()\"" + ] + } + }, + "append2" : [ + { + "name": "Luprex Server", + "request": "launch", + "program": "[INTEGRATION]/luprex/build/[OS]/luprexstatic", + "preLaunchTask": "python3 build.py c++", + "args": [ "lpxserver" ], + "cwd": "[INTEGRATION]/luprex", + "type": "lldb", + "console": "integratedTerminal", + "initCommands": [ + "settings set target.inline-breakpoint-strategy always" + ] + } + ] } } } diff --git a/build.py b/build.py index 71ea3401..2abda99a 100755 --- a/build.py +++ b/build.py @@ -65,6 +65,13 @@ def expand_json(data, vars): body = data["body"] foreach = data["for-each"] return [ expand_json(body, vars | lvars) for lvars in foreach ] + if "append1" in data and "append2" in data: + result = [] + for i in range(1, 1000): + key = f"append{i}" + if key not in data: break + result = result + expand_json(data[key], vars) + return result else: return { key: expand_json(value, vars) for key, value in data.items() } elif isinstance(data, list):