X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_nickflood.cpp;h=10ae40cb752c69859246f3e5d5aa6a69d939733a;hb=00fa6d592ed2640fcdf74444786de555c1c3da25;hp=4961e97a0f31e90730bd91c4db535f18008e3f6d;hpb=164998f1e6e2cb885fb4d630ded29ed5191218c8;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_nickflood.cpp b/src/modules/m_nickflood.cpp index 4961e97a0..10ae40cb7 100644 --- a/src/modules/m_nickflood.cpp +++ b/src/modules/m_nickflood.cpp @@ -2,7 +2,7 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2008 InspIRCd Development Team + * InspIRCd: (C) 2002-2009 InspIRCd Development Team * See: http://www.inspircd.org/wiki/index.php/Credits * * This program is free but copyrighted software; see @@ -19,21 +19,19 @@ */ class nickfloodsettings : public classbase { + private: + InspIRCd* ServerInstance; public: - int secs; int nicks; time_t reset; time_t unlocktime; int counter; bool locked; - InspIRCd* ServerInstance; - - nickfloodsettings() : secs(0), nicks(0) {}; - nickfloodsettings(int b, int c) : secs(b), nicks(c) + nickfloodsettings(InspIRCd *Instance, int b, int c) : ServerInstance(Instance), secs(b), nicks(c) { - reset = ServerInstance->Time() + secs; + reset = Instance->Time() + secs; counter = 0; locked = false; }; @@ -144,7 +142,7 @@ class NickFlood : public ModeHandler if (!channel->GetExt("nickflood", dummy)) { parameter = ConvToStr(nnicks) + ":" +ConvToStr(nsecs); - nickfloodsettings *f = new nickfloodsettings(nsecs,nnicks); + nickfloodsettings *f = new nickfloodsettings(ServerInstance, nsecs, nnicks); channel->Extend("nickflood", f); channel->SetMode('F', true); channel->SetModeParam('F', parameter.c_str(), true); @@ -167,7 +165,7 @@ class NickFlood : public ModeHandler nickfloodsettings* f; channel->GetExt("nickflood", f); delete f; - f = new nickfloodsettings(nsecs, nnicks); + f = new nickfloodsettings(ServerInstance, nsecs, nnicks); channel->Shrink("nickflood"); channel->Extend("nickflood", f); channel->SetModeParam('F', cur_param.c_str(), false);