aboutsummaryrefslogtreecommitdiff
path: root/zenserver/config.h
blob: 04498a5204d44b5c1adc8b20e204016d94638267 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright Epic Games, Inc. All Rights Reserved.

#pragma once

#include <filesystem>
#include <string>

struct ZenServerOptions
{
	bool				  IsDebug  = false;
	bool				  IsTest   = false;
	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)
	std::string			  LogId;			// Id for tagging log output
	std::filesystem::path DataDir;			// Root directory for state (used for testing)
};

struct ZenServiceConfig
{
	bool		LegacyCacheEnabled	   = false;
	bool		StructuredCacheEnabled = true;
	bool		UpstreamCacheEnabled   = false;
	bool		ShouldCrash			   = false;	 // Option for testing crash handling
	bool		MeshEnabled			   = false;	 // Experimental p2p mesh discovery
	std::string FlockId;						 // Id for grouping test instances into sets
};

void ParseGlobalCliOptions(int argc, char* argv[], ZenServerOptions& GlobalOptions, ZenServiceConfig& ServiceConfig);
void ParseServiceConfig(const std::filesystem::path& DataRoot, ZenServiceConfig& ServiceConfig);