From 1d0bb9b26b7ad58ab0bf979ac046f4511b3bf12b Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 5 May 2013 01:55:04 -0400 Subject: Rework the config file reader to be much more flexible and move many configuration directives to the actual modules they are used in. --- modules/m_dns.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'modules/m_dns.cpp') diff --git a/modules/m_dns.cpp b/modules/m_dns.cpp index e8f3bd758..af16e3be3 100644 --- a/modules/m_dns.cpp +++ b/modules/m_dns.cpp @@ -940,16 +940,17 @@ class ModuleDNS : public Module ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } - void OnReload(ServerConfig *conf, ConfigReader &reader) anope_override + void OnReload(Configuration::Conf *conf) anope_override { - - nameserver = reader.ReadValue("dns", "nameserver", "127.0.0.1", 0); - timeout = Anope::DoTime(reader.ReadValue("dns", "timeout", "5", 0)); - ip = reader.ReadValue("dns", "ip", "0.0.0.0", 0); - port = reader.ReadInteger("dns", "port", "53", 0, false); - admin = reader.ReadValue("dns", "admin", "admin@example.com", 0); - nameservers = reader.ReadValue("dns", "nameservers", "ns1.example.com", 0); - refresh = reader.ReadInteger("dns", "refresh", "3600", 0, false); + Configuration::Block *block = conf->GetModule(this); + + nameserver = block->Get("nameserver", "127.0.0.1"); + timeout = block->Get("timeout", "5"); + ip = block->Get("ip", "0.0.0.0"); + port = block->Get("port", "53"); + admin = block->Get("admin", "admin@example.com"); + nameservers = block->Get("nameservers", "ns1.example.com"); + refresh = block->Get("refresh", "3600"); if (Anope::IsFile(nameserver)) { -- cgit