]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/configreader.cpp
/who tidyup - needs QA'ing
[user/henk/code/inspircd.git] / src / configreader.cpp
index feb55b293e16e51c4889518418714e1c658a86fe..1d4908f7acad9c7f87ae81fc5bf78e7059cc942b 100644 (file)
@@ -39,6 +39,8 @@ ServerConfig::ServerConfig(InspIRCd* Instance) : ServerInstance(Instance)
        MaxConn = SOMAXCONN;
        MaxWhoResults = 100;
        debugging = 0;
+       MaxChans = 20;
+       OperMaxChans = 30;
        LogLevel = DEFAULT;
        maxbans.clear();
 }
@@ -588,12 +590,15 @@ void ServerConfig::Read(bool bail, userrec* user)
                {"options",     "syntaxhints",  "0",                    new ValueContainerBool (&this->SyntaxHints),            DT_BOOLEAN, NoValidation},
                {"options",     "cyclehosts",   "0",                    new ValueContainerBool (&this->CycleHosts),             DT_BOOLEAN, NoValidation},
                {"options",     "ircumsgprefix","0",                    new ValueContainerBool (&this->UndernetMsgPrefix),      DT_BOOLEAN, NoValidation},
+               {"options",     "announceinvites", "1",                 new ValueContainerBool (&this->AnnounceInvites),        DT_BOOLEAN, NoValidation},
                {"options",     "hostintopic",  "1",                    new ValueContainerBool (&this->FullHostInTopic),        DT_BOOLEAN, NoValidation},
                {"pid",         "file",         "",                     new ValueContainerChar (this->PID),                     DT_CHARPTR, NoValidation},
                {"whowas",      "groupsize",    "10",                   new ValueContainerInt  (&this->WhoWasGroupSize),        DT_INTEGER, NoValidation},
                {"whowas",      "maxgroups",    "10240",                new ValueContainerInt  (&this->WhoWasMaxGroups),        DT_INTEGER, NoValidation},
                {"whowas",      "maxkeep",      "3600",                 new ValueContainerChar (maxkeep),                       DT_CHARPTR, ValidateWhoWas},
                {"die",         "value",        "",                     new ValueContainerChar (this->DieValue),                DT_CHARPTR, NoValidation},
+               {"channels",    "users",        "20",                   new ValueContainerUInt (&this->MaxChans),               DT_INTEGER, NoValidation},
+               {"channels",    "opers",        "60",                   new ValueContainerUInt (&this->OperMaxChans),           DT_INTEGER, NoValidation},
                {NULL}
        };
 
@@ -1499,12 +1504,12 @@ char* ServerConfig::CleanFilename(char* name)
 
 bool ServerConfig::DirValid(const char* dirandfile)
 {
-       char work[MAXBUF];
-       char buffer[MAXBUF];
-       char otherdir[MAXBUF];
+       char work[1024];
+       char buffer[1024];
+       char otherdir[1024];
        int p;
 
-       strlcpy(work, dirandfile, MAXBUF);
+       strlcpy(work, dirandfile, 1024);
        p = strlen(work);
 
        // we just want the dir
@@ -1520,13 +1525,13 @@ bool ServerConfig::DirValid(const char* dirandfile)
        }
 
        // Get the current working directory
-       if (getcwd(buffer, MAXBUF ) == NULL )
+       if (getcwd(buffer, 1024 ) == NULL )
                return false;
 
        if (chdir(work) == -1)
                return false;
 
-       if (getcwd(otherdir, MAXBUF ) == NULL )
+       if (getcwd(otherdir, 1024 ) == NULL )
                return false;
 
        if (chdir(buffer) == -1)
@@ -1553,12 +1558,12 @@ bool ServerConfig::DirValid(const char* dirandfile)
 
 std::string ServerConfig::GetFullProgDir(char** argv, int argc)
 {
-       char work[MAXBUF];
-       char buffer[MAXBUF];
-       char otherdir[MAXBUF];
+       char work[1024];
+       char buffer[1024];
+       char otherdir[1024];
        int p;
 
-       strlcpy(work,argv[0],MAXBUF);
+       strlcpy(work,argv[0],1024);
        p = strlen(work);
 
        // we just want the dir
@@ -1574,13 +1579,13 @@ std::string ServerConfig::GetFullProgDir(char** argv, int argc)
        }
 
        // Get the current working directory
-       if (getcwd(buffer, MAXBUF) == NULL)
+       if (getcwd(buffer, 1024) == NULL)
                return "";
 
        if (chdir(work) == -1)
                return "";
 
-       if (getcwd(otherdir, MAXBUF) == NULL)
+       if (getcwd(otherdir, 1024) == NULL)
                return "";
 
        if (chdir(buffer) == -1)