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/commands/cs_set_misc.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'modules/commands/cs_set_misc.cpp') diff --git a/modules/commands/cs_set_misc.cpp b/modules/commands/cs_set_misc.cpp index e74587be1..325b652cd 100644 --- a/modules/commands/cs_set_misc.cpp +++ b/modules/commands/cs_set_misc.cpp @@ -142,17 +142,19 @@ class CSSetMisc : 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 { descriptions.clear(); - for (int i = 0; i < reader.Enumerate("command"); ++i) + for (int i = 0; i < conf->CountBlock("command"); ++i) { - if (reader.ReadValue("command", "command", "", i) != "chanserv/set/misc") + Configuration::Block *block = conf->GetBlock("command", i); + + if (block->Get("command") != "chanserv/set/misc") continue; - Anope::string cname = reader.ReadValue("command", "name", "", i); - Anope::string desc = reader.ReadValue("command", "misc_description", "", i); + Anope::string cname = block->Get("name"); + Anope::string desc = block->Get("misc_description"); if (cname.empty() || desc.empty()) continue; -- cgit