]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_connflood.cpp
Wahhhhhhhhhhhh bwahahaha. Mass commit to tidy up tons of messy include lists
[user/henk/code/inspircd.git] / src / modules / m_connflood.cpp
index a7a7d33b625c0997a9f9a11d33e3afeeef6379c8..6a0ee948ab279efdfeebf5f4d41ccced5f10d2d9 100644 (file)
@@ -20,15 +20,12 @@ using namespace std;
 
 #include "users.h"
 #include "modules.h"
-#include "helperfuncs.h"
+
 #include "inspircd.h"
 
 /* $ModDesc: Connection throttle */
 
 int conns = 0, throttled = 0;
-extern time_t TIME;
-
-extern InspIRCd* ServerInstance;
 
 class ModuleConnFlood : public Module
 {
@@ -64,7 +61,7 @@ public:
        void InitConf()
        {
                /* read configuration variables */
-               conf = new ConfigReader;
+               conf = new ConfigReader(ServerInstance);
                /* throttle configuration */
                seconds = conf->ReadInteger("connflood", "seconds", 0, true);
                maxconns = conf->ReadInteger("connflood", "maxconns", 0, true);
@@ -74,12 +71,12 @@ public:
                /* seconds to wait when the server just booted */
                boot_wait = conf->ReadInteger("connflood", "bootwait", 0, true);
 
-               first = TIME;
+               first = ServerInstance->Time();
        }
  
        virtual void OnUserRegister(userrec* user)
        {
-               time_t next = TIME;
+               time_t next = ServerInstance->Time();
                if (!first)
                        first = next - boot_wait;