X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_nickflood.cpp;h=04d7c8b5e2cc86d28e812cf578bcc4a64639f282;hb=0c78ad71d32e4062827f2ebac927bdbf43c091ba;hp=7c8452a6cb514874792e6f5d69a66876b4c2251c;hpb=2d7d62dfd2e3422a08aceaac32a96af7a709a544;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_nickflood.cpp b/src/modules/m_nickflood.cpp index 7c8452a6c..04d7c8b5e 100644 --- a/src/modules/m_nickflood.cpp +++ b/src/modules/m_nickflood.cpp @@ -56,7 +56,7 @@ class nickfloodsettings * on successful nick changes; this will be checked before the counter is * incremented. */ - return (counter + 1 >= this->nicks); + return ((ServerInstance->Time() <= reset) && (counter == this->nicks)); } void clear() @@ -139,11 +139,14 @@ class ModuleNickFlood : public Module ModuleNickFlood() : nf(this) { - if (!ServerInstance->Modes->AddMode(&nf)) - throw ModuleException("Could not add new modes!"); - ServerInstance->Extensions.Register(&nf.ext); + } + + void init() + { + ServerInstance->Modules->AddService(nf); + ServerInstance->Modules->AddService(nf.ext); Implementation eventlist[] = { I_OnUserPreNick, I_OnUserPostNick }; - ServerInstance->Modules->Attach(eventlist, this, 2); + ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } ModResult OnUserPreNick(User* user, const std::string &newnick)