diff options
| author | Martin Ridgers <[email protected]> | 2021-11-22 09:13:27 +0100 |
|---|---|---|
| committer | Martin Ridgers <[email protected]> | 2021-11-22 09:13:27 +0100 |
| commit | be52dec8e8c1c5d3901d9f6d742c626931abff27 (patch) | |
| tree | a832df6ed494ea770fec3ee57a258d3cc9384a13 /zenserver/zenserver.cpp | |
| parent | Initial integration of Trace from UE5 via the --zentrace=y xmake config (diff) | |
| parent | Comment out unused variables to fix warnings. (diff) | |
| download | zen-be52dec8e8c1c5d3901d9f6d742c626931abff27.tar.xz zen-be52dec8e8c1c5d3901d9f6d742c626931abff27.zip | |
Merged 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 07936f2ef..e6b3e2cd0 100644 --- a/zenserver/zenserver.cpp +++ b/zenserver/zenserver.cpp @@ -155,16 +155,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) { @@ -188,7 +185,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))) { @@ -197,10 +194,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); @@ -864,7 +866,7 @@ ZenEntryPoint::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 |