diff options
| author | Stefan Boberg <[email protected]> | 2021-11-18 19:25:31 +0100 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-11-18 19:25:31 +0100 |
| commit | f74d55e41daa9f95b45cf5f4cd195664f1502bf0 (patch) | |
| tree | 26f8e59741a7b72893aacc6ffd7ad7bd61341042 /zenserver/zenserver.cpp | |
| parent | explicitly delete some unnecessary class members to ensure proper usage (diff) | |
| parent | Merge branch 'main' of https://github.com/EpicGames/zen (diff) | |
| download | zen-f74d55e41daa9f95b45cf5f4cd195664f1502bf0.tar.xz zen-f74d55e41daa9f95b45cf5f4cd195664f1502bf0.zip | |
merged from main
Diffstat (limited to 'zenserver/zenserver.cpp')
| -rw-r--r-- | zenserver/zenserver.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/zenserver/zenserver.cpp b/zenserver/zenserver.cpp index bb57b4d0a..567f1d40b 100644 --- a/zenserver/zenserver.cpp +++ b/zenserver/zenserver.cpp @@ -151,16 +151,13 @@ namespace utils { class ZenServer : public IHttpStatusProvider { public: - void Initialize(ZenServiceConfig& ServiceConfig, - std::string_view HttpServerClass, - int BasePort, - int ParentPid, - ZenServerState::ZenServerEntry* ServerEntry) + void Initialize(ZenServiceConfig& ServiceConfig, const ZenServerOptions& ServerOptions, ZenServerState::ZenServerEntry* ServerEntry) { using namespace fmt::literals; m_ServerEntry = ServerEntry; m_DebugOptionForcedCrash = ServiceConfig.ShouldCrash; + const int ParentPid = ServerOptions.OwnerPid; if (ParentPid) { @@ -184,7 +181,7 @@ public: // Initialize/check mutex based on base port - std::string MutexName = "zen_{}"_format(BasePort); + std::string MutexName = "zen_{}"_format(ServerOptions.BasePort); if (zen::NamedMutex::Exists(MutexName) || ((m_ServerMutex.Create(MutexName) == false))) { @@ -193,10 +190,15 @@ public: InitializeState(ServiceConfig); + m_HealthService.SetHealthInfo({.DataRoot = m_DataRoot, + .AbsLogPath = ServerOptions.AbsLogFile, + .HttpServerClass = std::string(ServerOptions.HttpServerClass), + .BuildVersion = std::string(BUILD_VERSION)}); + // Ok so now we're configured, let's kick things off - m_Http = zen::CreateHttpServer(HttpServerClass); - m_Http->Initialize(BasePort); + m_Http = zen::CreateHttpServer(ServerOptions.HttpServerClass); + m_Http->Initialize(ServerOptions.BasePort); m_Http->RegisterService(m_HealthService); m_Http->RegisterService(m_StatsService); m_Http->RegisterService(m_StatusService); @@ -878,7 +880,7 @@ ZenWindowsService::Run() Server.SetContentRoot(GlobalOptions.ContentDir); Server.SetTestMode(GlobalOptions.IsTest); Server.SetDedicatedMode(GlobalOptions.IsDedicated); - Server.Initialize(ServiceConfig, GlobalOptions.HttpServerClass, GlobalOptions.BasePort, GlobalOptions.OwnerPid, Entry); + Server.Initialize(ServiceConfig, GlobalOptions, Entry); // Monitor shutdown signals |