- ConfigReader* Conf = new ConfigReader(ServerInstance);
- if (rebind)
- {
- 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;
- while ((portno = portrange.GetToken()))
- {
- if (IP == "*")
- IP = "";
-
- if ((!transport.empty()) && (hooks.find(transport.c_str()) == hooks.end()))
- {
- ServerInstance->Log(DEFAULT,"m_spanningtree: WARNING: Can't find transport type '%s' for port %s:%s - maybe you forgot to load it BEFORE m_spanningtree in your config file? - Skipping this port binding", transport.c_str(), IP.c_str(), Port.c_str());
- break;
- }
-
- TreeSocket* listener = new TreeSocket(this, ServerInstance, IP.c_str(), portno, true, 10, transport.empty() ? NULL : hooks[transport.c_str()]);
- if (listener->GetState() == I_LISTENING)
- {
- ServerInstance->Log(DEFAULT,"m_spanningtree: Binding server port %s:%d successful!", IP.c_str(), portno);
- Bindings.push_back(listener);
- }
- else
- {
- ServerInstance->Log(DEFAULT,"m_spanningtree: Warning: Failed to bind server port: %s:%d: %s",IP.c_str(), portno, strerror(errno));
- listener->Close();
- DELETE(listener);
- }
- }
- }
- }
- }
- FlatLinks = Conf->ReadFlag("options","flatlinks",0);
- HideULines = Conf->ReadFlag("options","hideulines",0);
- AnnounceTSChange = Conf->ReadFlag("options","announcets",0);
- EnableTimeSync = Conf->ReadFlag("timesync","enable",0);
- MasterTime = Conf->ReadFlag("timesync", "master", 0);
- ChallengeResponse = !Conf->ReadFlag("options", "disablehmac", 0);
- quiet_bursts = Conf->ReadFlag("options", "quietbursts", 0);
- PingWarnTime = Conf->ReadInteger("options", "pingwarning", 0, true);
-
- if (PingWarnTime < 0 || PingWarnTime > 59)
+ ConfigTag* security = ServerInstance->Config->ConfValue("security");
+ ConfigTag* options = ServerInstance->Config->ConfValue("options");
+ FlatLinks = security->getBool("flatlinks");
+ HideULines = security->getBool("hideulines");
+ AnnounceTSChange = options->getBool("announcets");
+ AllowOptCommon = options->getBool("allowmismatch");
+ ChallengeResponse = !security->getBool("disablehmac");
+ quiet_bursts = ServerInstance->Config->ConfValue("performance")->getBool("quietbursts");
+ PingWarnTime = options->getInt("pingwarning");
+ PingFreq = options->getInt("serverpingfreq");
+
+ if (PingFreq == 0)
+ PingFreq = 60;
+
+ if (PingWarnTime < 0 || PingWarnTime > PingFreq - 1)