]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Add extra stuff to make it work (and compile)
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 19 Aug 2007 17:16:50 +0000 (17:16 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 19 Aug 2007 17:16:50 +0000 (17:16 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7757 e03df62e-2008-0410-955e-edbf42e46eb7

include/configreader.h
src/configreader.cpp

index 94302f25c57a0948a817a41f9ae4d10edb814ab7..7c55924324fd5e1822816962fbba4e66f0004a55 100644 (file)
@@ -182,11 +182,11 @@ struct MultiConfig
        /** Tag name */
        const char*     tag;
        /** One or more items within tag */
-       char*           items[13];
+       char*           items[15];
        /** One or more defaults for items within tags */
-       char*           items_default[13];
+       char*           items_default[15];
        /** One or more data types */
-       int             datatype[13];
+       int             datatype[15];
        /** Initialization function */
        MultiNotify     init_function;
        /** Validation function */
index ccf88ea0d7b42488817b344eb10ab6b93c1174a4..ac483229af7c243d3529db690d60fffb679b5aac 100644 (file)
@@ -404,16 +404,27 @@ bool DoConnect(ServerConfig* conf, const char* tag, char** entries, ValueList &v
        int recvq = values[8].GetInteger();
        int localmax = values[9].GetInteger();
        int globalmax = values[10].GetInteger();
+       const char* name = values[11].GetString();
+       const char* parent = values[12].GetString();
 
-       if (*allow)
+       if (*parent)
        {
-               ConnectClass c(timeout, flood, allow, pingfreq, password, threshold, sendq, recvq, localmax, globalmax);
-               conf->Classes.push_back(c);
+               /* Find 'parent' and inherit a new class from it,
+                * then overwrite any values that are set here
+                */
        }
        else
        {
-               ConnectClass c(deny);
-               conf->Classes.push_back(c);
+               if (*allow)
+               {
+                       ConnectClass c(name, timeout, flood, allow, pingfreq, password, threshold, sendq, recvq, localmax, globalmax);
+                       conf->Classes.push_back(c);
+               }
+               else
+               {
+                       ConnectClass c(name, deny);
+                       conf->Classes.push_back(c);
+               }
        }
 
        return true;
@@ -647,12 +658,15 @@ void ServerConfig::Read(bool bail, userrec* user)
                {"connect",
                                {"allow",       "deny",         "password",     "timeout",      "pingfreq",     "flood",
                                "threshold",    "sendq",        "recvq",        "localmax",     "globalmax",    "port",
+                               "name",         "parent",
                                NULL},
                                {"",            "",             "",             "",             "120",          "",
                                 "",            "",             "",             "3",            "3",            "0",
+                                "",            "",
                                 NULL},
                                {DT_CHARPTR,    DT_CHARPTR,     DT_CHARPTR,     DT_INTEGER,     DT_INTEGER,     DT_INTEGER,
-                                DT_INTEGER,    DT_INTEGER,     DT_INTEGER,     DT_INTEGER,     DT_INTEGER,     DT_INTEGER},
+                                DT_INTEGER,    DT_INTEGER,     DT_INTEGER,     DT_INTEGER,     DT_INTEGER,     DT_INTEGER,
+                                DT_CHARPTR,    DT_CHARPTR},
                                InitConnect, DoConnect, DoneConnect},
 
                {"uline",