aboutsummaryrefslogtreecommitdiff
path: root/src/zenmaster/hostinterface.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2025-09-27 22:41:09 +0200
committerStefan Boberg <[email protected]>2025-09-27 22:41:09 +0200
commit6c036989c9b74affc98c5f29e574375c59cbb0d2 (patch)
treeefa4fc9c7b02b34330bd281058c6ca2b98b29c01 /src/zenmaster/hostinterface.cpp
parentadd zen master cmd (diff)
downloadzen-6c036989c9b74affc98c5f29e574375c59cbb0d2.tar.xz
zen-6c036989c9b74affc98c5f29e574375c59cbb0d2.zip
minor additions
Diffstat (limited to 'src/zenmaster/hostinterface.cpp')
-rw-r--r--src/zenmaster/hostinterface.cpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/zenmaster/hostinterface.cpp b/src/zenmaster/hostinterface.cpp
new file mode 100644
index 000000000..e1bb6cb54
--- /dev/null
+++ b/src/zenmaster/hostinterface.cpp
@@ -0,0 +1,43 @@
+// Copyright Epic Games, Inc. All Rights Reserved.
+
+#include "hostinterface.h"
+
+#include <zencore/filesystem.h>
+
+namespace zen {
+
+ZenServerHost::ZenServerHost()
+{
+}
+
+ZenServerHost::~ZenServerHost()
+{
+}
+
+// TODO: Constrain access via AppContainer mechanisms
+//
+// AppContainer is the mechanism used by UWP apps. A process
+// in AppContainer can only access explicitly granted folders via capabilities.
+//
+// You can create a classic Win32 process in an AppContainer using CreateProcess
+// with an AppContainer token.
+//
+// Grant access to specific folders using CreateAppContainerProfile() and
+// AppContainerNamedObjectPath.
+//
+
+void
+ZenServerHost::SpawnOne(std::string_view Id)
+{
+ std::unique_ptr<LiveProcess> Proc = std::make_unique<LiveProcess>();
+
+ std::filesystem::path ProgramBaseDir = GetRunningExecutablePath().parent_path();
+
+ Proc->Env.Initialize(ProgramBaseDir);
+ Proc->Server = std::move(std::make_unique<ZenServerInstance>(Proc->Env));
+ Proc->Server->SpawnServerAndWait();
+
+ m_LiveProcessesByProjectId.insert({std::string{Id}, std::move(Proc)});
+}
+
+} // namespace zen