aboutsummaryrefslogtreecommitdiff
path: root/zenserver/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'zenserver/config.h')
-rw-r--r--zenserver/config.h44
1 files changed, 20 insertions, 24 deletions
diff --git a/zenserver/config.h b/zenserver/config.h
index 36156a570..4229c5bcc 100644
--- a/zenserver/config.h
+++ b/zenserver/config.h
@@ -9,23 +9,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
-};
-
struct ZenUpstreamJupiterConfig
{
std::string Url;
@@ -64,16 +47,29 @@ 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_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);