summaryrefslogtreecommitdiff
path: root/src/configreader.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-08-19 19:06:35 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-08-19 19:06:35 +0000
commit1c18eb24fa9dd886900582dc3b955d02bc6d9718 (patch)
treeebcb2b956e6c5dcb7e022f9abb1286a58070827a /src/configreader.cpp
parent9f1cefca61befadcb4bde6202385c79cd1e605cb (diff)
Add <connect:inherit> and <connect:name>
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7758 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/configreader.cpp')
-rw-r--r--src/configreader.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp
index ac483229a..c1ccc4ee9 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -404,25 +404,39 @@ 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();
+ int port = values[11].GetInteger();
+ const char* name = values[12].GetString();
+ const char* parent = values[13].GetString();
if (*parent)
{
/* Find 'parent' and inherit a new class from it,
* then overwrite any values that are set here
*/
+ for (std::vector<ConnectClass>::iterator item = conf->Classes.begin(); item != conf->Classes.end(); ++item)
+ {
+ if (item->GetName() == name)
+ {
+ ConnectClass c(name, *item);
+ c.Update(timeout, flood, std::string(*allow ? allow : deny), pingfreq, password, threshold, sendq, recvq, localmax, globalmax, 0);
+ c.SetPort(port);
+ conf->Classes.push_back(c);
+ }
+ }
+ throw CoreException("Class name '" + std::string(name) + "' is configured to inherit from class '" + std::string(name) + "' which cannot be found.");
}
else
{
if (*allow)
{
ConnectClass c(name, timeout, flood, allow, pingfreq, password, threshold, sendq, recvq, localmax, globalmax);
+ c.SetPort(port);
conf->Classes.push_back(c);
}
else
{
ConnectClass c(name, deny);
+ c.SetPort(port);
conf->Classes.push_back(c);
}
}