From 24731c63b6320be22f7b3220236271fa7476b975 Mon Sep 17 00:00:00 2001 From: danieldg Date: Wed, 2 Sep 2009 00:48:48 +0000 Subject: Add Module* creator to Command and ModeHandler git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11631 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/command_parse.h | 8 ++++---- include/commands/cmd_admin.h | 2 +- include/commands/cmd_away.h | 2 +- include/commands/cmd_clearcache.h | 2 +- include/commands/cmd_commands.h | 2 +- include/commands/cmd_connect.h | 2 +- include/commands/cmd_die.h | 2 +- include/commands/cmd_eline.h | 2 +- include/commands/cmd_gline.h | 2 +- include/commands/cmd_info.h | 2 +- include/commands/cmd_invite.h | 2 +- include/commands/cmd_ison.h | 2 +- include/commands/cmd_join.h | 2 +- include/commands/cmd_kick.h | 2 +- include/commands/cmd_kill.h | 2 +- include/commands/cmd_kline.h | 2 +- include/commands/cmd_links.h | 2 +- include/commands/cmd_list.h | 2 +- include/commands/cmd_loadmodule.h | 2 +- include/commands/cmd_lusers.h | 2 +- include/commands/cmd_map.h | 2 +- include/commands/cmd_mode.h | 2 +- include/commands/cmd_modules.h | 2 +- include/commands/cmd_motd.h | 2 +- include/commands/cmd_names.h | 2 +- include/commands/cmd_nick.h | 2 +- include/commands/cmd_notice.h | 2 +- include/commands/cmd_oper.h | 2 +- include/commands/cmd_part.h | 2 +- include/commands/cmd_pass.h | 2 +- include/commands/cmd_ping.h | 2 +- include/commands/cmd_pong.h | 2 +- include/commands/cmd_privmsg.h | 2 +- include/commands/cmd_qline.h | 2 +- include/commands/cmd_quit.h | 2 +- include/commands/cmd_rehash.h | 2 +- include/commands/cmd_reloadmodule.h | 2 +- include/commands/cmd_restart.h | 2 +- include/commands/cmd_rules.h | 2 +- include/commands/cmd_server.h | 2 +- include/commands/cmd_squit.h | 2 +- include/commands/cmd_stats.h | 2 +- include/commands/cmd_time.h | 2 +- include/commands/cmd_topic.h | 2 +- include/commands/cmd_trace.h | 2 +- include/commands/cmd_unloadmodule.h | 2 +- include/commands/cmd_user.h | 2 +- include/commands/cmd_userhost.h | 2 +- include/commands/cmd_version.h | 2 +- include/commands/cmd_wallops.h | 2 +- include/commands/cmd_who.h | 2 +- include/commands/cmd_whois.h | 2 +- include/commands/cmd_zline.h | 2 +- include/ctables.h | 25 +++++++++++-------------- include/mode.h | 20 ++++++++++++++------ include/u_listmode.h | 6 +++--- src/command_parse.cpp | 8 ++++---- src/commands/cmd_commands.cpp | 3 ++- src/commands/cmd_whowas.cpp | 2 +- src/mode.cpp | 20 ++------------------ src/modes/cmode_b.cpp | 2 +- src/modes/cmode_h.cpp | 2 +- src/modes/cmode_i.cpp | 2 +- src/modes/cmode_k.cpp | 2 +- src/modes/cmode_l.cpp | 2 +- src/modes/cmode_m.cpp | 2 +- src/modes/cmode_n.cpp | 2 +- src/modes/cmode_o.cpp | 2 +- src/modes/cmode_p.cpp | 2 +- src/modes/cmode_s.cpp | 2 +- src/modes/cmode_t.cpp | 2 +- src/modes/cmode_v.cpp | 2 +- src/modes/umode_i.cpp | 2 +- src/modes/umode_o.cpp | 2 +- src/modes/umode_s.cpp | 2 +- src/modes/umode_w.cpp | 2 +- src/modules.cpp | 2 +- src/modules/extra/m_ssl_gnutls.cpp | 8 +++----- src/modules/m_allowinvite.cpp | 4 ++-- src/modules/m_alltime.cpp | 5 ++--- src/modules/m_auditorium.cpp | 4 ++-- src/modules/m_banexception.cpp | 4 ++-- src/modules/m_banredirect.cpp | 3 +-- src/modules/m_blockcaps.cpp | 4 ++-- src/modules/m_blockcolor.cpp | 4 ++-- src/modules/m_botmode.cpp | 4 ++-- src/modules/m_callerid.cpp | 13 +++++-------- src/modules/m_cap.cpp | 16 +++++++--------- src/modules/m_cban.cpp | 5 ++--- src/modules/m_censor.cpp | 6 +++--- src/modules/m_cgiirc.cpp | 6 +++--- src/modules/m_chanfilter.cpp | 4 ++-- src/modules/m_chanprotect.cpp | 12 ++++++------ src/modules/m_check.cpp | 8 +++----- src/modules/m_chghost.cpp | 5 ++--- src/modules/m_chgident.cpp | 5 ++--- src/modules/m_chgname.cpp | 5 ++--- src/modules/m_cloaking.cpp | 26 +++++++++++++------------- src/modules/m_clones.cpp | 5 ++--- src/modules/m_close.cpp | 5 ++--- src/modules/m_commonchans.cpp | 4 ++-- src/modules/m_customtitle.cpp | 5 ++--- src/modules/m_cycle.cpp | 5 ++--- src/modules/m_dccallow.cpp | 5 ++--- src/modules/m_deaf.cpp | 4 ++-- src/modules/m_delayjoin.cpp | 5 ++--- src/modules/m_delaymsg.cpp | 3 +-- src/modules/m_devoice.cpp | 5 ++--- src/modules/m_filter.cpp | 4 ++-- src/modules/m_globalload.cpp | 11 ++++------- src/modules/m_globops.cpp | 5 ++--- src/modules/m_helpop.cpp | 7 +++---- src/modules/m_hidechans.cpp | 4 ++-- src/modules/m_hideoper.cpp | 4 ++-- src/modules/m_invisible.cpp | 4 ++-- src/modules/m_inviteexception.cpp | 4 ++-- src/modules/m_joinflood.cpp | 4 ++-- src/modules/m_jumpserver.cpp | 5 ++--- src/modules/m_kicknorejoin.cpp | 4 ++-- src/modules/m_knock.cpp | 7 +++---- src/modules/m_lockserv.cpp | 14 +++++--------- src/modules/m_messageflood.cpp | 4 ++-- src/modules/m_nickflood.cpp | 4 ++-- src/modules/m_nicklock.cpp | 12 +++++------- src/modules/m_noctcp.cpp | 4 ++-- src/modules/m_nokicks.cpp | 4 ++-- src/modules/m_nonicks.cpp | 4 ++-- src/modules/m_nonotice.cpp | 4 ++-- src/modules/m_operchans.cpp | 4 ++-- src/modules/m_opermotd.cpp | 5 ++--- src/modules/m_operprefix.cpp | 4 ++-- src/modules/m_password_hash.cpp | 10 ++++------ src/modules/m_permchannels.cpp | 4 ++-- src/modules/m_randquote.cpp | 5 ++--- src/modules/m_redirect.cpp | 4 ++-- src/modules/m_remove.cpp | 10 +++++----- src/modules/m_rline.cpp | 5 ++--- src/modules/m_sajoin.cpp | 5 ++--- src/modules/m_sakick.cpp | 5 ++--- src/modules/m_samode.cpp | 5 ++--- src/modules/m_sanick.cpp | 5 ++--- src/modules/m_sapart.cpp | 5 ++--- src/modules/m_saquit.cpp | 5 ++--- src/modules/m_sasl.cpp | 13 ++++--------- src/modules/m_satopic.cpp | 7 +++---- src/modules/m_services_account.cpp | 12 ++++++------ src/modules/m_servprotect.cpp | 4 ++-- src/modules/m_sethost.cpp | 5 ++--- src/modules/m_setident.cpp | 5 ++--- src/modules/m_setidle.cpp | 5 ++--- src/modules/m_setname.cpp | 5 ++--- src/modules/m_showwhois.cpp | 9 ++++----- src/modules/m_shun.cpp | 5 ++--- src/modules/m_silence.cpp | 8 +++----- src/modules/m_spanningtree/postcommand.cpp | 4 ++-- src/modules/m_spanningtree/rconnect.cpp | 6 +++--- src/modules/m_spanningtree/rconnect.h | 1 - src/modules/m_spanningtree/rsquit.cpp | 4 ++-- src/modules/m_spanningtree/rsquit.h | 1 - src/modules/m_sslinfo.cpp | 5 ++--- src/modules/m_sslmodes.cpp | 4 ++-- src/modules/m_stripcolor.cpp | 6 +++--- src/modules/m_svshold.cpp | 5 ++--- src/modules/m_swhois.cpp | 5 ++--- src/modules/m_taxonomy.cpp | 6 ++---- src/modules/m_timedbans.cpp | 5 ++--- src/modules/m_tline.cpp | 5 ++--- src/modules/m_uninvite.cpp | 5 ++--- src/modules/m_userip.cpp | 5 ++--- src/modules/m_vhost.cpp | 5 ++--- src/modules/m_watch.cpp | 8 +++----- 171 files changed, 347 insertions(+), 432 deletions(-) diff --git a/include/command_parse.h b/include/command_parse.h index 2cf403de1..f176394a7 100644 --- a/include/command_parse.h +++ b/include/command_parse.h @@ -68,7 +68,7 @@ class CoreExport CommandParser : public classbase /** Removes a command if the sources match. Used as a helper for * safe hash_map delete while iter in RemoveCommands(const char* source). */ - void RemoveCommand(nspace::hash_map::iterator safei, const char* source); + void RemoveCommand(nspace::hash_map::iterator safei, Module* source); public: @@ -178,9 +178,9 @@ class CoreExport CommandParser : public classbase void DoLines(User* current, bool one_only = false); /** Remove all commands relating to module 'source'. - * @param source A module name which has introduced new commands + * @param source A module which has introduced new commands */ - void RemoveCommands(const char* source); + void RemoveCommands(Module* source); /** Remove all core commands and unload their shared objects */ @@ -226,7 +226,7 @@ class CommandReload : public Command public: /** Standard constructor */ - CommandReload (InspIRCd* Instance) : Command(Instance,"RELOAD","o",1) { syntax = ""; } + CommandReload (InspIRCd* Instance) : Command(Instance,NULL,"RELOAD","o",1) { syntax = ""; } /** Handle RELOAD */ CmdResult Handle(const std::vector& parameters, User *user); diff --git a/include/commands/cmd_admin.h b/include/commands/cmd_admin.h index 25a77e845..b82331c39 100644 --- a/include/commands/cmd_admin.h +++ b/include/commands/cmd_admin.h @@ -27,7 +27,7 @@ class CommandAdmin : public Command public: /** Constructor for admin. */ - CommandAdmin (InspIRCd* Instance) : Command(Instance,"ADMIN",0,0) { syntax = "[]"; } + CommandAdmin (InspIRCd* Instance) : Command(Instance,NULL,"ADMIN",0,0) { syntax = "[]"; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_away.h b/include/commands/cmd_away.h index f6d1bc783..9cde32f57 100644 --- a/include/commands/cmd_away.h +++ b/include/commands/cmd_away.h @@ -29,7 +29,7 @@ class CommandAway : public Command public: /** Constructor for away. */ - CommandAway (InspIRCd* Instance) : Command(Instance,"AWAY",0,0) { syntax = "[]"; } + CommandAway (InspIRCd* Instance) : Command(Instance,NULL,"AWAY",0,0) { syntax = "[]"; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_clearcache.h b/include/commands/cmd_clearcache.h index 559c8cd45..00e41fce9 100644 --- a/include/commands/cmd_clearcache.h +++ b/include/commands/cmd_clearcache.h @@ -28,7 +28,7 @@ class CommandClearcache : public Command public: /** Constructor for clearcache. */ - CommandClearcache (InspIRCd* Instance) : Command(Instance,"CLEARCACHE","o",0) { } + CommandClearcache (InspIRCd* Instance) : Command(Instance,NULL,"CLEARCACHE","o",0) { } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_commands.h b/include/commands/cmd_commands.h index dbc7a162c..13c5ee075 100644 --- a/include/commands/cmd_commands.h +++ b/include/commands/cmd_commands.h @@ -29,7 +29,7 @@ class CommandCommands : public Command public: /** Constructor for commands. */ - CommandCommands (InspIRCd* Instance) : Command(Instance,"COMMANDS",0,0) { } + CommandCommands (InspIRCd* Instance) : Command(Instance,NULL,"COMMANDS",0,0) { } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_connect.h b/include/commands/cmd_connect.h index d7543a215..208844661 100644 --- a/include/commands/cmd_connect.h +++ b/include/commands/cmd_connect.h @@ -29,7 +29,7 @@ class CommandConnect : public Command public: /** Constructor for connect. */ - CommandConnect (InspIRCd* Instance) : Command(Instance,"CONNECT","o",1,false,0) { syntax = " []"; } + CommandConnect (InspIRCd* Instance) : Command(Instance,NULL,"CONNECT","o",1,false,0) { syntax = " []"; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_die.h b/include/commands/cmd_die.h index 42cb1860d..156a1508e 100644 --- a/include/commands/cmd_die.h +++ b/include/commands/cmd_die.h @@ -29,7 +29,7 @@ class CommandDie : public Command public: /** Constructor for die. */ - CommandDie (InspIRCd* Instance) : Command(Instance,"DIE","o",1,false,0) { syntax = ""; } + CommandDie (InspIRCd* Instance) : Command(Instance,NULL,"DIE","o",1,false,0) { syntax = ""; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_eline.h b/include/commands/cmd_eline.h index 7af325515..2ac9adeab 100644 --- a/include/commands/cmd_eline.h +++ b/include/commands/cmd_eline.h @@ -29,7 +29,7 @@ class CommandEline : public Command public: /** Constructor for eline. */ - CommandEline (InspIRCd* Instance) : Command(Instance,"ELINE","o",1,3,false,0) { syntax = " [ :]"; } + CommandEline (InspIRCd* Instance) : Command(Instance,NULL,"ELINE","o",1,3,false,0) { syntax = " [ :]"; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_gline.h b/include/commands/cmd_gline.h index 2a41d0f73..9548279d4 100644 --- a/include/commands/cmd_gline.h +++ b/include/commands/cmd_gline.h @@ -29,7 +29,7 @@ class CommandGline : public Command public: /** Constructor for gline. */ - CommandGline (InspIRCd* Instance) : Command(Instance,"GLINE","o",1,3,false,0) { syntax = " [ :]"; } + CommandGline (InspIRCd* Instance) : Command(Instance,NULL,"GLINE","o",1,3,false,0) { syntax = " [ :]"; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_info.h b/include/commands/cmd_info.h index 4c2cd1b50..85d7d4c84 100644 --- a/include/commands/cmd_info.h +++ b/include/commands/cmd_info.h @@ -29,7 +29,7 @@ class CommandInfo : public Command public: /** Constructor for info. */ - CommandInfo (InspIRCd* Instance) : Command(Instance,"INFO",0,0) { syntax = "[]"; } + CommandInfo (InspIRCd* Instance) : Command(Instance,NULL,"INFO",0,0) { syntax = "[]"; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_invite.h b/include/commands/cmd_invite.h index 4f36e1a57..ce048e712 100644 --- a/include/commands/cmd_invite.h +++ b/include/commands/cmd_invite.h @@ -29,7 +29,7 @@ class CommandInvite : public Command public: /** Constructor for invite. */ - CommandInvite (InspIRCd* Instance) : Command(Instance,"INVITE", 0, 0, false, 4) { syntax = "[ ]"; } + CommandInvite (InspIRCd* Instance) : Command(Instance,NULL,"INVITE", 0, 0, false, 4) { syntax = "[ ]"; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_ison.h b/include/commands/cmd_ison.h index 46810665e..93f3356d8 100644 --- a/include/commands/cmd_ison.h +++ b/include/commands/cmd_ison.h @@ -29,7 +29,7 @@ class CommandIson : public Command public: /** Constructor for ison. */ - CommandIson (InspIRCd* Instance) : Command(Instance,"ISON",0,0) { syntax = " {nick}"; } + CommandIson (InspIRCd* Instance) : Command(Instance,NULL,"ISON",0,0) { syntax = " {nick}"; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_join.h b/include/commands/cmd_join.h index 21caa04c1..2ea32de1a 100644 --- a/include/commands/cmd_join.h +++ b/include/commands/cmd_join.h @@ -29,7 +29,7 @@ class CommandJoin : public Command public: /** Constructor for join. */ - CommandJoin (InspIRCd* Instance) : Command(Instance,"JOIN", 0, 1, false, 2) { syntax = "{,} {{,}}"; } + CommandJoin (InspIRCd* Instance) : Command(Instance,NULL,"JOIN", 0, 1, false, 2) { syntax = "{,} {{,}}"; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_kick.h b/include/commands/cmd_kick.h index 716f1e221..be6a40b06 100644 --- a/include/commands/cmd_kick.h +++ b/include/commands/cmd_kick.h @@ -29,7 +29,7 @@ class CommandKick : public Command public: /** Constructor for kick. */ - CommandKick (InspIRCd* Instance) : Command(Instance,"KICK",0,2) { syntax = " {,} []"; } + CommandKick (InspIRCd* Instance) : Command(Instance,NULL,"KICK",0,2) { syntax = " {,} []"; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_kill.h b/include/commands/cmd_kill.h index ab677fc8e..392975fab 100644 --- a/include/commands/cmd_kill.h +++ b/include/commands/cmd_kill.h @@ -29,7 +29,7 @@ class CommandKill : public Command public: /** Constructor for kill. */ - CommandKill (InspIRCd* Instance) : Command(Instance,"KILL","o",2,false,0) { syntax = " "; } + CommandKill (InspIRCd* Instance) : Command(Instance,NULL,"KILL","o",2,false,0) { syntax = " "; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_kline.h b/include/commands/cmd_kline.h index fca83aa46..5744de506 100644 --- a/include/commands/cmd_kline.h +++ b/include/commands/cmd_kline.h @@ -29,7 +29,7 @@ class CommandKline : public Command public: /** Constructor for kline. */ - CommandKline (InspIRCd* Instance) : Command(Instance,"KLINE","o",1,3,false,0) { syntax = " [ :]"; } + CommandKline (InspIRCd* Instance) : Command(Instance,NULL,"KLINE","o",1,3,false,0) { syntax = " [ :]"; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_links.h b/include/commands/cmd_links.h index e71d17834..fbfdb6201 100644 --- a/include/commands/cmd_links.h +++ b/include/commands/cmd_links.h @@ -29,7 +29,7 @@ class CommandLinks : public Command public: /** Constructor for links. */ - CommandLinks (InspIRCd* Instance) : Command(Instance,"LINKS",0,0) { } + CommandLinks (InspIRCd* Instance) : Command(Instance,NULL,"LINKS",0,0) { } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_list.h b/include/commands/cmd_list.h index 18cc6d299..8801b8c39 100644 --- a/include/commands/cmd_list.h +++ b/include/commands/cmd_list.h @@ -29,7 +29,7 @@ class CommandList : public Command public: /** Constructor for list. */ - CommandList (InspIRCd* Instance) : Command(Instance,"LIST", 0, 0, false, 5) { } + CommandList (InspIRCd* Instance) : Command(Instance,NULL,"LIST", 0, 0, false, 5) { } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_loadmodule.h b/include/commands/cmd_loadmodule.h index b48c11dfb..9d31f072b 100644 --- a/include/commands/cmd_loadmodule.h +++ b/include/commands/cmd_loadmodule.h @@ -29,7 +29,7 @@ class CommandLoadmodule : public Command public: /** Constructor for loadmodule. */ - CommandLoadmodule (InspIRCd* Instance) : Command(Instance,"LOADMODULE","o",1) { syntax = ""; } + CommandLoadmodule (InspIRCd* Instance) : Command(Instance,NULL,"LOADMODULE","o",1) { syntax = ""; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_lusers.h b/include/commands/cmd_lusers.h index eab09b1a5..2c5d3d454 100644 --- a/include/commands/cmd_lusers.h +++ b/include/commands/cmd_lusers.h @@ -29,7 +29,7 @@ class CommandLusers : public Command public: /** Constructor for lusers. */ - CommandLusers (InspIRCd* Instance) : Command(Instance,"LUSERS",0,0) { } + CommandLusers (InspIRCd* Instance) : Command(Instance,NULL,"LUSERS",0,0) { } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_map.h b/include/commands/cmd_map.h index b825bf18a..183d59751 100644 --- a/include/commands/cmd_map.h +++ b/include/commands/cmd_map.h @@ -29,7 +29,7 @@ class CommandMap : public Command public: /** Constructor for map. */ - CommandMap (InspIRCd* Instance) : Command(Instance,"MAP",0,0,false,2) { } + CommandMap (InspIRCd* Instance) : Command(Instance,NULL,"MAP",0,0,false,2) { } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_mode.h b/include/commands/cmd_mode.h index 3c6eda5f5..83ab00bba 100644 --- a/include/commands/cmd_mode.h +++ b/include/commands/cmd_mode.h @@ -28,7 +28,7 @@ class CommandMode : public Command public: /** Constructor for mode. */ - CommandMode (InspIRCd* Instance) : Command(Instance,"MODE",0,1) { syntax = " {}"; } + CommandMode (InspIRCd* Instance) : Command(Instance,NULL,"MODE",0,1) { syntax = " {}"; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_modules.h b/include/commands/cmd_modules.h index eb79f705f..18dc76cac 100644 --- a/include/commands/cmd_modules.h +++ b/include/commands/cmd_modules.h @@ -29,7 +29,7 @@ class CommandModules : public Command public: /** Constructor for modules. */ - CommandModules (InspIRCd* Instance) : Command(Instance,"MODULES",0,0) { syntax = "[debug]"; } + CommandModules (InspIRCd* Instance) : Command(Instance,NULL,"MODULES",0,0) { syntax = "[debug]"; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_motd.h b/include/commands/cmd_motd.h index 4ecebc12f..b57d851d9 100644 --- a/include/commands/cmd_motd.h +++ b/include/commands/cmd_motd.h @@ -32,7 +32,7 @@ class CommandMotd : public Command public: /** Constructor for motd. */ - CommandMotd (InspIRCd* Instance) : Command(Instance,"MOTD",0,0) { syntax = "[]"; } + CommandMotd (InspIRCd* Instance) : Command(Instance,NULL,"MOTD",0,0) { syntax = "[]"; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_names.h b/include/commands/cmd_names.h index bf31dd5bb..174b6aa20 100644 --- a/include/commands/cmd_names.h +++ b/include/commands/cmd_names.h @@ -29,7 +29,7 @@ class CommandNames : public Command public: /** Constructor for names. */ - CommandNames (InspIRCd* Instance) : Command(Instance,"NAMES",0,0) { syntax = "{{,}}"; } + CommandNames (InspIRCd* Instance) : Command(Instance,NULL,"NAMES",0,0) { syntax = "{{,}}"; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_nick.h b/include/commands/cmd_nick.h index 566e94754..b3a8e12a8 100644 --- a/include/commands/cmd_nick.h +++ b/include/commands/cmd_nick.h @@ -30,7 +30,7 @@ class CommandNick : public Command public: /** Constructor for nick. */ - CommandNick (InspIRCd* Instance) : Command(Instance,"NICK", 0, 1, true, 3), allowinvalid(false) { syntax = ""; } + CommandNick (InspIRCd* Instance) : Command(Instance,NULL,"NICK", 0, 1, true, 3), allowinvalid(false) { syntax = ""; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_notice.h b/include/commands/cmd_notice.h index d83ca2121..580376f08 100644 --- a/include/commands/cmd_notice.h +++ b/include/commands/cmd_notice.h @@ -29,7 +29,7 @@ class CommandNotice : public Command public: /** Constructor for notice. */ - CommandNotice (InspIRCd* Instance) : Command(Instance,"NOTICE",0,2) { syntax = "{,} "; } + CommandNotice (InspIRCd* Instance) : Command(Instance,NULL,"NOTICE",0,2) { syntax = "{,} "; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_oper.h b/include/commands/cmd_oper.h index 90bfee162..dd0b6318d 100644 --- a/include/commands/cmd_oper.h +++ b/include/commands/cmd_oper.h @@ -31,7 +31,7 @@ class CommandOper : public Command public: /** Constructor for oper. */ - CommandOper (InspIRCd* Instance) : Command(Instance,"OPER",0,2,false,2) { syntax = " "; } + CommandOper (InspIRCd* Instance) : Command(Instance,NULL,"OPER",0,2,false,2) { syntax = " "; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_part.h b/include/commands/cmd_part.h index dfee41d9d..01284ccbd 100644 --- a/include/commands/cmd_part.h +++ b/include/commands/cmd_part.h @@ -29,7 +29,7 @@ class CommandPart : public Command public: /** Constructor for part. */ - CommandPart (InspIRCd* Instance) : Command(Instance,"PART", 0, 1, false, 5) { syntax = "{,} []"; } + CommandPart (InspIRCd* Instance) : Command(Instance,NULL,"PART", 0, 1, false, 5) { syntax = "{,} []"; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_pass.h b/include/commands/cmd_pass.h index 0f24ff293..21eb378ab 100644 --- a/include/commands/cmd_pass.h +++ b/include/commands/cmd_pass.h @@ -32,7 +32,7 @@ class CommandPass : public Command public: /** Constructor for pass. */ - CommandPass (InspIRCd* Instance) : Command(Instance,"PASS",0,1,true,0) { syntax = ""; } + CommandPass (InspIRCd* Instance) : Command(Instance,NULL,"PASS",0,1,true,0) { syntax = ""; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_ping.h b/include/commands/cmd_ping.h index 5030aa775..56570d24e 100644 --- a/include/commands/cmd_ping.h +++ b/include/commands/cmd_ping.h @@ -29,7 +29,7 @@ class CommandPing : public Command public: /** Constructor for ping. */ - CommandPing (InspIRCd* Instance) : Command(Instance,"PING", 0, 1, false, 0) { syntax = " [:]"; } + CommandPing (InspIRCd* Instance) : Command(Instance,NULL,"PING", 0, 1, false, 0) { syntax = " [:]"; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_pong.h b/include/commands/cmd_pong.h index bcf4fe807..58d862a73 100644 --- a/include/commands/cmd_pong.h +++ b/include/commands/cmd_pong.h @@ -30,7 +30,7 @@ class CommandPong : public Command public: /** Constructor for pong. */ - CommandPong (InspIRCd* Instance) : Command(Instance,"PONG", 0, 1, false, 0) { syntax = ""; } + CommandPong (InspIRCd* Instance) : Command(Instance,NULL,"PONG", 0, 1, false, 0) { syntax = ""; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_privmsg.h b/include/commands/cmd_privmsg.h index 4fcc8284c..74990983c 100644 --- a/include/commands/cmd_privmsg.h +++ b/include/commands/cmd_privmsg.h @@ -29,7 +29,7 @@ class CommandPrivmsg : public Command public: /** Constructor for privmsg. */ - CommandPrivmsg (InspIRCd* Instance) : Command(Instance,"PRIVMSG",0,2) { syntax = "{,} "; } + CommandPrivmsg (InspIRCd* Instance) : Command(Instance,NULL,"PRIVMSG",0,2) { syntax = "{,} "; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_qline.h b/include/commands/cmd_qline.h index f36535cb1..352ebddda 100644 --- a/include/commands/cmd_qline.h +++ b/include/commands/cmd_qline.h @@ -29,7 +29,7 @@ class CommandQline : public Command public: /** Constructor for qline. */ - CommandQline (InspIRCd* Instance) : Command(Instance,"QLINE","o",1,3,false,0) { syntax = " [ :]"; } + CommandQline (InspIRCd* Instance) : Command(Instance,NULL,"QLINE","o",1,3,false,0) { syntax = " [ :]"; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_quit.h b/include/commands/cmd_quit.h index 62a3a59e3..f1430e46b 100644 --- a/include/commands/cmd_quit.h +++ b/include/commands/cmd_quit.h @@ -29,7 +29,7 @@ class CommandQuit : public Command public: /** Constructor for quit. */ - CommandQuit (InspIRCd* Instance) : Command(Instance,"QUIT",0,0,true) { syntax = "[]"; } + CommandQuit (InspIRCd* Instance) : Command(Instance,NULL,"QUIT",0,0,true) { syntax = "[]"; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_rehash.h b/include/commands/cmd_rehash.h index 6b35c2ae5..6c294ffb0 100644 --- a/include/commands/cmd_rehash.h +++ b/include/commands/cmd_rehash.h @@ -29,7 +29,7 @@ class CommandRehash : public Command public: /** Constructor for rehash. */ - CommandRehash (InspIRCd* Instance) : Command(Instance,"REHASH","o",0,false,3) { syntax = "[]"; } + CommandRehash (InspIRCd* Instance) : Command(Instance,NULL,"REHASH","o",0,false,3) { syntax = "[]"; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_reloadmodule.h b/include/commands/cmd_reloadmodule.h index f76106ebf..d75ec568f 100644 --- a/include/commands/cmd_reloadmodule.h +++ b/include/commands/cmd_reloadmodule.h @@ -29,7 +29,7 @@ class CommandReloadmodule : public Command public: /** Constructor for reloadmodule. */ - CommandReloadmodule (InspIRCd* Instance) : Command(Instance,"RELOADMODULE","o",1) { syntax = ""; } + CommandReloadmodule (InspIRCd* Instance) : Command(Instance,NULL,"RELOADMODULE","o",1) { syntax = ""; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_restart.h b/include/commands/cmd_restart.h index ab7986ab7..cd55ed15d 100644 --- a/include/commands/cmd_restart.h +++ b/include/commands/cmd_restart.h @@ -32,7 +32,7 @@ class CommandRestart : public Command public: /** Constructor for restart. */ - CommandRestart (InspIRCd* Instance) : Command(Instance,"RESTART","o",1,false,0) { syntax = ""; } + CommandRestart (InspIRCd* Instance) : Command(Instance,NULL,"RESTART","o",1,false,0) { syntax = ""; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_rules.h b/include/commands/cmd_rules.h index 533ee2a37..f0d6a395f 100644 --- a/include/commands/cmd_rules.h +++ b/include/commands/cmd_rules.h @@ -32,7 +32,7 @@ class CommandRules : public Command public: /** Constructor for rules. */ - CommandRules (InspIRCd* Instance) : Command(Instance,"RULES",0,0) { syntax = "[]"; } + CommandRules (InspIRCd* Instance) : Command(Instance,NULL,"RULES",0,0) { syntax = "[]"; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_server.h b/include/commands/cmd_server.h index 5f69adcff..f3469552d 100644 --- a/include/commands/cmd_server.h +++ b/include/commands/cmd_server.h @@ -29,7 +29,7 @@ class CommandServer : public Command public: /** Constructor for server. */ - CommandServer (InspIRCd* Instance) : Command(Instance,"SERVER",0,0,true) { } + CommandServer (InspIRCd* Instance) : Command(Instance,NULL,"SERVER",0,0,true) { } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_squit.h b/include/commands/cmd_squit.h index b9b9c0188..6090831be 100644 --- a/include/commands/cmd_squit.h +++ b/include/commands/cmd_squit.h @@ -32,7 +32,7 @@ class CommandSquit : public Command public: /** Constructor for squit. */ - CommandSquit (InspIRCd* Instance) : Command(Instance,"SQUIT","o",1) { syntax = " []"; } + CommandSquit (InspIRCd* Instance) : Command(Instance,NULL,"SQUIT","o",1) { syntax = " []"; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_stats.h b/include/commands/cmd_stats.h index 70791670f..8df7def88 100644 --- a/include/commands/cmd_stats.h +++ b/include/commands/cmd_stats.h @@ -32,7 +32,7 @@ class CommandStats : public Command public: /** Constructor for stats. */ - CommandStats (InspIRCd* Instance) : Command(Instance,"STATS",0,1) { syntax = " []"; } + CommandStats (InspIRCd* Instance) : Command(Instance,NULL,"STATS",0,1) { syntax = " []"; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_time.h b/include/commands/cmd_time.h index 78cd8f1af..688618901 100644 --- a/include/commands/cmd_time.h +++ b/include/commands/cmd_time.h @@ -29,7 +29,7 @@ class CommandTime : public Command public: /** Constructor for time. */ - CommandTime (InspIRCd* Instance) : Command(Instance,"TIME",0,0) { syntax = "[]"; } + CommandTime (InspIRCd* Instance) : Command(Instance,NULL,"TIME",0,0) { syntax = "[]"; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_topic.h b/include/commands/cmd_topic.h index e03ea28ee..dc5ce1c77 100644 --- a/include/commands/cmd_topic.h +++ b/include/commands/cmd_topic.h @@ -29,7 +29,7 @@ class CommandTopic : public Command public: /** Constructor for topic. */ - CommandTopic (InspIRCd* Instance) : Command(Instance,"TOPIC",0,1,false,2) { syntax = " []"; } + CommandTopic (InspIRCd* Instance) : Command(Instance,NULL,"TOPIC",0,1,false,2) { syntax = " []"; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_trace.h b/include/commands/cmd_trace.h index 110bc7176..871d150fd 100644 --- a/include/commands/cmd_trace.h +++ b/include/commands/cmd_trace.h @@ -29,7 +29,7 @@ class CommandTrace : public Command public: /** Constructor for trace. */ - CommandTrace (InspIRCd* Instance) : Command(Instance,"TRACE","o",0) { syntax = "[]"; } + CommandTrace (InspIRCd* Instance) : Command(Instance,NULL,"TRACE","o",0) { syntax = "[]"; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_unloadmodule.h b/include/commands/cmd_unloadmodule.h index e7e8523e2..dd60bfd79 100644 --- a/include/commands/cmd_unloadmodule.h +++ b/include/commands/cmd_unloadmodule.h @@ -29,7 +29,7 @@ class CommandUnloadmodule : public Command public: /** Constructor for unloadmodule. */ - CommandUnloadmodule (InspIRCd* Instance) : Command(Instance,"UNLOADMODULE","o",1) { syntax = ""; } + CommandUnloadmodule (InspIRCd* Instance) : Command(Instance,NULL,"UNLOADMODULE","o",1) { syntax = ""; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_user.h b/include/commands/cmd_user.h index 346730878..9bc28b912 100644 --- a/include/commands/cmd_user.h +++ b/include/commands/cmd_user.h @@ -29,7 +29,7 @@ class CommandUser : public Command public: /** Constructor for user. */ - CommandUser (InspIRCd* Instance) : Command(Instance,"USER",0,4,true,0) { syntax = " "; } + CommandUser (InspIRCd* Instance) : Command(Instance,NULL,"USER",0,4,true,0) { syntax = " "; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_userhost.h b/include/commands/cmd_userhost.h index 65d1cc334..1ba15f5a8 100644 --- a/include/commands/cmd_userhost.h +++ b/include/commands/cmd_userhost.h @@ -29,7 +29,7 @@ class CommandUserhost : public Command public: /** Constructor for userhost. */ - CommandUserhost (InspIRCd* Instance) : Command(Instance,"USERHOST",0,1) { syntax = "{,}"; } + CommandUserhost (InspIRCd* Instance) : Command(Instance,NULL,"USERHOST",0,1) { syntax = "{,}"; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_version.h b/include/commands/cmd_version.h index 559d7841b..f093591a4 100644 --- a/include/commands/cmd_version.h +++ b/include/commands/cmd_version.h @@ -29,7 +29,7 @@ class CommandVersion : public Command public: /** Constructor for version. */ - CommandVersion (InspIRCd* Instance) : Command(Instance,"VERSION",0,0) { syntax = "[]"; } + CommandVersion (InspIRCd* Instance) : Command(Instance,NULL,"VERSION",0,0) { syntax = "[]"; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_wallops.h b/include/commands/cmd_wallops.h index b3b42fc02..34089cdae 100644 --- a/include/commands/cmd_wallops.h +++ b/include/commands/cmd_wallops.h @@ -29,7 +29,7 @@ class CommandWallops : public Command public: /** Constructor for wallops. */ - CommandWallops (InspIRCd* Instance) : Command(Instance,"WALLOPS","o",1,1) { syntax = ""; } + CommandWallops (InspIRCd* Instance) : Command(Instance,NULL,"WALLOPS","o",1,1) { syntax = ""; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_who.h b/include/commands/cmd_who.h index a6afd425f..65adc549c 100644 --- a/include/commands/cmd_who.h +++ b/include/commands/cmd_who.h @@ -43,7 +43,7 @@ class CommandWho : public Command public: /** Constructor for who. */ - CommandWho (InspIRCd* Instance) : Command(Instance,"WHO", 0, 1, false, 2) { syntax = "|||||0 [ohurmMiaplf]"; } + CommandWho (InspIRCd* Instance) : Command(Instance,NULL,"WHO", 0, 1, false, 2) { syntax = "|||||0 [ohurmMiaplf]"; } void SendWhoLine(User* user, const std::string &initial, Channel* ch, User* u, std::vector &whoresults); /** Handle command. * @param parameters The parameters to the comamnd diff --git a/include/commands/cmd_whois.h b/include/commands/cmd_whois.h index bf6658b7a..494095e07 100644 --- a/include/commands/cmd_whois.h +++ b/include/commands/cmd_whois.h @@ -32,7 +32,7 @@ class CommandWhois : public Command public: /** Constructor for whois. */ - CommandWhois (InspIRCd* Instance) : Command(Instance,"WHOIS",0,1,false,2) { syntax = "{,}"; } + CommandWhois (InspIRCd* Instance) : Command(Instance,NULL,"WHOIS",0,1,false,2) { syntax = "{,}"; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/commands/cmd_zline.h b/include/commands/cmd_zline.h index fdca7c9dc..fa45ef154 100644 --- a/include/commands/cmd_zline.h +++ b/include/commands/cmd_zline.h @@ -29,7 +29,7 @@ class CommandZline : public Command public: /** Constructor for zline. */ - CommandZline (InspIRCd* Instance) : Command(Instance,"ZLINE","o",1,3,false,0) { syntax = " [ :]"; } + CommandZline (InspIRCd* Instance) : Command(Instance,NULL,"ZLINE","o",1,3,false,0) { syntax = " [ :]"; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/include/ctables.h b/include/ctables.h index a543b7e37..315b38f43 100644 --- a/include/ctables.h +++ b/include/ctables.h @@ -79,7 +79,10 @@ class CoreExport Command : public Extensible public: /** Command name */ - std::string command; + std::string command; + + /** Creator module, NULL for core commands */ + Module* creator; /** User flags needed to execute the command or 0 */ @@ -100,12 +103,8 @@ class CoreExport Command : public Extensible long double use_count; /** used by /stats m - */ - long double total_bytes; - - /** used for resource tracking between modules */ - std::string source; + long double total_bytes; /** True if the command is disabled to non-opers */ @@ -140,22 +139,20 @@ class CoreExport Command : public Extensible * be allowed before the user is 'registered' (has sent USER, * NICK, optionally PASS, and been resolved). */ - Command(InspIRCd* Instance, const std::string &cmd, const char *flags, int minpara, bool before_reg = false, int penalty = 1) : ServerInstance(Instance), command(cmd), flags_needed(flags ? *flags : 0), min_params(minpara), max_params(0), disabled(false), works_before_reg(before_reg), Penalty(penalty) + Command(InspIRCd* Instance, Module* me, const std::string &cmd, const char *flags, int minpara, bool before_reg = false, int penalty = 1) : + ServerInstance(Instance), command(cmd), creator(me), flags_needed(flags ? *flags : 0), + min_params(minpara), max_params(0), disabled(false), works_before_reg(before_reg), Penalty(penalty) { use_count = 0; total_bytes = 0; - source = ""; - syntax = ""; - translation.clear(); } - Command(InspIRCd* Instance, const std::string &cmd, const char *flags, int minpara, int maxpara, bool before_reg = false, int penalty = 1) : ServerInstance(Instance), command(cmd), flags_needed(flags ? *flags : 0), min_params(minpara), max_params(maxpara), disabled(false), works_before_reg(before_reg), Penalty(penalty) + Command(InspIRCd* Instance, Module* me, const std::string &cmd, const char *flags, int minpara, int maxpara, bool before_reg = false, int penalty = 1) : + ServerInstance(Instance), command(cmd), creator(me), flags_needed(flags ? *flags : 0), + min_params(minpara), max_params(maxpara), disabled(false), works_before_reg(before_reg), Penalty(penalty) { use_count = 0; total_bytes = 0; - source = ""; - syntax = ""; - translation.clear(); } /** Handle the command from a user. diff --git a/include/mode.h b/include/mode.h index da202c236..0f43d6db4 100644 --- a/include/mode.h +++ b/include/mode.h @@ -150,6 +150,9 @@ class CoreExport ModeHandler : public classbase char prefixneeded; public: + /** Module that created this mode. NULL for core modes */ + Module* creator; + /** * The constructor for ModeHandler initalizes the mode handler. * The constructor of any class you derive from ModeHandler should @@ -165,9 +168,12 @@ class CoreExport ModeHandler : public classbase * In the core, the only modes to implement prefixes are +ovh (ops, voice, halfop) which define the prefix characters @, % and + * and the rank values OP_VALUE, HALFOP_VALUE and VOICE_VALUE respectively. Any prefixes you define should have unique values proportional * to these three defaults or proportional to another mode in a module you depend on. See src/cmode_o.cpp as an example. + * @param prefixrequired The prefix required to change this mode + * @param translate The translation type for the argument(s) of this mode */ - ModeHandler(InspIRCd* Instance, char modeletter, int parameters_on, int parameters_off, bool listmode, ModeType type, bool operonly, - char mprefix = 0, char prefixrequired = '%', TranslateType translate = TR_TEXT); + ModeHandler(InspIRCd* Instance, Module* me, char modeletter, int parameters_on, int parameters_off, + bool listmode, ModeType type, bool operonly, char mprefix = 0, + char prefixrequired = '%', TranslateType translate = TR_TEXT); /** * The default destructor does nothing */ @@ -321,8 +327,9 @@ class CoreExport ModeHandler : public classbase class CoreExport SimpleUserModeHandler : public ModeHandler { public: - SimpleUserModeHandler(InspIRCd* Instance, char modeletter); - virtual ~SimpleUserModeHandler(); + SimpleUserModeHandler(InspIRCd* Instance, Module* Creator, char modeletter) + : ModeHandler(Instance, Creator, modeletter, 0, 0, false, MODETYPE_USER, false) {} + virtual ~SimpleUserModeHandler() {} virtual ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding, bool servermode = false); }; @@ -334,8 +341,9 @@ class CoreExport SimpleUserModeHandler : public ModeHandler class CoreExport SimpleChannelModeHandler : public ModeHandler { public: - SimpleChannelModeHandler(InspIRCd* Instance, char modeletter); - virtual ~SimpleChannelModeHandler(); + SimpleChannelModeHandler(InspIRCd* Instance, Module* Creator, char modeletter) + : ModeHandler(Instance, Creator, modeletter, 0, 0, false, MODETYPE_CHANNEL, false) {} + virtual ~SimpleChannelModeHandler() {} virtual ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding, bool servermode = false); }; diff --git a/include/u_listmode.h b/include/u_listmode.h index 0a2c25710..d6e534e07 100644 --- a/include/u_listmode.h +++ b/include/u_listmode.h @@ -124,7 +124,7 @@ class ListModeBase : public ModeHandler bool tidy; /** Config tag to check for max items per channel */ - std::string configtag; + std::string configtag; /** Limits on a per-channel basis read from the tag * specified in ListModeBase::configtag */ @@ -140,8 +140,8 @@ class ListModeBase : public ModeHandler * @param autotidy Automatically tidy list entries on add * @param ctag Configuration tag to get limits from */ - ListModeBase(InspIRCd* Instance, char modechar, const std::string &eolstr, unsigned int lnum, unsigned int eolnum, bool autotidy, const std::string &ctag = "banlist") - : ModeHandler(Instance, modechar, 1, 1, true, MODETYPE_CHANNEL, false), listnumeric(lnum), endoflistnumeric(eolnum), endofliststring(eolstr), tidy(autotidy), configtag(ctag) + ListModeBase(InspIRCd* Instance, Module* Creator, char modechar, const std::string &eolstr, unsigned int lnum, unsigned int eolnum, bool autotidy, const std::string &ctag = "banlist") + : ModeHandler(Instance, Creator, modechar, 1, 1, true, MODETYPE_CHANNEL, false), listnumeric(lnum), endoflistnumeric(eolnum), endofliststring(eolstr), tidy(autotidy), configtag(ctag) { this->DoRehash(); infokey = "listbase_mode_" + std::string(1, mode) + "_list"; diff --git a/src/command_parse.cpp b/src/command_parse.cpp index efc295e5e..e7478478a 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -161,7 +161,7 @@ bool CommandParser::IsValidCommand(const std::string &commandname, unsigned int if (n != cmdlist.end()) { - if ((pcnt >= n->second->min_params) && (n->second->source != "")) + if ((pcnt >= n->second->min_params) && (n->second->creator != NULL)) { if (IS_LOCAL(user) && n->second->flags_needed) { @@ -414,7 +414,7 @@ bool CommandParser::ProcessCommand(User *user, std::string &cmd) } } -void CommandParser::RemoveCommands(const char* source) +void CommandParser::RemoveCommands(Module* source) { Commandtable::iterator i,safei; for (i = cmdlist.begin(); i != cmdlist.end();) @@ -441,10 +441,10 @@ void CommandParser::RemoveRFCCommands() delete reload; } -void CommandParser::RemoveCommand(Commandtable::iterator safei, const char* source) +void CommandParser::RemoveCommand(Commandtable::iterator safei, Module* source) { Command* x = safei->second; - if (x->source == std::string(source)) + if (x->creator == source) { cmdlist.erase(safei); } diff --git a/src/commands/cmd_commands.cpp b/src/commands/cmd_commands.cpp index 8f46824e8..2683f0619 100644 --- a/src/commands/cmd_commands.cpp +++ b/src/commands/cmd_commands.cpp @@ -25,10 +25,11 @@ CmdResult CommandCommands::Handle (const std::vector&, User *user) { for (Commandtable::iterator i = ServerInstance->Parser->cmdlist.begin(); i != ServerInstance->Parser->cmdlist.end(); i++) { + Module* src = i->second->creator; user->WriteNumeric(RPL_COMMANDS, "%s :%s %s %d %d", user->nick.c_str(), i->second->command.c_str(), - i->second->source.c_str(), + src ? src->ModuleSourceFile.c_str() : "", i->second->min_params, i->second->Penalty); } diff --git a/src/commands/cmd_whowas.cpp b/src/commands/cmd_whowas.cpp index e5542d16e..1109b4d8b 100644 --- a/src/commands/cmd_whowas.cpp +++ b/src/commands/cmd_whowas.cpp @@ -21,7 +21,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) return new CommandWhowas(Instance); } -CommandWhowas::CommandWhowas(InspIRCd* Instance) : Command(Instance, "WHOWAS", 0, 1, false, 2) +CommandWhowas::CommandWhowas(InspIRCd* Instance) : Command(Instance, NULL, "WHOWAS", 0, 1, false, 2) { syntax = "{,}"; timer = new WhoWasMaintainTimer(Instance, 3600); diff --git a/src/mode.cpp b/src/mode.cpp index cbd58021c..e31855e77 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -49,8 +49,8 @@ /* +s (server notice masks) */ #include "modes/umode_s.h" -ModeHandler::ModeHandler(InspIRCd* Instance, char modeletter, int parameters_on, int parameters_off, bool listmode, ModeType type, bool operonly, char mprefix, char prefixrequired, TranslateType translate) - : ServerInstance(Instance), mode(modeletter), n_params_on(parameters_on), n_params_off(parameters_off), list(listmode), m_type(type), m_paramtype(translate), oper(operonly), prefix(mprefix), count(0), prefixneeded(prefixrequired) +ModeHandler::ModeHandler(InspIRCd* Instance, Module* Creator, char modeletter, int parameters_on, int parameters_off, bool listmode, ModeType type, bool operonly, char mprefix, char prefixrequired, TranslateType translate) + : ServerInstance(Instance), mode(modeletter), n_params_on(parameters_on), n_params_off(parameters_off), list(listmode), m_type(type), m_paramtype(translate), oper(operonly), prefix(mprefix), count(0), prefixneeded(prefixrequired), creator(Creator) { } @@ -160,22 +160,6 @@ bool ModeHandler::CheckTimeStamp(std::string& theirs, const std::string& ours, C return (theirs < ours); } -SimpleUserModeHandler::SimpleUserModeHandler(InspIRCd* Instance, char modeletter) : ModeHandler(Instance, modeletter, 0, 0, false, MODETYPE_USER, false) -{ -} - -SimpleUserModeHandler::~SimpleUserModeHandler() -{ -} - -SimpleChannelModeHandler::~SimpleChannelModeHandler() -{ -} - -SimpleChannelModeHandler::SimpleChannelModeHandler(InspIRCd* Instance, char modeletter) : ModeHandler(Instance, modeletter, 0, 0, false, MODETYPE_CHANNEL, false) -{ -} - ModeAction SimpleUserModeHandler::OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding, bool servermode) { if (adding) diff --git a/src/modes/cmode_b.cpp b/src/modes/cmode_b.cpp index dad47a67b..595bdb99e 100644 --- a/src/modes/cmode_b.cpp +++ b/src/modes/cmode_b.cpp @@ -25,7 +25,7 @@ #include "hashcomp.h" #include "modes/cmode_b.h" -ModeChannelBan::ModeChannelBan(InspIRCd* Instance) : ModeHandler(Instance, 'b', 1, 1, true, MODETYPE_CHANNEL, false) +ModeChannelBan::ModeChannelBan(InspIRCd* Instance) : ModeHandler(Instance, NULL, 'b', 1, 1, true, MODETYPE_CHANNEL, false) { } diff --git a/src/modes/cmode_h.cpp b/src/modes/cmode_h.cpp index 9e706c325..24eacdb24 100644 --- a/src/modes/cmode_h.cpp +++ b/src/modes/cmode_h.cpp @@ -19,7 +19,7 @@ #include "modules.h" #include "modes/cmode_h.h" -ModeChannelHalfOp::ModeChannelHalfOp(InspIRCd* Instance) : ModeHandler(Instance, 'h', 1, 1, true, MODETYPE_CHANNEL, false, '%', '@', TR_NICK) +ModeChannelHalfOp::ModeChannelHalfOp(InspIRCd* Instance) : ModeHandler(Instance, NULL, 'h', 1, 1, true, MODETYPE_CHANNEL, false, '%', '@', TR_NICK) { } diff --git a/src/modes/cmode_i.cpp b/src/modes/cmode_i.cpp index ad4b5e8d8..60183b001 100644 --- a/src/modes/cmode_i.cpp +++ b/src/modes/cmode_i.cpp @@ -17,7 +17,7 @@ #include "users.h" #include "modes/cmode_i.h" -ModeChannelInviteOnly::ModeChannelInviteOnly(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, 'i') +ModeChannelInviteOnly::ModeChannelInviteOnly(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, NULL, 'i') { } diff --git a/src/modes/cmode_k.cpp b/src/modes/cmode_k.cpp index b270966da..4ffc24686 100644 --- a/src/modes/cmode_k.cpp +++ b/src/modes/cmode_k.cpp @@ -17,7 +17,7 @@ #include "users.h" #include "modes/cmode_k.h" -ModeChannelKey::ModeChannelKey(InspIRCd* Instance) : ModeHandler(Instance, 'k', 1, 1, false, MODETYPE_CHANNEL, false) +ModeChannelKey::ModeChannelKey(InspIRCd* Instance) : ModeHandler(Instance, NULL, 'k', 1, 1, false, MODETYPE_CHANNEL, false) { } diff --git a/src/modes/cmode_l.cpp b/src/modes/cmode_l.cpp index d60c9b3a7..e0293de72 100644 --- a/src/modes/cmode_l.cpp +++ b/src/modes/cmode_l.cpp @@ -17,7 +17,7 @@ #include "users.h" #include "modes/cmode_l.h" -ModeChannelLimit::ModeChannelLimit(InspIRCd* Instance) : ModeHandler(Instance, 'l', 1, 0, false, MODETYPE_CHANNEL, false) +ModeChannelLimit::ModeChannelLimit(InspIRCd* Instance) : ModeHandler(Instance, NULL, 'l', 1, 0, false, MODETYPE_CHANNEL, false) { } diff --git a/src/modes/cmode_m.cpp b/src/modes/cmode_m.cpp index 2f1b1df31..1e40e9a16 100644 --- a/src/modes/cmode_m.cpp +++ b/src/modes/cmode_m.cpp @@ -17,7 +17,7 @@ #include "users.h" #include "modes/cmode_m.h" -ModeChannelModerated::ModeChannelModerated(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, 'm') +ModeChannelModerated::ModeChannelModerated(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, NULL, 'm') { } diff --git a/src/modes/cmode_n.cpp b/src/modes/cmode_n.cpp index 5e1f68c60..bdc3521a5 100644 --- a/src/modes/cmode_n.cpp +++ b/src/modes/cmode_n.cpp @@ -17,7 +17,7 @@ #include "users.h" #include "modes/cmode_n.h" -ModeChannelNoExternal::ModeChannelNoExternal(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, 'n') +ModeChannelNoExternal::ModeChannelNoExternal(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, NULL, 'n') { } diff --git a/src/modes/cmode_o.cpp b/src/modes/cmode_o.cpp index e39591f63..cadd7ee26 100644 --- a/src/modes/cmode_o.cpp +++ b/src/modes/cmode_o.cpp @@ -19,7 +19,7 @@ #include "modules.h" #include "modes/cmode_o.h" -ModeChannelOp::ModeChannelOp(InspIRCd* Instance) : ModeHandler(Instance, 'o', 1, 1, true, MODETYPE_CHANNEL, false, '@', '@', TR_NICK) +ModeChannelOp::ModeChannelOp(InspIRCd* Instance) : ModeHandler(Instance, NULL, 'o', 1, 1, true, MODETYPE_CHANNEL, false, '@', '@', TR_NICK) { } diff --git a/src/modes/cmode_p.cpp b/src/modes/cmode_p.cpp index 9c8e33107..d5f52eb78 100644 --- a/src/modes/cmode_p.cpp +++ b/src/modes/cmode_p.cpp @@ -17,7 +17,7 @@ #include "users.h" #include "modes/cmode_p.h" -ModeChannelPrivate::ModeChannelPrivate(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, 'p') +ModeChannelPrivate::ModeChannelPrivate(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, NULL, 'p') { } diff --git a/src/modes/cmode_s.cpp b/src/modes/cmode_s.cpp index b7bd25430..d5ec5bbed 100644 --- a/src/modes/cmode_s.cpp +++ b/src/modes/cmode_s.cpp @@ -17,7 +17,7 @@ #include "users.h" #include "modes/cmode_s.h" -ModeChannelSecret::ModeChannelSecret(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, 's') +ModeChannelSecret::ModeChannelSecret(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, NULL, 's') { } diff --git a/src/modes/cmode_t.cpp b/src/modes/cmode_t.cpp index 2a2a61c4e..ca6a4a105 100644 --- a/src/modes/cmode_t.cpp +++ b/src/modes/cmode_t.cpp @@ -17,7 +17,7 @@ #include "users.h" #include "modes/cmode_t.h" -ModeChannelTopicOps::ModeChannelTopicOps(InspIRCd* Instance) : ModeHandler(Instance, 't', 0, 0, false, MODETYPE_CHANNEL, false) +ModeChannelTopicOps::ModeChannelTopicOps(InspIRCd* Instance) : ModeHandler(Instance, NULL, 't', 0, 0, false, MODETYPE_CHANNEL, false) { } diff --git a/src/modes/cmode_v.cpp b/src/modes/cmode_v.cpp index 053475d3d..cba8e7fd0 100644 --- a/src/modes/cmode_v.cpp +++ b/src/modes/cmode_v.cpp @@ -20,7 +20,7 @@ #include "modules.h" #include "modes/cmode_v.h" -ModeChannelVoice::ModeChannelVoice(InspIRCd* Instance) : ModeHandler(Instance, 'v', 1, 1, true, MODETYPE_CHANNEL, false, '+', '%', TR_NICK) +ModeChannelVoice::ModeChannelVoice(InspIRCd* Instance) : ModeHandler(Instance, NULL, 'v', 1, 1, true, MODETYPE_CHANNEL, false, '+', '%', TR_NICK) { } diff --git a/src/modes/umode_i.cpp b/src/modes/umode_i.cpp index ea8f1ce42..caac9ff37 100644 --- a/src/modes/umode_i.cpp +++ b/src/modes/umode_i.cpp @@ -17,7 +17,7 @@ #include "users.h" #include "modes/umode_i.h" -ModeUserInvisible::ModeUserInvisible(InspIRCd* Instance) : SimpleUserModeHandler(Instance, 'i') +ModeUserInvisible::ModeUserInvisible(InspIRCd* Instance) : SimpleUserModeHandler(Instance, NULL, 'i') { } diff --git a/src/modes/umode_o.cpp b/src/modes/umode_o.cpp index df69a8419..6848f6e17 100644 --- a/src/modes/umode_o.cpp +++ b/src/modes/umode_o.cpp @@ -17,7 +17,7 @@ #include "users.h" #include "modes/umode_o.h" -ModeUserOperator::ModeUserOperator(InspIRCd* Instance) : ModeHandler(Instance, 'o', 0, 0, false, MODETYPE_USER, true) +ModeUserOperator::ModeUserOperator(InspIRCd* Instance) : ModeHandler(Instance, NULL, 'o', 0, 0, false, MODETYPE_USER, true) { } diff --git a/src/modes/umode_s.cpp b/src/modes/umode_s.cpp index 0c1c30948..8bac7cd53 100644 --- a/src/modes/umode_s.cpp +++ b/src/modes/umode_s.cpp @@ -17,7 +17,7 @@ #include "users.h" #include "modes/umode_s.h" -ModeUserServerNoticeMask::ModeUserServerNoticeMask(InspIRCd* Instance) : ModeHandler(Instance, 's', 1, 0, false, MODETYPE_USER, true) +ModeUserServerNoticeMask::ModeUserServerNoticeMask(InspIRCd* Instance) : ModeHandler(Instance, NULL, 's', 1, 0, false, MODETYPE_USER, true) { } diff --git a/src/modes/umode_w.cpp b/src/modes/umode_w.cpp index a78e252a3..5990fd2a0 100644 --- a/src/modes/umode_w.cpp +++ b/src/modes/umode_w.cpp @@ -17,7 +17,7 @@ #include "users.h" #include "modes/umode_w.h" -ModeUserWallops::ModeUserWallops(InspIRCd* Instance) : SimpleUserModeHandler(Instance, 'w') +ModeUserWallops::ModeUserWallops(InspIRCd* Instance) : SimpleUserModeHandler(Instance, NULL, 'w') { } diff --git a/src/modules.cpp b/src/modules.cpp index 5b2cc8ee4..ed85bedee 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -555,7 +555,7 @@ bool ModuleManager::Unload(const char* filename) this->DetachAll(modfind->second.second); - Instance->Parser->RemoveCommands(filename); + Instance->Parser->RemoveCommands(modfind->second.second); delete modfind->second.second; delete modfind->second.first; diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 7c5f7ee49..f5133a1dc 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -47,11 +47,9 @@ public: class CommandStartTLS : public Command { - Module* Caller; public: - CommandStartTLS (InspIRCd* Instance, Module* mod) : Command(Instance,"STARTTLS", 0, 0, true), Caller(mod) + CommandStartTLS (InspIRCd* Instance, Module* mod) : Command(Instance, mod, "STARTTLS", 0, 0, true) { - this->source = "m_ssl_gnutls.so"; } CmdResult Handle (const std::vector ¶meters, User *user) @@ -69,8 +67,8 @@ class CommandStartTLS : public Command if (!user->GetIOHook()) { user->WriteNumeric(670, "%s :STARTTLS successful, go ahead with TLS handshake", user->nick.c_str()); - user->AddIOHook(Caller); - Caller->OnRawSocketAccept(user->GetFd(), NULL, NULL); + user->AddIOHook(creator); + creator->OnRawSocketAccept(user->GetFd(), NULL, NULL); } else user->WriteNumeric(691, "%s :STARTTLS failure", user->nick.c_str()); diff --git a/src/modules/m_allowinvite.cpp b/src/modules/m_allowinvite.cpp index e177f8ee6..ce4d73098 100644 --- a/src/modules/m_allowinvite.cpp +++ b/src/modules/m_allowinvite.cpp @@ -18,7 +18,7 @@ class AllowInvite : public SimpleChannelModeHandler { public: - AllowInvite(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, 'A') { } + AllowInvite(InspIRCd* Instance, Module* Creator) : SimpleChannelModeHandler(Instance, Creator, 'A') { } }; class ModuleAllowInvite : public Module @@ -26,7 +26,7 @@ class ModuleAllowInvite : public Module AllowInvite ni; public: - ModuleAllowInvite(InspIRCd* Me) : Module(Me), ni(Me) + ModuleAllowInvite(InspIRCd* Me) : Module(Me), ni(Me, this) { if (!ServerInstance->Modes->AddMode(&ni)) throw ModuleException("Could not add new modes!"); diff --git a/src/modules/m_alltime.cpp b/src/modules/m_alltime.cpp index 79a94c2b6..7121ac4c7 100644 --- a/src/modules/m_alltime.cpp +++ b/src/modules/m_alltime.cpp @@ -18,9 +18,8 @@ class CommandAlltime : public Command { public: - CommandAlltime(InspIRCd *Instance) : Command(Instance, "ALLTIME", "o", 0) + CommandAlltime(InspIRCd *Instance, Module* Creator) : Command(Instance, Creator, "ALLTIME", "o", 0) { - this->source = "m_alltime.so"; syntax.clear(); translation.push_back(TR_END); } @@ -53,7 +52,7 @@ class Modulealltime : public Module CommandAlltime mycommand; public: Modulealltime(InspIRCd *Me) - : Module(Me), mycommand(Me) + : Module(Me), mycommand(Me, this) { ServerInstance->AddCommand(&mycommand); } diff --git a/src/modules/m_auditorium.cpp b/src/modules/m_auditorium.cpp index 8da062593..ae5fba018 100644 --- a/src/modules/m_auditorium.cpp +++ b/src/modules/m_auditorium.cpp @@ -18,7 +18,7 @@ class AuditoriumMode : public ModeHandler { public: - AuditoriumMode(InspIRCd* Instance) : ModeHandler(Instance, 'u', 0, 0, false, MODETYPE_CHANNEL, false, 0, '@') { } + AuditoriumMode(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'u', 0, 0, false, MODETYPE_CHANNEL, false, 0, '@') { } ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding, bool) { @@ -42,7 +42,7 @@ class ModuleAuditorium : public Module bool OperOverride; public: ModuleAuditorium(InspIRCd* Me) - : Module(Me), aum(Me) + : Module(Me), aum(Me, this) { if (!ServerInstance->Modes->AddMode(&aum)) throw ModuleException("Could not add new modes!"); diff --git a/src/modules/m_banexception.cpp b/src/modules/m_banexception.cpp index 93267e03c..55a5da83f 100644 --- a/src/modules/m_banexception.cpp +++ b/src/modules/m_banexception.cpp @@ -31,7 +31,7 @@ class BanException : public ListModeBase { public: - BanException(InspIRCd* Instance) : ListModeBase(Instance, 'e', "End of Channel Exception List", 348, 349, true) { } + BanException(InspIRCd* Instance, Module* Creator) : ListModeBase(Instance, Creator, 'e', "End of Channel Exception List", 348, 349, true) { } }; @@ -40,7 +40,7 @@ class ModuleBanException : public Module BanException be; public: - ModuleBanException(InspIRCd* Me) : Module(Me), be(Me) + ModuleBanException(InspIRCd* Me) : Module(Me), be(Me, this) { if (!ServerInstance->Modes->AddMode(&be)) throw ModuleException("Could not add new modes!"); diff --git a/src/modules/m_banredirect.cpp b/src/modules/m_banredirect.cpp index bec69e608..8bbdc1edc 100644 --- a/src/modules/m_banredirect.cpp +++ b/src/modules/m_banredirect.cpp @@ -38,8 +38,7 @@ typedef std::deque StringDeque; class BanRedirect : public ModeWatcher { public: - BanRedirect(InspIRCd* Instance) - : ModeWatcher(Instance, 'b', MODETYPE_CHANNEL) + BanRedirect(InspIRCd* Instance) : ModeWatcher(Instance, 'b', MODETYPE_CHANNEL) { } diff --git a/src/modules/m_blockcaps.cpp b/src/modules/m_blockcaps.cpp index 8b0c73ce3..6ce1cecc5 100644 --- a/src/modules/m_blockcaps.cpp +++ b/src/modules/m_blockcaps.cpp @@ -21,7 +21,7 @@ class BlockCaps : public SimpleChannelModeHandler { public: - BlockCaps(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, 'B') { } + BlockCaps(InspIRCd* Instance, Module* Creator) : SimpleChannelModeHandler(Instance, Creator, 'B') { } }; class ModuleBlockCAPS : public Module @@ -32,7 +32,7 @@ class ModuleBlockCAPS : public Module char capsmap[256]; public: - ModuleBlockCAPS(InspIRCd* Me) : Module(Me), bc(Me) + ModuleBlockCAPS(InspIRCd* Me) : Module(Me), bc(Me, this) { OnRehash(NULL); if (!ServerInstance->Modes->AddMode(&bc)) diff --git a/src/modules/m_blockcolor.cpp b/src/modules/m_blockcolor.cpp index 020627d01..982d225c3 100644 --- a/src/modules/m_blockcolor.cpp +++ b/src/modules/m_blockcolor.cpp @@ -20,7 +20,7 @@ class BlockColor : public SimpleChannelModeHandler { public: - BlockColor(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, 'c') { } + BlockColor(InspIRCd* Instance, Module* Creator) : SimpleChannelModeHandler(Instance, Creator, 'c') { } }; class ModuleBlockColour : public Module @@ -29,7 +29,7 @@ class ModuleBlockColour : public Module BlockColor bc; public: - ModuleBlockColour(InspIRCd* Me) : Module(Me), bc(Me) + ModuleBlockColour(InspIRCd* Me) : Module(Me), bc(Me, this) { if (!ServerInstance->Modes->AddMode(&bc)) throw ModuleException("Could not add new modes!"); diff --git a/src/modules/m_botmode.cpp b/src/modules/m_botmode.cpp index 01bc46357..9ba154c15 100644 --- a/src/modules/m_botmode.cpp +++ b/src/modules/m_botmode.cpp @@ -20,7 +20,7 @@ class BotMode : public SimpleUserModeHandler { public: - BotMode(InspIRCd* Instance) : SimpleUserModeHandler(Instance, 'B') { } + BotMode(InspIRCd* Instance, Module* Creator) : SimpleUserModeHandler(Instance, Creator, 'B') { } }; class ModuleBotMode : public Module @@ -28,7 +28,7 @@ class ModuleBotMode : public Module BotMode bm; public: ModuleBotMode(InspIRCd* Me) - : Module(Me), bm(Me) + : Module(Me), bm(Me, this) { if (!ServerInstance->Modes->AddMode(&bm)) throw ModuleException("Could not add new modes!"); diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp index 29ba7fd60..f275c0a88 100644 --- a/src/modules/m_callerid.cpp +++ b/src/modules/m_callerid.cpp @@ -127,17 +127,15 @@ void RemoveData(User* who) class User_g : public SimpleUserModeHandler { public: - User_g(InspIRCd* Instance) : SimpleUserModeHandler(Instance, 'g') { } + User_g(InspIRCd* Instance, Module* Creator) : SimpleUserModeHandler(Instance, Creator, 'g') { } }; class CommandAccept : public Command { -private: - unsigned int& maxaccepts; public: - CommandAccept(InspIRCd* Instance, unsigned int& max) : Command(Instance, "ACCEPT", 0, 1), maxaccepts(max) + unsigned int maxaccepts; + CommandAccept(InspIRCd* Instance, Module* Creator) : Command(Instance, Creator, "ACCEPT", 0, 1) { - source = "m_callerid.so"; syntax = "{[+|-]}|*}"; TRANSLATE2(TR_CUSTOM, TR_END); } @@ -311,7 +309,6 @@ private: User_g myumode; // Configuration variables: - unsigned int maxaccepts; // Maximum ACCEPT entries. bool operoverride; // Operators can override callerid. bool tracknick; // Allow ACCEPT entries to update with nick changes. unsigned int notify_cooldown; // Seconds between notifications. @@ -342,7 +339,7 @@ private: } public: - ModuleCallerID(InspIRCd* Me) : Module(Me), mycommand(Me, maxaccepts), myumode(Me) + ModuleCallerID(InspIRCd* Me) : Module(Me), mycommand(Me, this), myumode(Me, this) { OnRehash(NULL); @@ -466,7 +463,7 @@ public: virtual void OnRehash(User* user) { ConfigReader Conf(ServerInstance); - maxaccepts = Conf.ReadInteger("callerid", "maxaccepts", "16", 0, true); + mycommand.maxaccepts = Conf.ReadInteger("callerid", "maxaccepts", "16", 0, true); operoverride = Conf.ReadFlag("callerid", "operoverride", "0", 0); tracknick = Conf.ReadFlag("callerid", "tracknick", "0", 0); notify_cooldown = Conf.ReadInteger("callerid", "cooldown", "60", 0, true); diff --git a/src/modules/m_cap.cpp b/src/modules/m_cap.cpp index 2e9a24811..2b700a5ae 100644 --- a/src/modules/m_cap.cpp +++ b/src/modules/m_cap.cpp @@ -34,11 +34,9 @@ CAP END */ class CommandCAP : public Command { - Module* Creator; public: - CommandCAP (InspIRCd* Instance, Module* mod) : Command(Instance,"CAP", 0, 1, true), Creator(mod) + CommandCAP (InspIRCd* Instance, Module* mod) : Command(Instance, mod, "CAP", 0, 1, true) { - this->source = "m_cap.so"; } CmdResult Handle (const std::vector ¶meters, User *user) @@ -51,7 +49,7 @@ class CommandCAP : public Command Data.type = subcommand; Data.user = user; - Data.creator = this->Creator; + Data.creator = this->creator; if (parameters.size() < 2) return CMD_FAILURE; @@ -67,7 +65,7 @@ class CommandCAP : public Command } user->Extend("CAP_REGHOLD"); - Event event((char*) &Data, (Module*)this->Creator, "cap_req"); + Event event((char*) &Data, this->creator, "cap_req"); event.Send(this->ServerInstance); if (Data.ack.size() > 0) @@ -92,10 +90,10 @@ class CommandCAP : public Command Data.type = subcommand; Data.user = user; - Data.creator = this->Creator; + Data.creator = this->creator; user->Extend("CAP_REGHOLD"); - Event event((char*) &Data, (Module*)this->Creator, subcommand == "LS" ? "cap_ls" : "cap_list"); + Event event((char*) &Data, this->creator, subcommand == "LS" ? "cap_ls" : "cap_list"); event.Send(this->ServerInstance); std::string Result; @@ -112,10 +110,10 @@ class CommandCAP : public Command Data.type = subcommand; Data.user = user; - Data.creator = this->Creator; + Data.creator = this->creator; user->Extend("CAP_REGHOLD"); - Event event((char*) &Data, (Module*)this->Creator, "cap_clear"); + Event event((char*) &Data, this->creator, "cap_clear"); event.Send(this->ServerInstance); std::string Result = irc::stringjoiner(" ", Data.ack, 0, Data.ack.size() - 1).GetJoined(); diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp index a815cf35f..bf4fa4e6d 100644 --- a/src/modules/m_cban.cpp +++ b/src/modules/m_cban.cpp @@ -84,9 +84,8 @@ class CBanFactory : public XLineFactory class CommandCBan : public Command { public: - CommandCBan(InspIRCd* Me) : Command(Me, "CBAN", "o", 1, 3) + CommandCBan(InspIRCd* Me, Module* Creator) : Command(Me, Creator, "CBAN", "o", 1, 3) { - this->source = "m_cban.so"; this->syntax = " [ :]"; TRANSLATE4(TR_TEXT,TR_TEXT,TR_TEXT,TR_END); } @@ -162,7 +161,7 @@ class ModuleCBan : public Module CBanFactory f; public: - ModuleCBan(InspIRCd* Me) : Module(Me), mycommand(Me), f(Me) + ModuleCBan(InspIRCd* Me) : Module(Me), mycommand(Me, this), f(Me) { ServerInstance->XLines->RegisterFactory(&f); diff --git a/src/modules/m_censor.cpp b/src/modules/m_censor.cpp index 9c68be7fd..13527f64a 100644 --- a/src/modules/m_censor.cpp +++ b/src/modules/m_censor.cpp @@ -26,7 +26,7 @@ typedef std::map censor_t; class CensorUser : public SimpleUserModeHandler { public: - CensorUser(InspIRCd* Instance) : SimpleUserModeHandler(Instance, 'G') { } + CensorUser(InspIRCd* Instance, Module* Creator) : SimpleUserModeHandler(Instance, Creator, 'G') { } }; /** Handles channel mode +G @@ -34,7 +34,7 @@ class CensorUser : public SimpleUserModeHandler class CensorChannel : public SimpleChannelModeHandler { public: - CensorChannel(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, 'G') { } + CensorChannel(InspIRCd* Instance, Module* Creator) : SimpleChannelModeHandler(Instance, Creator, 'G') { } }; class ModuleCensor : public Module @@ -45,7 +45,7 @@ class ModuleCensor : public Module public: ModuleCensor(InspIRCd* Me) - : Module(Me), cu(Me), cc(Me) + : Module(Me), cu(Me, this), cc(Me, this) { /* Read the configuration file on startup. */ diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index 3e00f498d..a406ad658 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -56,9 +56,9 @@ class CommandWebirc : public Command bool notify; public: CGIHostlist Hosts; - CommandWebirc(InspIRCd* Instance, bool bnotify) : Command(Instance, "WEBIRC", 0, 4, true), notify(bnotify) + CommandWebirc(InspIRCd* Instance, Module* Creator, bool bnotify) + : Command(Instance, Creator, "WEBIRC", 0, 4, true), notify(bnotify) { - this->source = "m_cgiirc.so"; this->syntax = "password client hostname ip"; } CmdResult Handle(const std::vector ¶meters, User *user) @@ -138,7 +138,7 @@ class ModuleCgiIRC : public Module CommandWebirc cmd; bool NotifyOpers; public: - ModuleCgiIRC(InspIRCd* Me) : Module(Me), cmd(Me, NotifyOpers) + ModuleCgiIRC(InspIRCd* Me) : Module(Me), cmd(Me, this, NotifyOpers) { OnRehash(NULL); ServerInstance->AddCommand(&cmd); diff --git a/src/modules/m_chanfilter.cpp b/src/modules/m_chanfilter.cpp index d98086421..977bab4cb 100644 --- a/src/modules/m_chanfilter.cpp +++ b/src/modules/m_chanfilter.cpp @@ -25,7 +25,7 @@ class ChanFilter : public ListModeBase { public: - ChanFilter(InspIRCd* Instance) : ListModeBase(Instance, 'g', "End of channel spamfilter list", 941, 940, false, "chanfilter") { } + ChanFilter(InspIRCd* Instance, Module* Creator) : ListModeBase(Instance, Creator, 'g', "End of channel spamfilter list", 941, 940, false, "chanfilter") { } virtual bool ValidateParam(User* user, Channel* chan, std::string &word) { @@ -63,7 +63,7 @@ class ModuleChanFilter : public Module public: ModuleChanFilter(InspIRCd* Me) - : Module(Me), cf(Me) + : Module(Me), cf(Me, this) { if (!ServerInstance->Modes->AddMode(&cf)) throw ModuleException("Could not add new modes!"); diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp index e24e64a3e..6301f56cb 100644 --- a/src/modules/m_chanprotect.cpp +++ b/src/modules/m_chanprotect.cpp @@ -156,8 +156,8 @@ class FounderProtectBase class ChanFounder : public ModeHandler, public FounderProtectBase { public: - ChanFounder(InspIRCd* Instance, char my_prefix, bool &depriv_self, bool &depriv_others) - : ModeHandler(Instance, 'q', 1, 1, true, MODETYPE_CHANNEL, false, my_prefix, 0, TR_NICK), + ChanFounder(InspIRCd* Instance, Module* Creator, char my_prefix, bool &depriv_self, bool &depriv_others) + : ModeHandler(Instance, Creator, 'q', 1, 1, true, MODETYPE_CHANNEL, false, my_prefix, 0, TR_NICK), FounderProtectBase(Instance, "cm_founder_", "founder", 386, 387, depriv_self, depriv_others) { } unsigned int GetPrefixRank() @@ -232,8 +232,8 @@ class ChanFounder : public ModeHandler, public FounderProtectBase class ChanProtect : public ModeHandler, public FounderProtectBase { public: - ChanProtect(InspIRCd* Instance, char my_prefix, bool &depriv_self, bool &depriv_others) - : ModeHandler(Instance, 'a', 1, 1, true, MODETYPE_CHANNEL, false, my_prefix, 0, TR_NICK), + ChanProtect(InspIRCd* Instance, Module* Creator, char my_prefix, bool &depriv_self, bool &depriv_others) + : ModeHandler(Instance, Creator, 'a', 1, 1, true, MODETYPE_CHANNEL, false, my_prefix, 0, TR_NICK), FounderProtectBase(Instance,"cm_protect_","protected user", 388, 389, depriv_self, depriv_others) { } unsigned int GetPrefixRank() @@ -328,8 +328,8 @@ class ModuleChanProtect : public Module /* Initialise module variables */ - cp = new ChanProtect(ServerInstance, APrefix, DeprivSelf, DeprivOthers); - cf = new ChanFounder(ServerInstance, QPrefix, DeprivSelf, DeprivOthers); + cp = new ChanProtect(ServerInstance, this, APrefix, DeprivSelf, DeprivOthers); + cf = new ChanFounder(ServerInstance, this, QPrefix, DeprivSelf, DeprivOthers); if (!ServerInstance->Modes->AddMode(cp) || !ServerInstance->Modes->AddMode(cf)) { diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp index 6ba578194..f8e770337 100644 --- a/src/modules/m_check.cpp +++ b/src/modules/m_check.cpp @@ -19,12 +19,10 @@ */ class CommandCheck : public Command { - Module* Parent; public: std::set meta_seen; - CommandCheck (InspIRCd* Instance, Module* parent) : Command(Instance,"CHECK", "o", 1), Parent(parent) + CommandCheck (InspIRCd* Instance, Module* parent) : Command(Instance,parent,"CHECK", "o", 1) { - this->source = "m_check.so"; syntax = "|||"; } @@ -114,7 +112,7 @@ class CommandCheck : public Command ServerInstance->DumpText(user,checkstr + " onchans ", dump); - FOREACH_MOD_I(ServerInstance,I_OnSyncUser,OnSyncUser(targuser,Parent,(void*)user)); + FOREACH_MOD_I(ServerInstance,I_OnSyncUser,OnSyncUser(targuser,creator,(void*)user)); dumpExtra(user, checkstr, targuser); } else if (targchan) @@ -148,7 +146,7 @@ class CommandCheck : public Command user->WriteServ(checkstr + " member " + tmpbuf); } - FOREACH_MOD_I(ServerInstance,I_OnSyncChannel,OnSyncChannel(targchan,Parent,(void*)user)); + FOREACH_MOD_I(ServerInstance,I_OnSyncChannel,OnSyncChannel(targchan,creator,(void*)user)); dumpExtra(user, checkstr, targchan); } else diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp index cfd8f6035..a8cad8d43 100644 --- a/src/modules/m_chghost.cpp +++ b/src/modules/m_chghost.cpp @@ -22,9 +22,8 @@ class CommandChghost : public Command private: char* hostmap; public: - CommandChghost (InspIRCd* Instance, char* hmap) : Command(Instance,"CHGHOST","o",2), hostmap(hmap) + CommandChghost (InspIRCd* Instance, Module* Creator, char* hmap) : Command(Instance,Creator,"CHGHOST","o",2), hostmap(hmap) { - this->source = "m_chghost.so"; syntax = " "; TRANSLATE3(TR_NICK, TR_TEXT, TR_END); } @@ -85,7 +84,7 @@ class ModuleChgHost : public Module char hostmap[256]; public: ModuleChgHost(InspIRCd* Me) - : Module(Me), cmd(Me, hostmap) + : Module(Me), cmd(Me, this, hostmap) { OnRehash(NULL); ServerInstance->AddCommand(&cmd); diff --git a/src/modules/m_chgident.cpp b/src/modules/m_chgident.cpp index 9dc8cbd50..58a06cbd8 100644 --- a/src/modules/m_chgident.cpp +++ b/src/modules/m_chgident.cpp @@ -20,9 +20,8 @@ class CommandChgident : public Command { public: - CommandChgident (InspIRCd* Instance) : Command(Instance,"CHGIDENT", "o", 2) + CommandChgident (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"CHGIDENT", "o", 2) { - this->source = "m_chgident.so"; syntax = " "; TRANSLATE3(TR_NICK, TR_TEXT, TR_END); } @@ -71,7 +70,7 @@ class ModuleChgIdent : public Module CommandChgident cmd; public: - ModuleChgIdent(InspIRCd* Me) : Module(Me), cmd(Me) + ModuleChgIdent(InspIRCd* Me) : Module(Me), cmd(Me, this) { ServerInstance->AddCommand(&cmd); } diff --git a/src/modules/m_chgname.cpp b/src/modules/m_chgname.cpp index 704e142bc..23c870294 100644 --- a/src/modules/m_chgname.cpp +++ b/src/modules/m_chgname.cpp @@ -20,9 +20,8 @@ class CommandChgname : public Command { public: - CommandChgname (InspIRCd* Instance) : Command(Instance,"CHGNAME", "o", 2, 2) + CommandChgname (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"CHGNAME", "o", 2, 2) { - this->source = "m_chgname.so"; syntax = " "; TRANSLATE3(TR_NICK, TR_TEXT, TR_END); } @@ -66,7 +65,7 @@ class ModuleChgName : public Module CommandChgname cmd; public: - ModuleChgName(InspIRCd* Me) : Module(Me), cmd(Me) + ModuleChgName(InspIRCd* Me) : Module(Me), cmd(Me, this) { ServerInstance->AddCommand(&cmd); } diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp index 458d833df..77316a346 100644 --- a/src/modules/m_cloaking.cpp +++ b/src/modules/m_cloaking.cpp @@ -28,7 +28,6 @@ class CloakUser : public ModeHandler unsigned int key3; unsigned int key4; bool ipalways; - Module* Sender; Module* HashProvider; const char *xtab[4]; @@ -63,7 +62,8 @@ class CloakUser : public ModeHandler return host.substr(splitdot); } - CloakUser(InspIRCd* Instance, Module* source, Module* Hash) : ModeHandler(Instance, 'x', 0, 0, false, MODETYPE_USER, false), Sender(source), HashProvider(Hash) + CloakUser(InspIRCd* Instance, Module* source, Module* Hash) + : ModeHandler(Instance, source, 'x', 0, 0, false, MODETYPE_USER, false), HashProvider(Hash) { } @@ -100,7 +100,7 @@ class CloakUser : public ModeHandler if (!dest->GetExt("cloaked_host", cloak)) { /* Force creation of missing cloak */ - Sender->OnUserConnect(dest); + creator->OnUserConnect(dest); } if (dest->GetExt("cloaked_host", cloak)) { @@ -145,14 +145,14 @@ class CloakUser : public ModeHandler octet[1] = octet[0] + "." + octet[1]; /* Reset the Hash module and send it our IV */ - HashResetRequest(Sender, HashProvider).Send(); - HashKeyRequest(Sender, HashProvider, iv).Send(); + HashResetRequest(creator, HashProvider).Send(); + HashKeyRequest(creator, HashProvider, iv).Send(); /* Send the Hash module a different hex table for each octet group's Hash sum */ for (int k = 0; k < 4; k++) { - HashHexRequest(Sender, HashProvider, xtab[(iv[k]+i[k]) % 4]).Send(); - ra[k] = std::string(HashSumRequest(Sender, HashProvider, octet[k]).Send()).substr(0,6); + HashHexRequest(creator, HashProvider, xtab[(iv[k]+i[k]) % 4]).Send(); + ra[k] = std::string(HashSumRequest(creator, HashProvider, octet[k]).Send()).substr(0,6); } /* Stick them all together */ return std::string().append(ra[0]).append(".").append(ra[1]).append(".").append(ra[2]).append(".").append(ra[3]); @@ -166,8 +166,8 @@ class CloakUser : public ModeHandler int rounds = 0; /* Reset the Hash module and send it our IV */ - HashResetRequest(Sender, HashProvider).Send(); - HashKeyRequest(Sender, HashProvider, iv).Send(); + HashResetRequest(creator, HashProvider).Send(); + HashKeyRequest(creator, HashProvider, iv).Send(); for (const char* input = ip; *input; input++) { @@ -175,8 +175,8 @@ class CloakUser : public ModeHandler if (item.length() > 7) { /* Send the Hash module a different hex table for each octet group's Hash sum */ - HashHexRequest(Sender, HashProvider, xtab[(key1+rounds) % 4]).Send(); - hashies.push_back(std::string(HashSumRequest(Sender, HashProvider, item).Send()).substr(0,8)); + HashHexRequest(creator, HashProvider, xtab[(key1+rounds) % 4]).Send(); + hashies.push_back(std::string(HashSumRequest(creator, HashProvider, item).Send()).substr(0,8)); item.clear(); } rounds++; @@ -184,8 +184,8 @@ class CloakUser : public ModeHandler if (!item.empty()) { /* Send the Hash module a different hex table for each octet group's Hash sum */ - HashHexRequest(Sender, HashProvider, xtab[(key1+rounds) % 4]).Send(); - hashies.push_back(std::string(HashSumRequest(Sender, HashProvider, item).Send()).substr(0,8)); + HashHexRequest(creator, HashProvider, xtab[(key1+rounds) % 4]).Send(); + hashies.push_back(std::string(HashSumRequest(creator, HashProvider, item).Send()).substr(0,8)); item.clear(); } /* Stick them all together */ diff --git a/src/modules/m_clones.cpp b/src/modules/m_clones.cpp index 58ecff17d..8c3429d9b 100644 --- a/src/modules/m_clones.cpp +++ b/src/modules/m_clones.cpp @@ -20,9 +20,8 @@ class CommandClones : public Command { public: - CommandClones (InspIRCd* Instance) : Command(Instance,"CLONES", "o", 1) + CommandClones (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"CLONES", "o", 1) { - this->source = "m_clones.so"; syntax = ""; } @@ -62,7 +61,7 @@ class ModuleClones : public Module private: CommandClones cmd; public: - ModuleClones(InspIRCd* Me) : Module(Me), cmd(Me) + ModuleClones(InspIRCd* Me) : Module(Me), cmd(Me, this) { ServerInstance->AddCommand(&cmd); } diff --git a/src/modules/m_close.cpp b/src/modules/m_close.cpp index 1520c9df4..9514cd809 100644 --- a/src/modules/m_close.cpp +++ b/src/modules/m_close.cpp @@ -29,9 +29,8 @@ class CommandClose : public Command { public: /* Command 'close', needs operator */ - CommandClose (InspIRCd* Instance) : Command(Instance,"CLOSE", "o", 0) + CommandClose (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"CLOSE", "o", 0) { - this->source = "m_close.so"; } CmdResult Handle (const std::vector ¶meters, User *user) @@ -68,7 +67,7 @@ class ModuleClose : public Module CommandClose cmd; public: ModuleClose(InspIRCd* Me) - : Module(Me), cmd(Me) + : Module(Me), cmd(Me, this) { ServerInstance->AddCommand(&cmd); } diff --git a/src/modules/m_commonchans.cpp b/src/modules/m_commonchans.cpp index 1e8471955..4aa420d1f 100644 --- a/src/modules/m_commonchans.cpp +++ b/src/modules/m_commonchans.cpp @@ -20,7 +20,7 @@ class PrivacyMode : public ModeHandler { public: - PrivacyMode(InspIRCd* Instance) : ModeHandler(Instance, 'c', 0, 0, false, MODETYPE_USER, false) { } + PrivacyMode(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'c', 0, 0, false, MODETYPE_USER, false) { } ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding, bool) { @@ -49,7 +49,7 @@ class ModulePrivacyMode : public Module { PrivacyMode pm; public: - ModulePrivacyMode(InspIRCd* Me) : Module(Me), pm(Me) + ModulePrivacyMode(InspIRCd* Me) : Module(Me), pm(Me, this) { if (!ServerInstance->Modes->AddMode(&pm)) throw ModuleException("Could not add new modes!"); diff --git a/src/modules/m_customtitle.cpp b/src/modules/m_customtitle.cpp index 499886535..806f2194f 100644 --- a/src/modules/m_customtitle.cpp +++ b/src/modules/m_customtitle.cpp @@ -20,9 +20,8 @@ class CommandTitle : public Command { public: - CommandTitle (InspIRCd* Instance) : Command(Instance,"TITLE",0,2) + CommandTitle (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"TITLE",0,2) { - this->source = "m_customtitle.so"; syntax = " "; TRANSLATE3(TR_NICK, TR_TEXT, TR_END); } @@ -93,7 +92,7 @@ class ModuleCustomTitle : public Module CommandTitle cmd; public: - ModuleCustomTitle(InspIRCd* Me) : Module(Me), cmd(Me) + ModuleCustomTitle(InspIRCd* Me) : Module(Me), cmd(Me, this) { ServerInstance->AddCommand(&cmd); Implementation eventlist[] = { I_OnDecodeMetaData, I_OnWhoisLine, I_OnSyncUser, I_OnUserQuit, I_OnCleanup }; diff --git a/src/modules/m_cycle.cpp b/src/modules/m_cycle.cpp index 923783e4b..2ba28d933 100644 --- a/src/modules/m_cycle.cpp +++ b/src/modules/m_cycle.cpp @@ -20,9 +20,8 @@ class CommandCycle : public Command { public: - CommandCycle (InspIRCd* Instance) : Command(Instance,"CYCLE", 0, 1, false, 3) + CommandCycle (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"CYCLE", 0, 1, false, 3) { - this->source = "m_cycle.so"; syntax = " :[reason]"; TRANSLATE3(TR_TEXT, TR_TEXT, TR_END); } @@ -82,7 +81,7 @@ class ModuleCycle : public Module CommandCycle cmd; public: ModuleCycle(InspIRCd* Me) - : Module(Me), cmd(Me) + : Module(Me), cmd(Me, this) { ServerInstance->AddCommand(&cmd); } diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp index ab6789049..df70bba82 100644 --- a/src/modules/m_dccallow.cpp +++ b/src/modules/m_dccallow.cpp @@ -47,9 +47,8 @@ bannedfilelist bfl; class CommandDccallow : public Command { public: - CommandDccallow(InspIRCd* Me) : Command(Me, "DCCALLOW", 0, 0) + CommandDccallow(InspIRCd* Me, Module* parent) : Command(Me, parent, "DCCALLOW", 0, 0) { - this->source = "m_dccallow.so"; syntax = "{[+|-]