]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/configreader.cpp
Convert WriteNumeric() calls to pass the parameters of the numeric as method parameters
[user/henk/code/inspircd.git] / src / configreader.cpp
index d52f3de13fdc3f03690947555f0f4a6d92b6337e..cec4be3d3d068a93041f6755d65dbedcee6443e0 100644 (file)
@@ -53,9 +53,10 @@ static ConfigTag* CreateEmptyTag()
 ServerConfig::ServerConfig()
        : EmptyTag(CreateEmptyTag())
        , Limits(EmptyTag)
+       , NoSnoticeStack(false)
 {
-       RawLog = HideBans = HideSplits = UndernetMsgPrefix = false;
-       WildcardIPv6 = InvBypassModes = true;
+       RawLog = HideBans = HideSplits = false;
+       WildcardIPv6 = true;
        dns_timeout = 5;
        MaxTargets = 20;
        NetBufferSize = 10240;
@@ -412,7 +413,6 @@ void ServerConfig::Fill()
        GenericOper = security->getBool("genericoper");
        SyntaxHints = options->getBool("syntaxhints");
        CycleHostsFromUser = options->getBool("cyclehostsfromuser");
-       UndernetMsgPrefix = options->getBool("ircumsgprefix");
        FullHostInTopic = options->getBool("hostintopic");
        MaxTargets = security->getInt("maxtargets", 20, 1, 31);
        DefaultModes = options->getString("defaultmodes", "not");
@@ -426,7 +426,6 @@ void ServerConfig::Fill()
        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);
-       InvBypassModes = options->getBool("invitebypassmodes", true);
        NoSnoticeStack = options->getBool("nosnoticestack", false);
 
        if (Network.find(' ') != std::string::npos)
@@ -575,7 +574,7 @@ void ServerConfig::Apply(ServerConfig* old, const std::string &useruid)
                 errstr << "Possible configuration error: you have not defined any <bind> blocks." << std::endl
                         << "You will need to do this if you want clients to be able to connect!" << std::endl;
 
-       if (old)
+       if (old && valid)
        {
                // On first run, ports are bound later on
                FailedPortList pl;
@@ -627,11 +626,11 @@ void ServerConfig::Apply(ServerConfig* old, const std::string &useruid)
                ConfigTag *tag = (*it)->config;
                // Make sure our connection class allows motd colors
                if(!tag->getBool("allowmotdcolors"))
-                     continue;
+                       continue;
 
                ConfigFileCache::iterator file = this->Files.find(tag->getString("motd", "motd"));
                if (file != this->Files.end())
-                     InspIRCd::ProcessColors(file->second);
+                       InspIRCd::ProcessColors(file->second);
        }
 
        /* No old configuration -> initial boot, nothing more to do here */
@@ -670,6 +669,7 @@ void ServerConfig::ApplyModules(User* user)
                std::string name;
                if (tag->readString("name", name))
                {
+                       name = ModuleManager::ExpandModName(name);
                        // if this module is already loaded, the erase will succeed, so we need do nothing
                        // otherwise, we need to add the module (which will be done later)
                        if (removed_modules.erase(name) == 0)
@@ -688,16 +688,16 @@ void ServerConfig::ApplyModules(User* user)
                        ServerInstance->SNO->WriteGlobalSno('a', "*** REHASH UNLOADED MODULE: %s", modname.c_str());
 
                        if (user)
-                               user->WriteNumeric(RPL_UNLOADEDMODULE, "%s :Module %s successfully unloaded.", modname.c_str(), modname.c_str());
+                               user->WriteNumeric(RPL_UNLOADEDMODULE, modname, InspIRCd::Format("Module %s successfully unloaded.", modname.c_str()));
                        else
                                ServerInstance->SNO->WriteGlobalSno('a', "Module %s successfully unloaded.", modname.c_str());
                }
                else
                {
                        if (user)
-                               user->WriteNumeric(ERR_CANTUNLOADMODULE, "%s :Failed to unload module %s: %s", modname.c_str(), modname.c_str(), ServerInstance->Modules->LastError().c_str());
+                               user->WriteNumeric(ERR_CANTUNLOADMODULE, modname, InspIRCd::Format("Failed to unload module %s: %s", modname.c_str(), ServerInstance->Modules->LastError().c_str()));
                        else
-                                ServerInstance->SNO->WriteGlobalSno('a', "Failed to unload module %s: %s", modname.c_str(), ServerInstance->Modules->LastError().c_str());
+                               ServerInstance->SNO->WriteGlobalSno('a', "Failed to unload module %s: %s", modname.c_str(), ServerInstance->Modules->LastError().c_str());
                }
        }
 
@@ -707,14 +707,14 @@ void ServerConfig::ApplyModules(User* user)
                {
                        ServerInstance->SNO->WriteGlobalSno('a', "*** REHASH LOADED MODULE: %s",adding->c_str());
                        if (user)
-                               user->WriteNumeric(RPL_LOADEDMODULE, "%s :Module %s successfully loaded.", adding->c_str(), adding->c_str());
+                               user->WriteNumeric(RPL_LOADEDMODULE, *adding, InspIRCd::Format("Module %s successfully loaded.", adding->c_str()));
                        else
                                ServerInstance->SNO->WriteGlobalSno('a', "Module %s successfully loaded.", adding->c_str());
                }
                else
                {
                        if (user)
-                               user->WriteNumeric(ERR_CANTLOADMODULE, "%s :Failed to load module %s: %s", adding->c_str(), adding->c_str(), ServerInstance->Modules->LastError().c_str());
+                               user->WriteNumeric(ERR_CANTLOADMODULE, *adding, InspIRCd::Format("Failed to load module %s: %s", adding->c_str(), ServerInstance->Modules->LastError().c_str()));
                        else
                                ServerInstance->SNO->WriteGlobalSno('a', "Failed to load module %s: %s", adding->c_str(), ServerInstance->Modules->LastError().c_str());
                }
@@ -784,6 +784,7 @@ void ConfigReaderThread::Finish()
                 * XXX: The order of these is IMPORTANT, do not reorder them without testing
                 * thoroughly!!!
                 */
+               ServerInstance->Users.RehashCloneCounts();
                ServerInstance->XLines->CheckELines();
                ServerInstance->XLines->ApplyLines();
                ChanModeReference ban(NULL, "ban");