summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-11-09 23:55:27 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-11-09 23:55:27 +0000
commitbee3f8676a9e70f387015aa3e84694efd91fa6bc (patch)
tree1f1fce9a4a27aec34ead338aadabbba5e7d9bcc7 /src
parenteaace5ed7cef3a02f905689a1b44a092ca99a6e1 (diff)
Set a name on all connect blocks
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12065 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/configreader.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 348554584..382e8aff9 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -361,13 +361,15 @@ void ServerConfig::CrossCheckConnectBlocks(ServerConfig* current)
}
std::string name = tag->getString("name");
- if (!name.empty())
+ if (name.empty())
{
- if (names.find(name) != names.end())
- throw CoreException("Two connect classes with name \"" + name + "\" defined!");
- names[name] = i;
+ name = "unnamed-" + ConvToStr(i);
}
+ if (names.find(name) != names.end())
+ throw CoreException("Two connect classes with name \"" + name + "\" defined!");
+ names[name] = i;
+
std::string mask, typeMask;
char type;
@@ -393,8 +395,7 @@ void ServerConfig::CrossCheckConnectBlocks(ServerConfig* current)
new ConnectClass(tag, type, mask, *parent) :
new ConnectClass(tag, type, mask);
- if (!name.empty())
- me->name = name;
+ me->name = name;
tag->readString("password", me->pass);
tag->readString("hash", me->hash);