X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_nickflood.cpp;h=04d7c8b5e2cc86d28e812cf578bcc4a64639f282;hb=a5d110282a864fd2e91b51ce360a977cd0643657;hp=ec9d9a26140d91f9b12e945f8ac02f76d73095ab;hpb=16fad76febd1e35a5e289a0890df212c1c4e3c81;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_nickflood.cpp b/src/modules/m_nickflood.cpp index ec9d9a261..04d7c8b5e 100644 --- a/src/modules/m_nickflood.cpp +++ b/src/modules/m_nickflood.cpp @@ -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)