X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fconfigreader.cpp;h=382bcaffbdf43e24a33edb1d9a07e3b2c333b738;hb=428a5e3d0f5060d43c56a8a8595c8102241ce7ea;hp=166e124ca6ae400972e7bbea225616bed8a8ef6e;hpb=74ee9af96639323d852a8b15be72ee9974e0a826;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/configreader.cpp b/src/configreader.cpp index 166e124ca..382bcaffb 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -520,6 +520,7 @@ void ServerConfig::Fill() Limits.MaxAway = ConfValue("limits")->getInt("maxaway", 200); InvBypassModes = options->getBool("invitebypassmodes", true); NoSnoticeStack = options->getBool("nosnoticestack", false); + WelcomeNotice = options->getBool("welcomenotice", true); range(SoftLimit, 10, ServerInstance->SE->GetMaxFds(), ServerInstance->SE->GetMaxFds(), ""); range(MaxConn, 0, SOMAXCONN, SOMAXCONN, ""); @@ -575,22 +576,25 @@ void ServerConfig::Fill() ReadXLine(this, "exception", "host", ServerInstance->XLines->GetFactory("E")); memset(DisabledUModes, 0, sizeof(DisabledUModes)); - for (const unsigned char* p = (const unsigned char*)ConfValue("disabled")->getString("usermodes").c_str(); *p; ++p) + std::string modes = ConfValue("disabled")->getString("usermodes"); + for (std::string::const_iterator p = modes.begin(); p != modes.end(); ++p) { if (*p < 'A' || *p > ('A' + 64)) throw CoreException(std::string("Invalid usermode ")+(char)*p+" was found."); DisabledUModes[*p - 'A'] = 1; } memset(DisabledCModes, 0, sizeof(DisabledCModes)); - for (const unsigned char* p = (const unsigned char*)ConfValue("disabled")->getString("chanmodes").c_str(); *p; ++p) + modes = ConfValue("disabled")->getString("chanmodes"); + for (std::string::const_iterator p = modes.begin(); p != modes.end(); ++p) { if (*p < 'A' || *p > ('A' + 64)) throw CoreException(std::string("Invalid chanmode ")+(char)*p+" was found."); DisabledCModes[*p - 'A'] = 1; } memset(HideModeLists, 0, sizeof(HideModeLists)); - for (const unsigned char* p = (const unsigned char*)ConfValue("security")->getString("hidemodes").c_str(); *p; ++p) - HideModeLists[*p] = true; + modes = ConfValue("security")->getString("hidemodes"); + for (std::string::const_iterator p = modes.begin(); p != modes.end(); ++p) + HideModeLists[(unsigned char) *p] = true; std::string v = security->getString("announceinvites"); @@ -656,10 +660,14 @@ void ServerConfig::Apply(ServerConfig* old, const std::string &useruid) for (int Index = 0; Index * sizeof(Deprecated) < sizeof(ChangedConfig); Index++) { std::string dummy; - if (ConfValue(ChangedConfig[Index].tag)->readString(ChangedConfig[Index].value, dummy, true)) - errstr << "Your configuration contains a deprecated value: <" - << ChangedConfig[Index].tag << ":" << ChangedConfig[Index].value << "> - " << ChangedConfig[Index].reason - << " (at " << ConfValue(ChangedConfig[Index].tag)->getTagLocation() << ")\n"; + ConfigTagList tags = ConfTags(ChangedConfig[Index].tag); + for(ConfigIter i = tags.first; i != tags.second; ++i) + { + if (i->second->readString(ChangedConfig[Index].value, dummy, true)) + errstr << "Your configuration contains a deprecated value: <" + << ChangedConfig[Index].tag << ":" << ChangedConfig[Index].value << "> - " << ChangedConfig[Index].reason + << " (at " << i->second->getTagLocation() << ")\n"; + } } Fill(); @@ -942,7 +950,7 @@ const char* ServerConfig::CleanFilename(const char* name) return (p != name ? ++p : p); } -std::string ServerConfig::GetSID() +const std::string& ServerConfig::GetSID() { return sid; }