]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Add parsing of <limits> tag and finish documenting it, make all the values match...
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 25 May 2008 18:00:55 +0000 (18:00 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 25 May 2008 18:00:55 +0000 (18:00 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9808 e03df62e-2008-0410-955e-edbf42e46eb7

docs/inspircd.conf.example
include/configreader.h
src/configreader.cpp

index 8e7ebdb00ef39f96d3b2dfe014b43d64960d06aa..c925971d5a75a8aa171940beec8614b7d587691e 100644 (file)
 #                                                                     #
 # Values here should be self explanitory:                             #
 #                                                                     #
-# nickmax         - The maximum length of a nickname                  #
-# chanmax         - The maximum length of a channel name              #
-# modemax         - The maximum number of parameterized mode changes  #
+# maxnick         - The maximum length of a nickname                  #
+# maxchan         - The maximum length of a channel name              #
+# maxmodes        - The maximum number of parameterized mode changes  #
 #                   per line                                          #
-# identmax        - The maximum length of an ident/username value     #
+# maxident        - The maximum length of an ident/username value     #
 # maxquit         - The maximum length of a quit message              #
 # maxtopic        - The maximum length of a channel topic             #
 # maxkick         - The maximum length of a kick message              #
 # maxaway         - The maximum length of an away message             #
 #                                                                     #
 
-<limits nickmax="31"
-        chanmax="64"
-        modemax="20"
-        identmax="11"
+<limits maxnick="31"
+        maxchan="64"
+        maxmodes="20"
+        maxident="11"
         maxquit="255"
         maxtopic="307"
         maxkick="255"
index 56a2ee6988185d3b82894acb9dbb2d573e251514..840e227de1d5cc427e17468e56d6e17ee99c2807 100644 (file)
@@ -150,6 +150,8 @@ typedef ValueContainer<char*> ValueContainerChar;
  */
 typedef ValueContainer<int*> ValueContainerInt;
 
+typedef ValueContainer<size_t*> ValueContainerST;
+
 /** A set of ValueItems used by multi-value validator functions
  */
 typedef std::deque<ValueItem> ValueList;
index 76aae190b7f38e649cd0ea1ee61135a978023f9b..f572211f380cd5db32531366b00f9cc1b036511d 100644 (file)
@@ -844,9 +844,19 @@ void ServerConfig::Read(bool bail, User* user)
                {"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},
+               {"limits",      "maxnick",      "32",                   new ValueContainerST (&this->Limits.NickMax),           DT_INTEGER,  NoValidation},
+               {"limits",      "maxchan",      "64",                   new ValueContainerST (&this->Limits.ChanMax),           DT_INTEGER,  NoValidation},
+               {"limits",      "maxmodes",     "20",                   new ValueContainerST (&this->Limits.MaxModes),          DT_INTEGER,  NoValidation},
+               {"limits",      "maxident",     "11",                   new ValueContainerST (&this->Limits.IdentMax),          DT_INTEGER,  NoValidation},
+               {"limits",      "maxquit",      "255",                  new ValueContainerST (&this->Limits.MaxQuit),           DT_INTEGER,  NoValidation},
+               {"limits",      "maxtopic",     "307",                  new ValueContainerST (&this->Limits.MaxTopic),          DT_INTEGER,  NoValidation},
+               {"limits",      "maxkick",      "255",                  new ValueContainerST (&this->Limits.MaxKick),           DT_INTEGER,  NoValidation},
+               {"limits",      "maxgecos",     "128",                  new ValueContainerST (&this->Limits.MaxGecos),          DT_INTEGER,  NoValidation},
+               {"limits",      "maxaway",      "200",                  new ValueContainerST (&this->Limits.MaxAway),           DT_INTEGER,  NoValidation},
                {NULL,          NULL,           NULL,                   NULL,                                                   DT_NOTHING,  NoValidation}
        };
 
+
        /* These tags can occur multiple times, and therefore they have special code to read them
         * which is different to the code for reading the singular tags listed above.
         */