summaryrefslogtreecommitdiff
path: root/src/configreader.cpp
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2017-08-27 12:59:02 +0100
committerPeter Powell <petpow@saberuk.com>2017-09-03 15:35:41 +0100
commit6399cd9327eac2776355644fe21acb02e52cf16c (patch)
tree3c9f462abf804573e3e5e447362150b22d98a2bf /src/configreader.cpp
parenta3f2e6ed5424c3e27aa1c7226bb436cd46bb19f7 (diff)
Add a ConfigTag* parameter to the ServerPaths constructor.
This is used to directly read the settings from the config tag like how ServerLimits works.
Diffstat (limited to 'src/configreader.cpp')
-rw-r--r--src/configreader.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp
index fa12648aa..853e0d80f 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -44,6 +44,14 @@ ServerLimits::ServerLimits(ConfigTag* tag)
{
}
+ServerConfig::ServerPaths::ServerPaths(ConfigTag* tag)
+ : Config(tag->getString("configdir", INSPIRCD_CONFIG_PATH))
+ , Data(tag->getString("datadir", INSPIRCD_DATA_PATH))
+ , Log(tag->getString("logdir", INSPIRCD_LOG_PATH))
+ , Module(tag->getString("moduledir", INSPIRCD_MODULE_PATH))
+{
+}
+
static ConfigTag* CreateEmptyTag()
{
ConfigItems* items;
@@ -53,6 +61,7 @@ static ConfigTag* CreateEmptyTag()
ServerConfig::ServerConfig()
: EmptyTag(CreateEmptyTag())
, Limits(EmptyTag)
+ , Paths(EmptyTag)
, NoSnoticeStack(false)
{
RawLog = HideBans = HideSplits = false;
@@ -433,10 +442,7 @@ void ServerConfig::Fill()
c_ipv4_range = ConfValue("cidr")->getInt("ipv4clone", 32);
c_ipv6_range = ConfValue("cidr")->getInt("ipv6clone", 128);
Limits = ServerLimits(ConfValue("limits"));
- Paths.Config = ConfValue("path")->getString("configdir", INSPIRCD_CONFIG_PATH);
- Paths.Data = ConfValue("path")->getString("datadir", INSPIRCD_DATA_PATH);
- Paths.Log = ConfValue("path")->getString("logdir", INSPIRCD_LOG_PATH);
- Paths.Module = ConfValue("path")->getString("moduledir", INSPIRCD_MODULE_PATH);
+ Paths = ServerPaths(ConfValue("path"));
NoSnoticeStack = options->getBool("nosnoticestack", false);
if (Network.find(' ') != std::string::npos)