From 7c1e92adea5eb9e492ec186d9913918eaf2c22e4 Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Mon, 27 Sep 2021 17:15:16 +0200 Subject: mesh: Hide mesh functionality behind ZEN_ENABLE_MESH define This enables us to hide it from users until it's actually useful --- zenserver/config.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'zenserver/config.cpp') diff --git a/zenserver/config.cpp b/zenserver/config.cpp index 91fb80747..42f59b26c 100644 --- a/zenserver/config.cpp +++ b/zenserver/config.cpp @@ -122,12 +122,14 @@ ParseGlobalCliOptions(int argc, char* argv[], ZenServerOptions& GlobalOptions, Z cxxopts::value(GlobalOptions.BasePort)->default_value("1337"), ""); +#if ZEN_ENABLE_MESH options.add_option("network", "m", "mesh", "Enable mesh network", cxxopts::value(ServiceConfig.MeshEnabled)->default_value("false"), ""); +#endif options.add_option("diagnostics", "", @@ -311,7 +313,9 @@ ParseServiceConfig(const std::filesystem::path& DataRoot, ZenServiceConfig& Serv throw std::runtime_error("failed to run global config script ('{}'): {}"_format(ConfigScript, e.what()).c_str()); } +#if ZEN_ENABLE_MESH ServiceConfig.MeshEnabled = lua["mesh"]["enable"].get_or(ServiceConfig.MeshEnabled); +#endif auto UpdateStringValueFromConfig = [](const sol::table& Table, std::string_view Key, std::string& OutValue) { // Update the specified config value unless it has been set, i.e. from command line -- cgit v1.2.3