diff options
-rw-r--r-- | src/configreader.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp index 8aa19d6d6..d29ad8cef 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -383,21 +383,23 @@ void ServerConfig::Fill() { ConfigTag* options = ConfValue("options"); ConfigTag* security = ConfValue("security"); + ConfigTag* server = ConfValue("server"); if (sid.empty()) { - ServerName = ConfValue("server")->getString("name", "irc.example.com"); + ServerName = server->getString("name", "irc.example.com"); ValidHost(ServerName, "<server:name>"); - sid = ConfValue("server")->getString("id"); + sid = server->getString("id"); if (!sid.empty() && !InspIRCd::IsSID(sid)) throw CoreException(sid + " is not a valid server ID. A server ID must be 3 characters long, with the first character a digit and the next two characters a digit or letter."); } else { - if (ServerName != ConfValue("server")->getString("name")) + std::string name = server->getString("name"); + if (!name.empty() && name != ServerName) throw CoreException("You must restart to change the server name"); - std::string nsid = ConfValue("server")->getString("id"); + std::string nsid = server->getString("id"); if (!nsid.empty() && nsid != sid) throw CoreException("You must restart to change the server id"); } @@ -405,8 +407,8 @@ void ServerConfig::Fill() CCOnConnect = ConfValue("performance")->getBool("clonesonconnect", true); MaxConn = ConfValue("performance")->getInt("somaxconn", SOMAXCONN); XLineMessage = options->getString("xlinemessage", options->getString("moronbanner", "You're banned!")); - ServerDesc = ConfValue("server")->getString("description", "Configure Me"); - Network = ConfValue("server")->getString("network", "Network"); + ServerDesc = server->getString("description", "Configure Me"); + Network = server->getString("network", "Network"); NetBufferSize = ConfValue("performance")->getInt("netbuffersize", 10240, 1024, 65534); dns_timeout = ConfValue("dns")->getInt("timeout", 5); DisabledCommands = ConfValue("disabled")->getString("commands", ""); |