diff options
| author | Stefan Boberg <[email protected]> | 2025-09-27 22:41:09 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2025-09-27 22:41:09 +0200 |
| commit | 6c036989c9b74affc98c5f29e574375c59cbb0d2 (patch) | |
| tree | efa4fc9c7b02b34330bd281058c6ca2b98b29c01 /src/zenmaster/hostinterface.cpp | |
| parent | add zen master cmd (diff) | |
| download | zen-6c036989c9b74affc98c5f29e574375c59cbb0d2.tar.xz zen-6c036989c9b74affc98c5f29e574375c59cbb0d2.zip | |
minor additions
Diffstat (limited to 'src/zenmaster/hostinterface.cpp')
| -rw-r--r-- | src/zenmaster/hostinterface.cpp | 43 |
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 |