: re(this)
{
nofollow = false;
+ }
+
+ void init()
+ {
if(!ServerInstance->Modes->AddModeWatcher(&re))
throw ModuleException("Could not add mode watcher");
public:
ModuleCallerID() : cmd(this), myumode(this)
{
- OnRehash(NULL);
+ }
- if (!ServerInstance->Modes->AddMode(&myumode))
- throw ModuleException("Could not add usermode +g");
+ void init()
+ {
+ OnRehash(NULL);
- ServerInstance->AddCommand(&cmd);
- ServerInstance->Extensions.Register(&cmd.extInfo);
+ ServerInstance->Modules->AddService(myumode);
+ ServerInstance->Modules->AddService(cmd);
+ ServerInstance->Modules->AddService(cmd.extInfo);
Implementation eventlist[] = { I_OnRehash, I_OnUserPreNick, I_OnUserQuit, I_On005Numeric, I_OnUserPreNotice, I_OnUserPreMessage };
ServerInstance->Modules->Attach(eventlist, this, 6);
public:
ModuleCloaking() : cu(this), Hash(this, "hash/md5")
+ {
+ }
+
+ void init()
{
OnRehash(NULL);
std::vector<std::string> exemptfromfilter; // List of channel names excluded from filtering.
ModuleFilter();
-
+ void init();
~ModuleFilter();
ModResult OnUserPreMessage(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list);
FilterResult* FilterMatch(User* user, const std::string &text, int flags);
}
ModuleFilter::ModuleFilter() : filtcommand(this), RegexEngine(this, "regex")
+{
+}
+
+void ModuleFilter::init()
{
ServerInstance->AddCommand(&filtcommand);
Implementation eventlist[] = { I_OnPreCommand, I_OnStats, I_OnSyncNetwork, I_OnDecodeMetaData, I_OnUserPreMessage, I_OnUserPreNotice, I_OnRehash };
public:
ModuleHelpop()
: cmd(this), ho(this)
+ {
+ }
+
+ void init()
{
ReadConfig();
- if (!ServerInstance->Modes->AddMode(&ho))
- throw ModuleException("Could not add new modes!");
- ServerInstance->AddCommand(&cmd);
+ ServerInstance->Modules->AddService(ho);
+ ServerInstance->Modules->AddService(cmd);
Implementation eventlist[] = { I_OnRehash, I_OnWhois };
ServerInstance->Modules->Attach(eventlist, this, 2);
}
- virtual void ReadConfig()
+ void ReadConfig()
{
ConfigReader MyConf;
ModuleOjoin()
: np(NULL), mycommand(this)
+ {
+ }
+
+ void init()
{
/* Load config stuff */
OnRehash(NULL);
/* Initialise module variables */
np = new NetworkPrefix(this);
- if (!ServerInstance->Modes->AddMode(np))
- {
- delete np;
- throw ModuleException("Could not add new mode!");
- }
-
- ServerInstance->AddCommand(&mycommand);
+ ServerInstance->Modules->AddService(*np);
+ ServerInstance->Modules->AddService(mycommand);
Implementation eventlist[] = { I_OnUserPreJoin, I_OnUserPreKick, I_OnRehash };
ServerInstance->Modules->Attach(eventlist, this, 3);
public:
ModuleRLine() : rxfactory(this, "regex"), f(rxfactory), r(this, f)
+ {
+ }
+
+ void init()
{
OnRehash(NULL);