From bee3f8676a9e70f387015aa3e84694efd91fa6bc Mon Sep 17 00:00:00 2001 From: danieldg Date: Mon, 9 Nov 2009 23:55:27 +0000 Subject: Set a name on all connect blocks git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12065 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/configreader.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src') 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); -- cgit v1.2.3