]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_maphide.cpp
Dynamically determine the size of the eventlist[] passed to Attach()
[user/henk/code/inspircd.git] / src / modules / m_maphide.cpp
index b78cd2c7eca85028fb394509f98cc8b3718b6d7f..d9e58ca48ad90ade6c626c8bb57b1eec5d9d90b5 100644 (file)
@@ -25,17 +25,16 @@ class ModuleMapHide : public Module
 {
        std::string url;
  public:
-       ModuleMapHide()
+       void init()
        {
                Implementation eventlist[] = { I_OnPreCommand, I_OnRehash };
-               ServerInstance->Modules->Attach(eventlist, this, 2);
+               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
                OnRehash(NULL);
        }
 
        void OnRehash(User* user)
        {
-               ConfigReader MyConf;
-               url = MyConf.ReadValue("security", "maphide", 0);
+               url = ServerInstance->Config->ConfValue("security")->getString("maphide");
        }
 
        ModResult OnPreCommand(std::string &command, std::vector<std::string> &parameters, LocalUser *user, bool validated, const std::string &original_line)