X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_servprotect.cpp;h=099c1142a50ad63845c0a87c72a5a11777658be0;hb=551d687ec6d7ce44be35fae0dd7345fe73c4f63a;hp=797c541ebeace657dea0205c3e6ae12ad119f0b2;hpb=c8b41aa5d256d99eee67ec94492a94dc30e0ea35;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_servprotect.cpp b/src/modules/m_servprotect.cpp index 797c541eb..099c1142a 100644 --- a/src/modules/m_servprotect.cpp +++ b/src/modules/m_servprotect.cpp @@ -51,15 +51,13 @@ class ModuleServProtectMode : public Module ModuleServProtectMode() : bm(this) { - if (!ServerInstance->Modes->AddMode(&bm)) - throw ModuleException("Could not add new modes!"); - Implementation eventlist[] = { I_OnWhois, I_OnKill, I_OnWhoisLine, I_OnRawMode, I_OnUserPreKick }; - ServerInstance->Modules->Attach(eventlist, this, 5); } - - ~ModuleServProtectMode() + void init() { + ServerInstance->Modules->AddService(bm); + Implementation eventlist[] = { I_OnWhois, I_OnKill, I_OnWhoisLine, I_OnRawMode, I_OnUserPreKick }; + ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } Version GetVersion() @@ -67,11 +65,11 @@ class ModuleServProtectMode : public Module return Version("Provides usermode +k to protect services from kicks, kills, and mode changes.", VF_VENDOR); } - void OnWhois(User* src, User* dst) + void OnWhois(User* user, User* dest) { - if (dst->IsModeSet('k')) + if (dest->IsModeSet('k')) { - ServerInstance->SendWhoisLine(src, dst, 310, src->nick+" "+dst->nick+" :is an "+ServerInstance->Config->Network+" Service"); + ServerInstance->SendWhoisLine(user, dest, 310, user->nick+" "+dest->nick+" :is a Network Service on "+ServerInstance->Config->Network); } }