- ConfigReader* Conf = new ConfigReader(ServerInstance);
-
- /* We don't need to worry about these being *unloaded* on the fly, only loaded,
- * because we 'use' the interface locking the module in memory.
- */
- hooks.clear();
- hooknames.clear();
- modulelist* ml = ServerInstance->Modules->FindInterface("BufferedSocketHook");
-
- /* Did we find any modules? */
- if (ml)
- {
- /* Yes, enumerate them all to find out the hook name */
- for (modulelist::iterator m = ml->begin(); m != ml->end(); m++)
- {
- /* Make a request to it for its name, its implementing
- * BufferedSocketHook so we know its safe to do this
- */
- std::string name = BufferedSocketNameRequest((Module*)Creator, *m).Send();
- /* Build a map of them */
- hooks[name.c_str()] = *m;
- hooknames.push_back(name);
- }
- }
-
- if (rebind)
- {
- for (unsigned int i = 0; i < Bindings.size(); i++)
- {
- delete Bindings[i];
- }
- ServerInstance->BufferedSocketCull();
- Bindings.clear();
-
- for (int j = 0; j < Conf->Enumerate("bind"); j++)
- {
- std::string Type = Conf->ReadValue("bind","type",j);
- std::string IP = Conf->ReadValue("bind","address",j);
- std::string Port = Conf->ReadValue("bind","port",j);
- std::string transport = Conf->ReadValue("bind","transport",j);
- if (Type == "servers")
- {
- irc::portparser portrange(Port, false);
- int portno = -1;
-
- if (IP == "*")
- IP.clear();
-
- while ((portno = portrange.GetToken()))
- {
- if ((!transport.empty()) && (hooks.find(transport.c_str()) == hooks.end()))
- {
- throw CoreException("Can't find transport type '"+transport+"' for port "+IP+":"+Port+" - maybe you forgot to load it BEFORE m_spanningtree in your config file?");
- break;
- }
-
- ServerSocketListener *listener = new ServerSocketListener(ServerInstance, this, portno, (char *)IP.c_str());
- if (listener->GetFd() == -1)
- {
- delete listener;
- continue;
- }
-
- if (!transport.empty())
- listener->AddIOHook(hooks[transport.c_str()]);
-
- Bindings.push_back(listener);
- }
- }
- }
- }
- FlatLinks = Conf->ReadFlag("security","flatlinks",0);
- HideULines = Conf->ReadFlag("security","hideulines",0);
- AnnounceTSChange = Conf->ReadFlag("options","announcets",0);
- ChallengeResponse = !Conf->ReadFlag("security", "disablehmac", 0);
- quiet_bursts = Conf->ReadFlag("performance", "quietbursts", 0);
- PingWarnTime = Conf->ReadInteger("options", "pingwarning", 0, true);
- PingFreq = Conf->ReadInteger("options", "serverpingfreq", 0, true);
-
- if (PingFreq == 0)
- PingFreq = 60;
-
- if (PingWarnTime < 0 || PingWarnTime > PingFreq - 1)
+ ConfigTag* security = ServerInstance->Config->ConfValue("security");
+ ConfigTag* options = ServerInstance->Config->ConfValue("options");
+ FlatLinks = security->getBool("flatlinks");
+ HideULines = security->getBool("hideulines");
+ HideSplits = security->getBool("hidesplits");
+ AnnounceTSChange = options->getBool("announcets");
+ AllowOptCommon = options->getBool("allowmismatch");
+ quiet_bursts = ServerInstance->Config->ConfValue("performance")->getBool("quietbursts");
+ PingWarnTime = options->getDuration("pingwarning", 15);
+ PingFreq = options->getDuration("serverpingfreq", 60, 1);
+
+ if (PingWarnTime >= PingFreq)