]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/configreader.cpp
publish "JSON-RPC" interface
[user/henk/code/inspircd.git] / src / configreader.cpp
index 76aec8ee5aae074177344e14230a4b08401dba81..d4291692ff72385585f84090f5b38c3b9a80b022 100644 (file)
@@ -37,7 +37,7 @@ ServerConfig::ServerConfig(InspIRCd* Instance) : ServerInstance(Instance)
        NetBufferSize = 10240;
        SoftLimit = MAXCLIENTS;
        MaxConn = SOMAXCONN;
-       MaxWhoResults = 100;
+       MaxWhoResults = 0;
        debugging = 0;
        MaxChans = 20;
        OperMaxChans = 30;
@@ -129,7 +129,7 @@ void ServerConfig::Update005()
                        char buf[MAXBUF];
                        snprintf(buf, MAXBUF, "%s:are supported by this server", line5.c_str());
                        isupport.push_back(buf);
-                       line5 = "";
+                       line5.clear();
                        token_counter = 0;
                }
        }
@@ -225,6 +225,11 @@ bool ValidateDnsServer(ServerConfig* conf, const char* tag, const char* value, V
 #ifdef WINDOWS
                conf->GetInstance()->Log(DEFAULT,"WARNING: <dns:server> not defined, attempting to find working server in the registry...");
                nameserver = FindNameServerWin();
+               /* Windows stacks multiple nameservers in one registry key, seperated by commas.
+                * Spotted by Cataclysm.
+                */
+               if (nameserver.find(',') != std::string::npos)
+                       nameserver = nameserver.substr(0, nameserver.find(','));
                data.Set(nameserver.c_str());
                conf->GetInstance()->Log(DEFAULT,"<dns:server> set to '%s' as first active resolver in registry.", nameserver.c_str());
 #else
@@ -292,9 +297,9 @@ bool ValidateNetBufferSize(ServerConfig* conf, const char* tag, const char* valu
 
 bool ValidateMaxWho(ServerConfig* conf, const char* tag, const char* value, ValueItem &data)
 {
-       if ((!data.GetInteger()) || (data.GetInteger() > 65535) || (data.GetInteger() < 1))
+       if ((data.GetInteger() > 65535) || (data.GetInteger() < 1))
        {
-               conf->GetInstance()->Log(DEFAULT,"No MaxWhoResults specified or size out of range, setting to default of 128.");
+               conf->GetInstance()->Log(DEFAULT,"<options:maxwhoresults> size out of range, setting to default of 128.");
                data.Set(128);
        }
        return true;
@@ -593,6 +598,7 @@ void ServerConfig::Read(bool bail, userrec* user)
        InitialConfig Values[] = {
                {"options",     "softlimit",    MAXCLIENTS_S,           new ValueContainerUInt (&this->SoftLimit),              DT_INTEGER, ValidateSoftLimit},
                {"options",     "somaxconn",    SOMAXCONN_S,            new ValueContainerInt  (&this->MaxConn),                DT_INTEGER, ValidateMaxConn},
+               {"options",     "moronbanner",  "Youre banned!",        new ValueContainerChar (this->MoronBanner),             DT_CHARPTR, NoValidation},
                {"server",      "name",         "",                     new ValueContainerChar (this->ServerName),              DT_CHARPTR, ValidateServerName},
                {"server",      "description",  "Configure Me",         new ValueContainerChar (this->ServerDesc),              DT_CHARPTR, NoValidation},
                {"server",      "network",      "Network",              new ValueContainerChar (this->Network),                 DT_CHARPTR, NoValidation},