]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_connflood.cpp
Convert a bunch of time-related config options to getDuration.
[user/henk/code/inspircd.git] / src / modules / m_connflood.cpp
index 23b570bf6007b85af20998d66b05be65584742b6..1d27e3990d1581f967486cecef6ef068967c164e 100644 (file)
@@ -36,24 +36,19 @@ public:
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               InitConf();
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Connection throttle", VF_VENDOR);
        }
 
-       void InitConf()
+       void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
                /* read configuration variables */
                ConfigTag* tag = ServerInstance->Config->ConfValue("connflood");
                /* throttle configuration */
-               seconds = tag->getInt("seconds");
+               seconds = tag->getDuration("period", tag->getInt("seconds"));
                maxconns = tag->getInt("maxconns");
-               timeout = tag->getInt("timeout");
+               timeout = tag->getDuration("timeout");
                quitmsg = tag->getString("quitmsg");
 
                /* seconds to wait when the server just booted */
@@ -109,12 +104,6 @@ public:
                }
                return MOD_RES_PASSTHRU;
        }
-
-       void OnRehash(User* user) CXX11_OVERRIDE
-       {
-               InitConf();
-       }
-
 };
 
 MODULE_INIT(ModuleConnFlood)