* 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()
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)