diff options
| author | Martin Ridgers <[email protected]> | 2021-11-29 09:18:03 +0100 |
|---|---|---|
| committer | Martin Ridgers <[email protected]> | 2021-11-29 09:18:03 +0100 |
| commit | 91aa9708bd42960405019148d39b57dda0155367 (patch) | |
| tree | b4ed6d1273e53cbe95e2ec20c37373f629947592 /zenserver/config.h | |
| parent | Added a simple NamedMutex test (diff) | |
| parent | Merge pull request #28 from EpicGames/non-elevated-asio (diff) | |
| download | zen-91aa9708bd42960405019148d39b57dda0155367.tar.xz zen-91aa9708bd42960405019148d39b57dda0155367.zip | |
Merged main
Diffstat (limited to 'zenserver/config.h')
| -rw-r--r-- | zenserver/config.h | 52 |
1 files changed, 24 insertions, 28 deletions
diff --git a/zenserver/config.h b/zenserver/config.h index 0f3994893..74e444339 100644 --- a/zenserver/config.h +++ b/zenserver/config.h @@ -10,27 +10,6 @@ # define ZEN_ENABLE_MESH 0 #endif -struct ZenServerOptions -{ - bool IsDebug = false; - bool IsTest = false; - bool IsDedicated = false; // Indicates a dedicated/shared instance, with larger resource requirements - int BasePort = 1337; // Service listen port (used for both UDP and TCP) - int OwnerPid = 0; // Parent process id (zero for standalone) - std::string ChildId; // Id assigned by parent process (used for lifetime management) - bool InstallService = false; // Flag used to initiate service install (temporary) - bool UninstallService = false; // Flag used to initiate service uninstall (temporary) - std::string LogId; // Id for tagging log output - std::filesystem::path DataDir; // Root directory for state (used for testing) - std::filesystem::path ContentDir; // Root directory for serving frontend content (experimental) - std::string HttpServerClass; // Choice of HTTP server implementation - std::filesystem::path AbsLogFile; // Absolute path to main log file -#if ZEN_WITH_TRACE - std::string TraceHost; // Host name or IP address to send trace data to - std::string TraceFile; // Path of a file to write a trace -#endif -}; - struct ZenUpstreamJupiterConfig { std::string Url; @@ -69,16 +48,33 @@ struct ZenUpstreamCacheConfig bool StatsEnabled = false; }; -struct ZenServiceConfig +struct ZenServerOptions { - bool StructuredCacheEnabled = true; - bool ShouldCrash = false; // Option for testing crash handling - bool IsFirstRun = false; + ZenUpstreamCacheConfig UpstreamCacheConfig; + std::filesystem::path DataDir; // Root directory for state (used for testing) + std::filesystem::path ContentDir; // Root directory for serving frontend content (experimental) + std::filesystem::path AbsLogFile; // Absolute path to main log file + std::filesystem::path ConfigFile; // Path to Lua config file + std::string ChildId; // Id assigned by parent process (used for lifetime management) + std::string LogId; // Id for tagging log output + std::string HttpServerClass; // Choice of HTTP server implementation + int BasePort = 1337; // Service listen port (used for both UDP and TCP) + int OwnerPid = 0; // Parent process id (zero for standalone) + bool InstallService = false; // Flag used to initiate service install (temporary) + bool UninstallService = false; // Flag used to initiate service uninstall (temporary) + bool IsDebug = false; + bool IsTest = false; + bool IsDedicated = false; // Indicates a dedicated/shared instance, with larger resource requirements + bool StructuredCacheEnabled = true; + bool ShouldCrash = false; // Option for testing crash handling + bool IsFirstRun = false; +#if ZEN_WITH_TRACE + std::string TraceHost; // Host name or IP address to send trace data to + std::string TraceFile; // Path of a file to write a trace +#endif #if ZEN_ENABLE_MESH bool MeshEnabled = false; // Experimental p2p mesh discovery #endif - ZenUpstreamCacheConfig UpstreamCacheConfig; }; -void ParseGlobalCliOptions(int argc, char* argv[], ZenServerOptions& GlobalOptions, ZenServiceConfig& ServiceConfig); -void ParseServiceConfig(const std::filesystem::path& DataRoot, ZenServiceConfig& ServiceConfig); +void ParseCliOptions(int argc, char* argv[], ZenServerOptions& ServerOptions); |