]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Remove InspIRCd* parameters and fields
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 26 Sep 2009 14:13:13 +0000 (14:13 +0000)
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 26 Sep 2009 14:13:13 +0000 (14:13 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11763 e03df62e-2008-0410-955e-edbf42e46eb7

286 files changed:
include/bancache.h
include/caller.h
include/channelmanager.h
include/channels.h
include/command_parse.h
include/commands/cmd_whowas.h
include/configreader.h
include/dns.h
include/dynamic.h
include/fakeuser.h
include/filelogger.h
include/hashcomp.h
include/inspircd.h
include/logger.h
include/mode.h
include/modes/cmode_b.h
include/modes/cmode_h.h
include/modes/cmode_i.h
include/modes/cmode_k.h
include/modes/cmode_l.h
include/modes/cmode_m.h
include/modes/cmode_n.h
include/modes/cmode_o.h
include/modes/cmode_p.h
include/modes/cmode_s.h
include/modes/cmode_t.h
include/modes/cmode_v.h
include/modes/umode_i.h
include/modes/umode_o.h
include/modes/umode_s.h
include/modes/umode_w.h
include/modules.h
include/protocol.h
include/snomasks.h
include/socket.h
include/testsuite.h
include/threadengine.h
include/threadengines/threadengine_pthread.h
include/threadengines/threadengine_win32.h
include/timer.h
include/u_listmode.h
include/usermanager.h
include/users.h
include/xline.h
src/bancache.cpp
src/channels.cpp
src/command_parse.cpp
src/commands/cmd_away.cpp
src/commands/cmd_eline.cpp
src/commands/cmd_gline.cpp
src/commands/cmd_invite.cpp
src/commands/cmd_join.cpp
src/commands/cmd_kill.cpp
src/commands/cmd_kline.cpp
src/commands/cmd_nick.cpp
src/commands/cmd_notice.cpp
src/commands/cmd_privmsg.cpp
src/commands/cmd_qline.cpp
src/commands/cmd_rehash.cpp
src/commands/cmd_user.cpp
src/commands/cmd_whowas.cpp
src/commands/cmd_zline.cpp
src/configreader.cpp
src/dns.cpp
src/dynamic.cpp
src/filelogger.cpp
src/hashcomp.cpp
src/helperfuncs.cpp
src/inspircd.cpp
src/listensocket.cpp
src/logger.cpp
src/mode.cpp
src/modes/cmode_b.cpp
src/modes/cmode_h.cpp
src/modes/cmode_i.cpp
src/modes/cmode_k.cpp
src/modes/cmode_l.cpp
src/modes/cmode_m.cpp
src/modes/cmode_n.cpp
src/modes/cmode_o.cpp
src/modes/cmode_p.cpp
src/modes/cmode_s.cpp
src/modes/cmode_t.cpp
src/modes/cmode_v.cpp
src/modes/umode_i.cpp
src/modes/umode_o.cpp
src/modes/umode_s.cpp
src/modes/umode_w.cpp
src/modules.cpp
src/modules/extra/m_geoip.cpp
src/modules/extra/m_ldapauth.cpp
src/modules/extra/m_ldapoper.cpp
src/modules/extra/m_mssql.cpp
src/modules/extra/m_mysql.cpp
src/modules/extra/m_pgsql.cpp
src/modules/extra/m_regex_pcre.cpp
src/modules/extra/m_regex_posix.cpp
src/modules/extra/m_regex_tre.cpp
src/modules/extra/m_sqlauth.cpp
src/modules/extra/m_sqlite3.cpp
src/modules/extra/m_sqllog.cpp
src/modules/extra/m_sqloper.cpp
src/modules/extra/m_sqlutils.cpp
src/modules/extra/m_ssl_gnutls.cpp
src/modules/extra/m_ssl_openssl.cpp
src/modules/extra/m_testclient.cpp
src/modules/extra/m_ziplink.cpp
src/modules/m_abbreviation.cpp
src/modules/m_alias.cpp
src/modules/m_allowinvite.cpp
src/modules/m_alltime.cpp
src/modules/m_antibear.cpp
src/modules/m_antibottler.cpp
src/modules/m_auditorium.cpp
src/modules/m_banexception.cpp
src/modules/m_banredirect.cpp
src/modules/m_blockamsg.cpp
src/modules/m_blockcaps.cpp
src/modules/m_blockcolor.cpp
src/modules/m_botmode.cpp
src/modules/m_callerid.cpp
src/modules/m_cap.cpp
src/modules/m_cban.cpp
src/modules/m_censor.cpp
src/modules/m_cgiirc.cpp
src/modules/m_chancreate.cpp
src/modules/m_chanfilter.cpp
src/modules/m_chanlog.cpp
src/modules/m_channames.cpp
src/modules/m_channelban.cpp
src/modules/m_chanprotect.cpp
src/modules/m_check.cpp
src/modules/m_chghost.cpp
src/modules/m_chgident.cpp
src/modules/m_chgname.cpp
src/modules/m_cloaking.cpp
src/modules/m_clones.cpp
src/modules/m_close.cpp
src/modules/m_commonchans.cpp
src/modules/m_conn_join.cpp
src/modules/m_conn_umodes.cpp
src/modules/m_conn_waitpong.cpp
src/modules/m_connectban.cpp
src/modules/m_connflood.cpp
src/modules/m_customtitle.cpp
src/modules/m_cycle.cpp
src/modules/m_dccallow.cpp
src/modules/m_deaf.cpp
src/modules/m_delayjoin.cpp
src/modules/m_delaymsg.cpp
src/modules/m_denychans.cpp
src/modules/m_devoice.cpp
src/modules/m_dnsbl.cpp
src/modules/m_filter.cpp
src/modules/m_gecosban.cpp
src/modules/m_globalload.cpp
src/modules/m_globops.cpp
src/modules/m_helpop.cpp
src/modules/m_hidechans.cpp
src/modules/m_hideoper.cpp
src/modules/m_hostchange.cpp
src/modules/m_httpd.cpp
src/modules/m_httpd_acl.cpp
src/modules/m_httpd_config.cpp
src/modules/m_httpd_stats.cpp
src/modules/m_ident.cpp
src/modules/m_invisible.cpp
src/modules/m_inviteexception.cpp
src/modules/m_joinflood.cpp
src/modules/m_jumpserver.cpp
src/modules/m_kicknorejoin.cpp
src/modules/m_knock.cpp
src/modules/m_lockserv.cpp
src/modules/m_maphide.cpp
src/modules/m_md5.cpp
src/modules/m_messageflood.cpp
src/modules/m_muteban.cpp
src/modules/m_namesx.cpp
src/modules/m_nationalchars.cpp
src/modules/m_nickflood.cpp
src/modules/m_nicklock.cpp
src/modules/m_noctcp.cpp
src/modules/m_nokicks.cpp
src/modules/m_nonicks.cpp
src/modules/m_nonotice.cpp
src/modules/m_nopartmsg.cpp
src/modules/m_ojoin.cpp
src/modules/m_operchans.cpp
src/modules/m_operinvex.cpp
src/modules/m_operjoin.cpp
src/modules/m_operlevels.cpp
src/modules/m_operlog.cpp
src/modules/m_opermodes.cpp
src/modules/m_opermotd.cpp
src/modules/m_operprefix.cpp
src/modules/m_override.cpp
src/modules/m_password_hash.cpp
src/modules/m_permchannels.cpp
src/modules/m_randquote.cpp
src/modules/m_redirect.cpp
src/modules/m_regex.h
src/modules/m_regex_glob.cpp
src/modules/m_regonlycreate.cpp
src/modules/m_remove.cpp
src/modules/m_restrictchans.cpp
src/modules/m_restrictmsg.cpp
src/modules/m_ripemd160.cpp
src/modules/m_rline.cpp
src/modules/m_rpc_json.cpp
src/modules/m_rpctest.cpp
src/modules/m_safelist.cpp
src/modules/m_sajoin.cpp
src/modules/m_sakick.cpp
src/modules/m_samode.cpp
src/modules/m_sanick.cpp
src/modules/m_sapart.cpp
src/modules/m_saquit.cpp
src/modules/m_sasl.cpp
src/modules/m_satopic.cpp
src/modules/m_securelist.cpp
src/modules/m_seenicks.cpp
src/modules/m_serverban.cpp
src/modules/m_services_account.cpp
src/modules/m_servprotect.cpp
src/modules/m_sethost.cpp
src/modules/m_setident.cpp
src/modules/m_setidle.cpp
src/modules/m_setname.cpp
src/modules/m_sha256.cpp
src/modules/m_showwhois.cpp
src/modules/m_shun.cpp
src/modules/m_silence.cpp
src/modules/m_spanningtree/cachetimer.cpp
src/modules/m_spanningtree/cachetimer.h
src/modules/m_spanningtree/fjoin.cpp
src/modules/m_spanningtree/handshaketimer.cpp
src/modules/m_spanningtree/handshaketimer.h
src/modules/m_spanningtree/main.cpp
src/modules/m_spanningtree/main.h
src/modules/m_spanningtree/metadata.cpp
src/modules/m_spanningtree/netburst.cpp
src/modules/m_spanningtree/privmsg.cpp
src/modules/m_spanningtree/protocolinterface.h
src/modules/m_spanningtree/resolvers.cpp
src/modules/m_spanningtree/resolvers.h
src/modules/m_spanningtree/server.cpp
src/modules/m_spanningtree/svsjoin.cpp
src/modules/m_spanningtree/treeserver.cpp
src/modules/m_spanningtree/treeserver.h
src/modules/m_spanningtree/treesocket1.cpp
src/modules/m_spanningtree/treesocket2.cpp
src/modules/m_spanningtree/uid.cpp
src/modules/m_spanningtree/utils.cpp
src/modules/m_spanningtree/utils.h
src/modules/m_spy.cpp
src/modules/m_sslinfo.cpp
src/modules/m_sslmodes.cpp
src/modules/m_stripcolor.cpp
src/modules/m_svshold.cpp
src/modules/m_swhois.cpp
src/modules/m_timedbans.cpp
src/modules/m_tline.cpp
src/modules/m_uhnames.cpp
src/modules/m_uninvite.cpp
src/modules/m_userip.cpp
src/modules/m_vhost.cpp
src/modules/m_watch.cpp
src/modules/m_xline_db.cpp
src/server.cpp
src/snomasks.cpp
src/socket.cpp
src/stats.cpp
src/testsuite.cpp
src/threadengines/threadengine_pthread.cpp
src/threadengines/threadengine_win32.cpp
src/timer.cpp
src/user_resolver.cpp
src/usermanager.cpp
src/userprocess.cpp
src/users.cpp
src/whois.cpp
src/xline.cpp
win/inspircd_namedpipe.cpp
win/inspircd_namedpipe.h
win/inspircd_win32wrapper.cpp
win/inspircd_win32wrapper.h

index 1d56decc11d2b897e2b20ab5fcc8bcef804aef06..c9c469e4f8fa4a81bdac25dea41679b5ef7e210a 100644 (file)
@@ -23,8 +23,6 @@
  */
 class CoreExport BanCacheHit : public classbase
 {
- private:
-       InspIRCd *ServerInstance;
  public:
        /** Type of cached ban
         */
@@ -39,9 +37,8 @@ class CoreExport BanCacheHit : public classbase
         */
        time_t Expiry;
 
-       BanCacheHit(InspIRCd *Instance, const std::string &ip, const std::string &type, const std::string &reason)
+       BanCacheHit(const std::string &ip, const std::string &type, const std::string &reason)
        {
-               ServerInstance = Instance;
                this->Type = type;
                this->Reason = reason;
                this->IP = ip;
@@ -49,9 +46,8 @@ class CoreExport BanCacheHit : public classbase
        }
 
        // overridden to allow custom time
-       BanCacheHit(InspIRCd *Instance, const std::string &ip, const std::string &type, const std::string &reason, time_t seconds)
+       BanCacheHit(const std::string &ip, const std::string &type, const std::string &reason, time_t seconds)
        {
-               ServerInstance = Instance;
                this->Type = type;
                this->Reason = reason;
                this->IP = ip;
@@ -74,7 +70,6 @@ class CoreExport BanCacheManager : public classbase
 {
  private:
        BanCacheHash* BanHash;
-       InspIRCd* ServerInstance;
  public:
 
        /** Creates and adds a Ban Cache item.
@@ -95,9 +90,8 @@ class CoreExport BanCacheManager : public classbase
         */
        unsigned int RemoveEntries(const std::string &type, bool positive);
 
-       BanCacheManager(InspIRCd *Instance)
+       BanCacheManager()
        {
-               this->ServerInstance = Instance;
                this->BanHash = new BanCacheHash();
        }
        ~BanCacheManager()
index 5a27dc707603193b0c607fa01e5943a44e280c04..66603575221e794e395b315606738b522c81d2d1 100644 (file)
@@ -253,30 +253,30 @@ template <typename ReturnType, typename Param1, typename Param2, typename Param3
  * parameters, to prevent mistakes.
  */
 #define DEFINE_HANDLER0(NAME, RETURN) \
-       class CoreExport NAME : public HandlerBase0<RETURN> { InspIRCd* Server; public: NAME(InspIRCd* Srv) : Server(Srv) { } virtual ~NAME() { } virtual RETURN Call(); }
+       class CoreExport NAME : public HandlerBase0<RETURN> { public: NAME() { } virtual ~NAME() { } virtual RETURN Call(); }
 
 #define DEFINE_HANDLER1(NAME, RETURN, V1) \
-       class CoreExport NAME : public HandlerBase1<RETURN, V1> { InspIRCd* Server; public: NAME(InspIRCd* Srv) : Server(Srv) { } virtual ~NAME() { } virtual RETURN Call(V1); }
+       class CoreExport NAME : public HandlerBase1<RETURN, V1> { public: NAME() { } virtual ~NAME() { } virtual RETURN Call(V1); }
 
 #define DEFINE_HANDLER2(NAME, RETURN, V1, V2) \
-       class CoreExport NAME : public HandlerBase2<RETURN, V1, V2> { InspIRCd* Server; public: NAME(InspIRCd* Srv) : Server(Srv) { } virtual ~NAME() { } virtual RETURN Call(V1, V2); }
+       class CoreExport NAME : public HandlerBase2<RETURN, V1, V2> { public: NAME() { } virtual ~NAME() { } virtual RETURN Call(V1, V2); }
 
 #define DEFINE_HANDLER3(NAME, RETURN, V1, V2, V3) \
-       class CoreExport NAME : public HandlerBase3<RETURN, V1, V2, V3> { InspIRCd* Server; public: NAME(InspIRCd* Srv) : Server(Srv) { } virtual ~NAME() { } virtual RETURN Call(V1, V2, V3); }
+       class CoreExport NAME : public HandlerBase3<RETURN, V1, V2, V3> { public: NAME() { } virtual ~NAME() { } virtual RETURN Call(V1, V2, V3); }
 
 #define DEFINE_HANDLER4(NAME, RETURN, V1, V2, V3, V4) \
-       class CoreExport NAME : public HandlerBase4<RETURN, V1, V2, V3, V4> { InspIRCd* Server; public: NAME(InspIRCd* Srv) : Server(Srv) { } virtual ~NAME() { } virtual RETURN Call(V1, V2, V3, V4); }
+       class CoreExport NAME : public HandlerBase4<RETURN, V1, V2, V3, V4> { public: NAME() { } virtual ~NAME() { } virtual RETURN Call(V1, V2, V3, V4); }
 
 #define DEFINE_HANDLER5(NAME, RETURN, V1, V2, V3, V4, V5) \
-       class CoreExport NAME : public HandlerBase5<RETURN, V1, V2, V3, V4, V5> { InspIRCd* Server; public: NAME(InspIRCd* Srv) : Server(Srv) { } virtual ~NAME() { } virtual RETURN Call(V1, V2, V3, V4, V5); }
+       class CoreExport NAME : public HandlerBase5<RETURN, V1, V2, V3, V4, V5> { public: NAME() { } virtual ~NAME() { } virtual RETURN Call(V1, V2, V3, V4, V5); }
 
 #define DEFINE_HANDLER6(NAME, RETURN, V1, V2, V3, V4, V5, V6) \
-       class CoreExport NAME : public HandlerBase6<RETURN, V1, V2, V3, V4, V5, V6> { InspIRCd* Server; public: NAME(InspIRCd* Srv) : Server(Srv) { } virtual ~NAME() { } virtual RETURN Call(V1, V2, V3, V4, V5, V6); }
+       class CoreExport NAME : public HandlerBase6<RETURN, V1, V2, V3, V4, V5, V6> { public: NAME() { } virtual ~NAME() { } virtual RETURN Call(V1, V2, V3, V4, V5, V6); }
 
 #define DEFINE_HANDLER7(NAME, RETURN, V1, V2, V3, V4, V5, V6, V7) \
-       class CoreExport NAME : public HandlerBase7<RETURN, V1, V2, V3, V4, V5, V6, V7> { InspIRCd* Server; public: NAME(InspIRCd* Srv) : Server(Srv) { } virtual ~NAME() { } virtual RETURN Call(V1, V2, V3, V4, V5, V6, V7); }
+       class CoreExport NAME : public HandlerBase7<RETURN, V1, V2, V3, V4, V5, V6, V7> { public: NAME() { } virtual ~NAME() { } virtual RETURN Call(V1, V2, V3, V4, V5, V6, V7); }
 
 #define DEFINE_HANDLER8(NAME, RETURN, V1, V2, V3, V4, V5, V6, V7, V8) \
-       class CoreExport NAME : public HandlerBase8<RETURN, V1, V2, V3, V4, V5, V6, V7, V8> { InspIRCd* Server; public: NAME(InspIRCd* Srv) : Server(Srv) { } virtual ~NAME() { } virtual RETURN Call(V1, V2, V3, V4, V5, V6, V7, V8); }
+       class CoreExport NAME : public HandlerBase8<RETURN, V1, V2, V3, V4, V5, V6, V7, V8> { public: NAME() { } virtual ~NAME() { } virtual RETURN Call(V1, V2, V3, V4, V5, V6, V7, V8); }
 
 #endif
index a4a56b63201493c63fef382219308a392862d892..94f119e63a7c89d9711ebe658cb6d7160e691569 100644 (file)
  */
 class CoreExport ChannelManager
 {
- private:
-       InspIRCd *ServerInstance;
  public:
        /** Constructor
         */
-       ChannelManager(InspIRCd *Instance) : ServerInstance(Instance)
+       ChannelManager()
        {
        }
 };
index 416a34a502dd6fa1a7299ac575236f1d822250bb..ec09cbbca237d2bdbf022cd2761e856e9654544c 100644 (file)
@@ -83,7 +83,7 @@ class CoreExport Channel : public Extensible
 {
        /** Connect a Channel to a User
         */
-       static Channel* ForceChan(InspIRCd* Instance, Channel* Ptr, User* user, const std::string &privs, bool bursting, bool created);
+       static Channel* ForceChan(Channel* Ptr, User* user, const std::string &privs, bool bursting, bool created);
 
        /** Set default modes for the channel on creation
         */
@@ -97,7 +97,7 @@ class CoreExport Channel : public Extensible
        /** Creates a channel record and initialises it with default values
         * @throw Nothing at present.
         */
-       Channel(InspIRCd* Instance, const std::string &name, time_t ts);
+       Channel(const std::string &name, time_t ts);
 
        /** The channel's name.
         */
@@ -261,7 +261,7 @@ class CoreExport Channel : public Extensible
         * been created if the channel did not exist before the user was joined to it.
         * If the user could not be joined to a channel, the return value may be NULL.
         */
-       static Channel* JoinUser(InspIRCd* ServerInstance, User *user, const char* cn, bool override, const char* key, bool bursting, time_t TS = 0);
+       static Channel* JoinUser(User *user, const char* cn, bool override, const char* key, bool bursting, time_t TS = 0);
 
        /** Write to a channel, from a user, using va_args for text
         * @param user User whos details to prefix the line with
index 7ee0e8a079ba4a79f9744f933b273c5798b4b896..10dbef58d6106072afd63983c91189bd835f716a 100644 (file)
@@ -26,10 +26,6 @@ typedef std::map<std::string, void*> SharedObjectList;
 class CoreExport CommandParser : public classbase
 {
  private:
-       /** The creator of this class
-        */
-       InspIRCd* ServerInstance;
-
        /** Parameter buffer
         */
        std::vector<std::string> para;
@@ -61,7 +57,7 @@ class CoreExport CommandParser : public classbase
        /** Default constructor.
         * @param Instance The creator of this class
         */
-       CommandParser(InspIRCd* Instance);
+       CommandParser();
 
        /** Calls the handler for a given command.
         * @param commandname The command to find. This should be in uppercase.
index 5109ab54a3cab207a04bf6714d2b2ae2b3114550..99d12cca4d770624ece9320ff9f8060fe4cb3145 100644 (file)
@@ -126,11 +126,9 @@ class WhoWasGroup : public classbase
 
 class WhoWasMaintainTimer : public Timer
 {
-  private:
-       InspIRCd* ServerInstance;
   public:
-       WhoWasMaintainTimer(InspIRCd* Instance, long interval)
-       : Timer(interval, Instance->Time(), true), ServerInstance(Instance)
+       WhoWasMaintainTimer(long interval)
+       : Timer(interval, ServerInstance->Time(), true)
        {
        }
        virtual void Tick(time_t TIME);
index 783af0942e32229450c642c103ab6399690b074c..28138edd65f537443cd31bbd2852c3cf85a3a216 100644 (file)
@@ -19,7 +19,7 @@
 /** Determines if a channel op is exempt from given mode m,
  * in config of server instance s.
  */
-#define CHANOPS_EXEMPT(s, m) (s->Config->ExemptChanOps[(unsigned char)m])
+#define CHANOPS_EXEMPT(m) (ServerInstance->Config->ExemptChanOps[(unsigned char)m])
 
 #include <sstream>
 #include <string>
@@ -122,10 +122,6 @@ class ServerLimits
 class CoreExport ServerConfig : public classbase
 {
   private:
-       /** Creator/owner pointer
-        */
-       InspIRCd* ServerInstance;
-
        /** This variable holds the names of all
         * files included from the main one. This
         * is used to make sure that no files are
@@ -172,10 +168,6 @@ class CoreExport ServerConfig : public classbase
        /** Used to indicate who we announce invites to on a channel */
        enum InviteAnnounceState { INVITE_ANNOUNCE_NONE, INVITE_ANNOUNCE_ALL, INVITE_ANNOUNCE_OPS, INVITE_ANNOUNCE_DYNAMIC };
 
-       /** Returns the creator InspIRCd pointer
-        */
-       InspIRCd* GetInstance();
-
        /** Not used any more as it is named, can probably be removed or renamed.
         */
        int DoDownloads();
@@ -582,7 +574,7 @@ class CoreExport ServerConfig : public classbase
 
        /** Construct a new ServerConfig
         */
-       ServerConfig(InspIRCd* Instance);
+       ServerConfig();
 
        /** Get server ID as string with required leading zeroes
         */
index a780505d072fff09b0f551af84b9bbe43b0e11d4..1bce4f11a2497e1fb2aae344100862126bdb2ac5 100644 (file)
@@ -184,10 +184,6 @@ enum ForceProtocol
 class CoreExport Resolver : public Extensible
 {
  protected:
-       /**
-        * Pointer to creator
-        */
-       InspIRCd* ServerInstance;
        /**
         * Pointer to creator module (if any, or NULL)
         */
@@ -255,7 +251,7 @@ class CoreExport Resolver : public Extensible
         * whilst lookups are in progress, they can be safely removed and your module will not
         * crash the server.
         */
-       Resolver(InspIRCd* Instance, const std::string &source, QueryType qt, bool &cached, Module* creator = NULL);
+       Resolver(const std::string &source, QueryType qt, bool &cached, Module* creator = NULL);
 
        /**
         * The default destructor does nothing.
@@ -312,11 +308,6 @@ class CoreExport DNS : public EventHandler
 {
  private:
 
-       /**
-        * Creator/Owner object
-        */
-       InspIRCd* ServerInstance;
-
        /**
         * The maximum value of a dns request id,
         * 16 bits wide, 0xFFFF.
@@ -447,7 +438,7 @@ class CoreExport DNS : public EventHandler
         * The constructor initialises the dns socket,
         * and clears the request lists.
         */
-       DNS(InspIRCd* Instance);
+       DNS();
 
        /**
         * Re-initialize the DNS subsystem.
index 4b8c7a4562ab39cbc9b3c9e597c18ee1dd0e362c..19ff7bdaf67f56008258a926b2efa1c62e05b8bb 100644 (file)
@@ -27,11 +27,10 @@ class CoreExport DLLManager
 
  public:
        /** This constructor loads the module using dlopen()
-        * @param ServerInstance The creator class of this object
         * @param fname The filename to load. This should be within
         * the modules dir.
         */
-       DLLManager(InspIRCd* ServerInstance, const char *fname);
+       DLLManager(const char *fname);
        virtual ~DLLManager();
 
        /** Get a symbol using dynamic linking.
@@ -102,16 +101,12 @@ template <typename ReturnType> class CoreExport DLLFactory : public DLLManager
         * The init_module function is the only exported extern "C" declaration
         * in any module file. In a cmd_*.cpp file the equivilant is init_command
         */
-       typedef ReturnType * (initfunctype) (InspIRCd*);
+       typedef ReturnType * (initfunctype) ();
 
        /** Pointer to the init function.
         */
        initfunctype* init_func;
 
-       /** Instance pointer to be passed to init_*() when it is called.
-        */
-       InspIRCd* ServerInstance;
-
  public:
        /** Default constructor.
         * This constructor passes its paramerers down through DLLFactoryBase and then DLLManager
@@ -119,8 +114,8 @@ template <typename ReturnType> class CoreExport DLLFactory : public DLLManager
         * class. It is then down to the core to call the ModuleFactory::CreateModule() method and
         * receive a Module* which it can insert into its module lists.
         */
-       DLLFactory(InspIRCd* Instance, const char *fname, const char *func_name)
-       : DLLManager(Instance, fname), init_func(NULL), ServerInstance(Instance)
+       DLLFactory(const char *fname, const char *func_name)
+       : DLLManager(fname), init_func(NULL)
        {
                const char* error = LastError();
 
@@ -144,7 +139,7 @@ template <typename ReturnType> class CoreExport DLLFactory : public DLLManager
        {
                if(init_func)
                {
-                       return init_func(ServerInstance);
+                       return init_func();
                }
                else
                {
index 60e645d6546cca5545d55982700575d531e39eea..a469710911e28b795e52784b06cffeb5a491fe9e 100644 (file)
@@ -19,7 +19,7 @@
 class CoreExport FakeUser : public User
 {
  public:
-       FakeUser(InspIRCd* Instance, const std::string &uid) : User(Instance, uid)
+       FakeUser(const std::string &uid) : User(uid)
        {
                SetFd(FD_FAKEUSER_NUMBER);
        }
index 85005940d7fdf1dbb27221739e47502a367a9233..fba103dd67d160b1df5c66c5f5a3ee5e20b3e02c 100644 (file)
@@ -38,7 +38,7 @@ class CoreExport FileLogStream : public LogStream
  private:
        FileWriter *f;
  public:
-       FileLogStream(InspIRCd *Instance, int loglevel, FileWriter *fw);
+       FileLogStream(int loglevel, FileWriter *fw);
 
        virtual ~FileLogStream();
 
index c5d849529c48887d9c51ebe9a9ca8168681bff98..6cbc14850d00b6474f4ec2752b6917f925b8fc67 100644 (file)
@@ -251,8 +251,6 @@ namespace irc
        class CoreExport modestacker : public classbase
        {
         private:
-               InspIRCd* ServerInstance;
-
                /** The mode sequence and its parameters
                 */
                std::deque<std::string> sequence;
@@ -268,7 +266,7 @@ namespace irc
                 * @param add True if the stack is adding modes,
                 * false if it is removing them
                 */
-               modestacker(InspIRCd* Instance, bool add);
+               modestacker(bool add);
 
                /** Push a modeletter and its parameter onto the stack.
                 * No checking is performed as to if this mode actually
index 4c3aba95b1cf49772219c1c090a44f34fe2c4a75..a5e40102a45e3ad62f276ef805d2830c402eaffc 100644 (file)
@@ -293,13 +293,12 @@ class BanCacheManager;
  */
 class CoreExport ConfigReaderThread : public Thread
 {
-       InspIRCd* ServerInstance;
        ServerConfig* Config;
        bool done;
  public:
        std::string TheUserUID;
-       ConfigReaderThread(InspIRCd* Instance, const std::string &useruid)
-               : Thread(), ServerInstance(Instance), done(false), TheUserUID(useruid)
+       ConfigReaderThread(const std::string &useruid)
+               : Thread(), done(false), TheUserUID(useruid)
        {
        }
 
@@ -927,7 +926,7 @@ class CommandModule : public Module
 {
        Cmd cmd;
  public:
-       CommandModule(InspIRCd*) : cmd(this)
+       CommandModule() : cmd(this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index d6bd07498d35df79bf5fae6b3d287553ff523ad7..37020a4ffb04404cdf09792ea46812545997afd7 100644 (file)
 class CoreExport FileWriter : public EventHandler
 {
  protected:
-       /** The creator/owner of this object
-        */
-       InspIRCd* ServerInstance;
-
        /** The log file (fd is inside this somewhere,
         * we get it out with fileno())
         */
@@ -45,7 +41,7 @@ class CoreExport FileWriter : public EventHandler
  public:
        /** The constructor takes an already opened logfile.
         */
-       FileWriter(InspIRCd* Instance, FILE* logfile);
+       FileWriter(FILE* logfile);
 
        /** Handle pending write events.
         * This will flush any waiting data to disk.
@@ -96,10 +92,9 @@ class CoreExport FileWriter : public EventHandler
 class CoreExport LogStream : public classbase
 {
  protected:
-       InspIRCd *ServerInstance;
        int loglvl;
  public:
-       LogStream(InspIRCd *Instance, int loglevel) : ServerInstance(Instance), loglvl(loglevel)
+       LogStream(int loglevel) : loglvl(loglevel)
        {
        }
 
@@ -133,8 +128,6 @@ class CoreExport LogManager : public classbase
         */
        LogStream* noforkstream;
 
-       InspIRCd *ServerInstance;
-
        /** Map of active log types and what LogStreams will receive them.
         */
        std::map<std::string, std::vector<LogStream *> > LogStreams;
@@ -154,10 +147,9 @@ class CoreExport LogManager : public classbase
 
  public:
 
-       LogManager(InspIRCd *Instance)
+       LogManager()
        {
                noforkstream = NULL;
-               ServerInstance = Instance;
                Logging = false;
        }
 
index c0cb5b0fc15308c21b3a137a48bc8ff878427ad7..e118a161bd10f9f6d9f2a36c33f3ea4e07a839b0 100644 (file)
@@ -348,7 +348,7 @@ class CoreExport SimpleUserModeHandler : public ModeHandler
 class CoreExport SimpleChannelModeHandler : public ModeHandler
 {
  public:
-       SimpleChannelModeHandler(InspIRCd* Instance, Module* Creator, char modeletter)
+       SimpleChannelModeHandler(Module* Creator, char modeletter)
                : ModeHandler(Creator, modeletter, PARAM_NONE, MODETYPE_CHANNEL) {}
        virtual ~SimpleChannelModeHandler() {}
        virtual ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
@@ -363,10 +363,6 @@ class CoreExport SimpleChannelModeHandler : public ModeHandler
 class CoreExport ModeWatcher : public classbase
 {
  protected:
-       /**
-        * Creator/owner pointer
-        */
-       InspIRCd* ServerInstance;
        /**
         * The mode letter this class is watching
         */
@@ -380,7 +376,7 @@ class CoreExport ModeWatcher : public classbase
        /**
         * The constructor initializes the mode and the mode type
         */
-       ModeWatcher(InspIRCd* Instance, char modeletter, ModeType type);
+       ModeWatcher(char modeletter, ModeType type);
        /**
         * The default destructor does nothing.
         */
@@ -474,7 +470,7 @@ class CoreExport ModeParser : public classbase
 
        /** The constructor initializes all the RFC basic modes by using ModeParserAddMode().
         */
-       ModeParser(InspIRCd* Instance);
+       ModeParser();
        ~ModeParser();
 
        /** Used to check if user 'd' should be allowed to do operation 'MASK' on channel 'chan'.
index 3e4683840771950f397d5b2aa0c8cae24cc8da14..0fdbaee3bd5fca44f6f32692d25e74e07721ce55 100644 (file)
@@ -23,7 +23,7 @@ class ModeChannelBan : public ModeHandler
  private:
        BanItem b;
  public:
-       ModeChannelBan(InspIRCd* Instance);
+       ModeChannelBan();
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
        std::string& AddBan(User *user,std::string& dest,Channel *chan,int status);
        std::string& DelBan(User *user,std::string& dest,Channel *chan,int status);
index dd188626c60dfca751789fda5e56dcae1e5a9b77..aea56ba32ed5fbae6a1560d1fefdd2e16502c416 100644 (file)
@@ -22,7 +22,7 @@ class ModeChannelHalfOp : public ModeHandler
 {
  private:
  public:
-       ModeChannelHalfOp(InspIRCd* Instance);
+       ModeChannelHalfOp();
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
        ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string &parameter);
        unsigned int GetPrefixRank();
index 486ee0e1a7fe0d4841fe397461641ca11b5d2763..74495869a77d1fd286b2884c952edd77dc5c0e2d 100644 (file)
@@ -20,6 +20,6 @@ class InspIRCd;
 class ModeChannelInviteOnly : public SimpleChannelModeHandler
 {
  public:
-       ModeChannelInviteOnly(InspIRCd* Instance);
+       ModeChannelInviteOnly();
 };
 
index a84adff5f6d306d9301d74da9fe10212dd649223..bb35979234a1dbc2f7fccba52bb0aa6e1bbe1e7d 100644 (file)
@@ -20,7 +20,7 @@ class InspIRCd;
 class ModeChannelKey : public ModeHandler
 {
  public:
-       ModeChannelKey(InspIRCd* Instance);
+       ModeChannelKey();
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
        ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string &parameter);
        void RemoveMode(Channel* channel, irc::modestacker* stack = NULL);
index a2f1030a28c33176dea0fdec2a0307ab1e86b1f3..94313ec52d08ba3c1f751d349d6af1e7c86f7e78 100644 (file)
@@ -20,7 +20,7 @@ class InspIRCd;
 class ModeChannelLimit : public ModeHandler
 {
  public:
-       ModeChannelLimit(InspIRCd* Instance);
+       ModeChannelLimit();
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
        ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string &parameter);
        bool CheckTimeStamp(std::string &their_param, const std::string &our_param, Channel* channel);
index 6435b833bfab7fc6c68be759e1c3c375fabfbac5..c36e283559fa39dc50518827a396cf627f03395c 100644 (file)
@@ -20,5 +20,5 @@ class InspIRCd;
 class ModeChannelModerated : public SimpleChannelModeHandler
 {
  public:
-       ModeChannelModerated(InspIRCd* Instance);
+       ModeChannelModerated();
 };
index 20a0631fc964283738a341d556b9a85943ea7ee7..70ccfdf9a52bf51e6f6d2c87a44e8666be90b2c8 100644 (file)
@@ -20,5 +20,5 @@ class InspIRCd;
 class ModeChannelNoExternal : public SimpleChannelModeHandler
 {
  public:
-       ModeChannelNoExternal(InspIRCd* Instance);
+       ModeChannelNoExternal();
 };
index 60772eb5fbf1b06133744bcee0920410521c0250..524d254ee38bf2061326f3cd773755934a963188 100644 (file)
@@ -22,7 +22,7 @@ class ModeChannelOp : public ModeHandler
 {
  private:
  public:
-       ModeChannelOp(InspIRCd* Instance);
+       ModeChannelOp();
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
        ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string &parameter);
        unsigned int GetPrefixRank();
index c00a9f1d3db85e87bf02fedeb40373d873cd31d0..64a4c0b3f0f5e74e0a11bcb536d333e826f43e62 100644 (file)
@@ -20,5 +20,5 @@ class InspIRCd;
 class ModeChannelPrivate : public SimpleChannelModeHandler
 {
  public:
-       ModeChannelPrivate(InspIRCd* Instance);
+       ModeChannelPrivate();
 };
index 7d428c9a9e2afa6bda5d746bce2a02662f6a2065..2f03371272f95df19a71a9d8d1c30f2403ca789b 100644 (file)
@@ -20,5 +20,5 @@ class InspIRCd;
 class ModeChannelSecret : public SimpleChannelModeHandler
 {
  public:
-       ModeChannelSecret(InspIRCd* Instance);
+       ModeChannelSecret();
 };
index b7f87e614798b7cdabe02c9a00ca8ed388736033..6d0ce47778f5b09998c11c0883bdfceca54e47fa 100644 (file)
@@ -20,6 +20,6 @@ class InspIRCd;
 class ModeChannelTopicOps : public ModeHandler
 {
  public:
-       ModeChannelTopicOps(InspIRCd* Instance);
+       ModeChannelTopicOps();
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
 };
index 26304d64d092cbe3be84aba5b601f1ad03f952ef..77e8562f293f2e597b2ea25b1c394aed24e6abaf 100644 (file)
@@ -22,7 +22,7 @@ class ModeChannelVoice : public ModeHandler
 {
  private:
  public:
-       ModeChannelVoice(InspIRCd* Instance);
+       ModeChannelVoice();
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
        ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string &parameter);
        unsigned int GetPrefixRank();
index 864547d513ca49a2ab955147b17154395e044ba3..58ec2d4caa4b566fed509cbcac5bfddc9df7fa8b 100644 (file)
@@ -20,6 +20,6 @@ class InspIRCd;
 class ModeUserInvisible : public SimpleUserModeHandler
 {
  public:
-       ModeUserInvisible(InspIRCd* Instance);
+       ModeUserInvisible();
        unsigned int GetCount();
 };
index 9a3439ba7d0486370e535eb6f5cee3952dce28d8..a58c55670ca50adcea2cdcee642edb02f8565174 100644 (file)
@@ -20,7 +20,7 @@ class InspIRCd;
 class ModeUserOperator : public ModeHandler
 {
  public:
-       ModeUserOperator(InspIRCd* Instance);
+       ModeUserOperator();
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
        unsigned int GetCount();
 };
index ac85050f8205a2bc09bfd397c976a15776cc8d6e..d36c46deb36363bc087affb89fc52462185cd156 100644 (file)
@@ -20,7 +20,7 @@ class InspIRCd;
 class ModeUserServerNoticeMask : public ModeHandler
 {
  public:
-       ModeUserServerNoticeMask(InspIRCd* Instance);
+       ModeUserServerNoticeMask();
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
        void OnParameterMissing(User* user, User* dest, Channel* channel);
        std::string GetUserParameter(User* user);
index 566753ba0b6c207581f9e9ecf8896186bc732428..ddda3db83c4410c4b02e69b3488dce04cd573017 100644 (file)
@@ -20,6 +20,6 @@ class InspIRCd;
 class ModeUserWallops : public SimpleUserModeHandler
 {
  public:
-       ModeUserWallops(InspIRCd* Instance);
+       ModeUserWallops();
        unsigned int GetCount();
 };
index 8ae1aa8e10db37644d1414830b7ea3c0066db8e7..d4c54973070381b332d733c30a3d842fa4345de7 100644 (file)
@@ -157,40 +157,16 @@ typedef std::map<std::string, std::pair<int, modulelist> > interfacelist;
        } \
 } while (0);
 
-/**
- * This #define allows us to call a method in all
- * loaded modules in a readable simple way and pass
- * an instance pointer to the macro. e.g.:
- * 'FOREACH_MOD_I(Instance, OnConnect, OnConnect(user));'
- */
-#define FOREACH_MOD_I(z,y,x) do { \
-       EventHandlerIter safei; \
-       for (EventHandlerIter _i = z->Modules->EventHandlers[y].begin(); _i != z->Modules->EventHandlers[y].end(); ) \
-       { \
-               safei = _i; \
-               ++safei; \
-               try \
-               { \
-                       (*_i)->x ; \
-               } \
-               catch (CoreException& modexcept) \
-               { \
-                       z->Logs->Log("MODULE",DEFAULT,"Exception caught: %s",modexcept.GetReason()); \
-               } \
-               _i = safei; \
-       } \
-} while (0);
-
 /**
  * Custom module result handling loop. This is a paired macro, and should only
  * be used with while_each_hook.
  *
  * See src/channels.cpp for an example of use.
  */
-#define DO_EACH_HOOK(z,n,v,args) \
+#define DO_EACH_HOOK(n,v,args) \
 do { \
-       EventHandlerIter iter_ ## n = z->Modules->EventHandlers[I_ ## n].begin(); \
-       while (iter_ ## n != z->Modules->EventHandlers[I_ ## n].end()) \
+       EventHandlerIter iter_ ## n = ServerInstance->Modules->EventHandlers[I_ ## n].begin(); \
+       while (iter_ ## n != ServerInstance->Modules->EventHandlers[I_ ## n].end()) \
        { \
                Module* mod_ ## n = *iter_ ## n; \
                iter_ ## n ++; \
@@ -198,11 +174,11 @@ do { \
                { \
                        v = (mod_ ## n)->n args;
 
-#define WHILE_EACH_HOOK(z,n) \
+#define WHILE_EACH_HOOK(n) \
                } \
                catch (CoreException& except_ ## n) \
                { \
-                       z->Logs->Log("MODULE",DEFAULT,"Exception caught: %s", (except_ ## n).GetReason()); \
+                       ServerInstance->Logs->Log("MODULE",DEFAULT,"Exception caught: %s", (except_ ## n).GetReason()); \
                        (void) mod_ ## n; /* catch mismatched pairs */ \
                } \
        } \
@@ -213,16 +189,16 @@ do { \
  * Runs the given hook until some module returns a useful result.
  *
  * Example: ModResult result;
- * FIRST_MOD_RESULT(ServerInstance, OnUserPreNick, result, (user, newnick))
+ * FIRST_MOD_RESULT(OnUserPreNick, result, (user, newnick))
  */
-#define FIRST_MOD_RESULT(z,n,v,args) do { \
+#define FIRST_MOD_RESULT(n,v,args) do { \
        v = MOD_RES_PASSTHRU; \
-       DO_EACH_HOOK(z,n,v,args) \
+       DO_EACH_HOOK(n,v,args) \
        { \
                if (v != MOD_RES_PASSTHRU) \
                        break; \
        } \
-       WHILE_EACH_HOOK(z,n); \
+       WHILE_EACH_HOOK(n); \
 } while (0)
 
 /** Represents a non-local user.
@@ -387,7 +363,7 @@ class CoreExport Event : public ModuleMessage
         * The return result of an Event::Send() will always be NULL as
         * no replies are expected.
         */
-       char* Send(InspIRCd* ServerInstance);
+       char* Send();
 };
 
 /** Priority types which can be returned from Module::Prioritize()
@@ -437,7 +413,7 @@ class CoreExport Module : public Extensible
         * @param Me An instance of the InspIRCd class which will be saved into ServerInstance for your use
         * \exception ModuleException Throwing this class, or any class derived from ModuleException, causes loading of the module to abort.
         */
-       Module(InspIRCd* Me = ServerInstance);
+       Module();
 
        /** Default destructor.
         * destroys a module class
@@ -1392,7 +1368,7 @@ class CoreExport ConfigReader : public classbase
         * This constructor initialises the ConfigReader class to read the inspircd.conf file
         * as specified when running ./configure.
         */
-       ConfigReader(InspIRCd* Instance = ServerInstance);
+       ConfigReader();
        /** Default destructor.
         * This method destroys the ConfigReader class.
         */
@@ -1491,14 +1467,14 @@ class CoreExport FileReader : public classbase
         * This method does not load any file into memory, you must use the LoadFile method
         * after constructing the class this way.
         */
-       FileReader(InspIRCd* Instance = ServerInstance);
+       FileReader();
 
        /** Secondary constructor.
         * This method initialises the class with a file loaded into it ready for GetLine and
         * and other methods to be called. If the file could not be loaded, FileReader::FileSize
         * returns 0.
         */
-       FileReader(InspIRCd* Instance, const std::string &filename);
+       FileReader(const std::string &filename);
 
        /** Default destructor.
         * This deletes the memory allocated to the file.
@@ -1827,9 +1803,9 @@ class CoreExport ModuleManager : public classbase
 #ifdef WINDOWS
 
 #define MODULE_INIT(y) \
-       extern "C" DllExport Module * init_module(InspIRCd* Me) \
+       extern "C" DllExport Module * init_module() \
        { \
-               return new y(Me); \
+               return new y; \
        } \
        BOOLEAN WINAPI DllMain(HINSTANCE hDllHandle, DWORD nReason, LPVOID Reserved) \
        { \
@@ -1845,9 +1821,9 @@ class CoreExport ModuleManager : public classbase
 #else
 
 #define MODULE_INIT(y) \
-       extern "C" DllExport Module * init_module(InspIRCd* Me) \
+       extern "C" DllExport Module * init_module() \
        { \
-               return new y(Me); \
+               return new y; \
        }
 #endif
 
index bd437c76f03082ac7f60137a7efbe9abe5fee9a7..a3afe9fb37f37da3066ea1e2481afc352abba425 100644 (file)
@@ -16,7 +16,6 @@
 
 #include "hashcomp.h"
 
-class InspIRCd;
 class User;
 
 typedef std::vector<std::string> parameterlist;
@@ -36,10 +35,8 @@ typedef std::list<ProtoServer> ProtoServerList;
 
 class ProtocolInterface : public Extensible
 {
- protected:
-       InspIRCd* ServerInstance;
  public:
-       ProtocolInterface(InspIRCd* Instance) : ServerInstance(Instance) { }
+       ProtocolInterface() { }
        virtual ~ProtocolInterface() { }
 
        /** Send an ENCAP message to one or more linked servers.
index c35fc92b7235d5ef5534ea6621c9efcfd9d7b758..dddde1ff9095339ce74d46d0d7a6343d02b1fd67 100644 (file)
@@ -16,9 +16,6 @@
 
 class Snomask : public Extensible
 {
- private:
-       InspIRCd *ServerInstance;
-
  public:
        char MySnomask;
        std::string Description;
@@ -28,7 +25,7 @@ class Snomask : public Extensible
 
        /** Create a new Snomask
         */
-       Snomask(InspIRCd* Instance, char snomask, const std::string &description) : ServerInstance(Instance), MySnomask(snomask), Description(description), LastMessage(""), Count(0)
+       Snomask(char snomask, const std::string &description) : MySnomask(snomask), Description(description), LastMessage(""), Count(0)
        {
        }
 
@@ -52,10 +49,6 @@ typedef std::map<char, Snomask *> SnoList;
 class CoreExport SnomaskManager
 {
  private:
-       /** Creator/owner
-        */
-       InspIRCd* ServerInstance;
-
        /** Currently active snomask list
         */
        SnoList SnoMasks;
@@ -66,7 +59,7 @@ class CoreExport SnomaskManager
  public:
        /** Create a new SnomaskManager
         */
-       SnomaskManager(InspIRCd* Instance);
+       SnomaskManager();
 
        /** Delete SnomaskManager
         */
index af3eccea2a94b1e90c65fc92f04bb338a929b797..6e4bf9dbdc11331bfcdd34b5f3c41c2b4d93d48f 100644 (file)
@@ -133,9 +133,6 @@ namespace irc
 class CoreExport ListenSocketBase : public EventHandler
 {
  protected:
-       /** The creator/owner of this object
-        */
-       InspIRCd* ServerInstance;
        /** Socket description (shown in stats p) */
        std::string desc;
 
@@ -160,7 +157,7 @@ class CoreExport ListenSocketBase : public EventHandler
  public:
        /** Create a new listening socket
         */
-       ListenSocketBase(InspIRCd* Instance, int port, const std::string &addr);
+       ListenSocketBase(int port, const std::string &addr);
        /** Handle an I/O event
         */
        void HandleEvent(EventType et, int errornum = 0);
@@ -200,7 +197,7 @@ class CoreExport ClientListenSocket : public ListenSocketBase
 {
        virtual void OnAcceptReady(int fd);
  public:
-       ClientListenSocket(InspIRCd* Instance, int port, const std::string &addr) : ListenSocketBase(Instance, port, addr) { }
+       ClientListenSocket(int port, const std::string &addr) : ListenSocketBase(port, addr) { }
 };
 
 #endif
index 384f1b438b51c02a75453b95b21a312180d24fe7..89318e32f82d22a51a793c4e51ce55e0e58f3cad 100644 (file)
 #ifndef __TESTSUITE_H__
 #define __TESTSUITE_H__
 
-class InspIRCd;
-
 class TestSuite : public Extensible
 {
- private:
-       InspIRCd* ServerInstance;
  public:
-       TestSuite(InspIRCd* Instance);
+       TestSuite();
        ~TestSuite();
 
        bool DoThreadTests();
index 10f3fed13b5fa6684397f105deace4386244e65e..41e3fc68612cfe42a5270187ff416cd9d6d2a653 100644 (file)
@@ -134,7 +134,7 @@ class CoreExport SocketThread : public Thread
         */
        void NotifyParent();
  public:
-       SocketThread(InspIRCd* SI);
+       SocketThread();
        virtual ~SocketThread();
        /** Lock queue.
         */
index 79b00e62935428c9ee243b9b69b39b3b04981777..4952ea3e8782369c87713c7c28d4040398bc8768 100644 (file)
@@ -18,7 +18,6 @@
 #include "inspircd_config.h"
 #include "base.h"
 
-class InspIRCd;
 class Thread;
 
 /** The ThreadEngine class has the responsibility of initialising
@@ -38,7 +37,7 @@ class CoreExport ThreadEngine
        /** Constructor.
         * @param Instance Creator object
         */
-       ThreadEngine(InspIRCd* Instance);
+       ThreadEngine();
 
        /** Destructor
         */
index 64ad87ab879d43c2c19b2c2c88d26a0b32513d85..a88a0c815b84c633e615c0c9b3e1ca7c0c3790bf 100644 (file)
@@ -17,7 +17,6 @@
 #include "inspircd_config.h"
 #include "base.h"
 
-class InspIRCd;
 class Thread;
 
 /** The ThreadEngine class has the responsibility of initialising
@@ -34,7 +33,7 @@ class CoreExport ThreadEngine
 {
  public:
 
-       ThreadEngine(InspIRCd* Instance);
+       ThreadEngine();
 
        virtual ~ThreadEngine();
 
index 9c46b4f819674e92a78fb41e0d018fb77e0e2623..cc5364f672f5bd84cfca8c72c46b0c0bcdf7f657 100644 (file)
@@ -14,8 +14,6 @@
 #ifndef INSPIRCD_TIMER_H
 #define INSPIRCD_TIMER_H
 
-//class InspIRCd;
-
 /** Timer class for one-second resolution timers
  * Timer provides a facility which allows module
  * developers to create one-shot timers. The timer
@@ -118,13 +116,10 @@ class CoreExport TimerManager
         */
        std::vector<Timer *> Timers;
 
-       /** Creating server instance
-        */
-       InspIRCd* ServerInstance;
  public:
        /** Constructor
         */
-       TimerManager(InspIRCd* Instance);
+       TimerManager();
        ~TimerManager();
 
        /** Tick all pending Timers
index 4b8ffe9e07f6d0685141b016a3e6d81cc473bd81..cb211c9be1f543a527f767b327fe2219f5af65db 100644 (file)
 
 /** Get the time as a string
  */
-inline std::string stringtime(InspIRCd* Instance)
+inline std::string stringtime()
 {
        std::ostringstream TIME;
-       TIME << Instance->Time();
+       TIME << ServerInstance->Time();
        return TIME.str();
 }
 
@@ -141,7 +141,7 @@ class ListModeBase : public ModeHandler
         * @param autotidy Automatically tidy list entries on add
         * @param ctag Configuration tag to get limits from
         */
-       ListModeBase(InspIRCd* Instance, Module* Creator, char modechar, const std::string &eolstr, unsigned int lnum, unsigned int eolnum, bool autotidy, const std::string &ctag = "banlist")
+       ListModeBase(Module* Creator, char modechar, const std::string &eolstr, unsigned int lnum, unsigned int eolnum, bool autotidy, const std::string &ctag = "banlist")
                : ModeHandler(Creator, modechar, PARAM_ALWAYS, MODETYPE_CHANNEL), 
                listnumeric(lnum), endoflistnumeric(eolnum), endofliststring(eolstr), tidy(autotidy),
                configtag(ctag), extItem("listbase_mode_" + std::string(1, mode) + "_list", Creator)
@@ -200,7 +200,7 @@ class ListModeBase : public ModeHandler
                modelist* el = extItem.get(channel);
                if (el)
                {
-                       irc::modestacker modestack(ServerInstance, false);
+                       irc::modestacker modestack(false);
 
                        for (modelist::iterator it = el->begin(); it != el->end(); it++)
                        {
@@ -235,7 +235,7 @@ class ListModeBase : public ModeHandler
         */
        virtual void DoRehash()
        {
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
 
                chanlimits.clear();
 
@@ -327,7 +327,7 @@ class ListModeBase : public ModeHandler
                                                        ListItem e;
                                                        e.mask = parameter;
                                                        e.nick = source->nick;
-                                                       e.time = stringtime(ServerInstance);
+                                                       e.time = stringtime();
 
                                                        el->push_back(e);
                                                        return MODEACTION_ALLOW;
@@ -392,7 +392,7 @@ class ListModeBase : public ModeHandler
        virtual void DoSyncChannel(Channel* chan, Module* proto, void* opaque)
        {
                modelist* mlist = extItem.get(chan);
-               irc::modestacker modestack(ServerInstance, true);
+               irc::modestacker modestack(true);
                std::vector<std::string> stackresult;
                std::vector<TranslateType> types;
                types.push_back(TR_TEXT);
index 72b10b224dc538bfc4de3f2fee1cfca18b4f90ab..93f0476e3c8daccc9008f6e40807d1cccfcb254d 100644 (file)
@@ -22,16 +22,10 @@ typedef std::map<irc::string, unsigned int> clonemap;
 class CoreExport UserManager : public Extensible
 {
  private:
-       InspIRCd *ServerInstance;
-
        /** Map of local ip addresses for clone counting
         */
        clonemap local_clones;
  public:
-       UserManager(InspIRCd *Instance) : ServerInstance(Instance)
-       {
-       }
-
        ~UserManager()
        {
                for (user_hash::iterator i = clientlist->begin();i != clientlist->end();i++)
@@ -80,7 +74,7 @@ class CoreExport UserManager : public Extensible
         * @param server The server IP address and port used by the user
         * @return This function has no return value, but a call to AddClient may remove the user.
         */
-       void AddUser(InspIRCd* Instance, int socket, ClientListenSocket* via, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* server);
+       void AddUser(int socket, ClientListenSocket* via, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* server);
 
        /** Disconnect a user gracefully
         * @param user The user to remove
index 7ec35535f919c362db788436b6d05c624423229e..763d45c57d3ce2105a597184054e76bb559faef9 100644 (file)
@@ -470,7 +470,7 @@ class CoreExport User : public StreamSocket
         * @param Instance Creator instance
         * @param uid User UUID, or empty to allocate one automatically
         */
-       User(InspIRCd* Instance, const std::string &uid = "");
+       User(const std::string &uid = "");
 
        /** Check if the user matches a G or K line, and disconnect them if they do.
         * @param doZline True if ZLines should be checked (if IP has changed since initial connect)
@@ -880,7 +880,7 @@ class CoreExport UserResolver : public Resolver
         * @param qt The query type
         * @param cache Modified by the constructor if the result was cached
         */
-       UserResolver(InspIRCd* Instance, User* user, std::string to_resolve, QueryType qt, bool &cache);
+       UserResolver(User* user, std::string to_resolve, QueryType qt, bool &cache);
 
        /** Called on successful lookup
         * @param result Result string
index e2915e0247382a9a46e0997154964ae7bfd08b19..7ac4aa7f1944eb533933dd1d67ce1902ea7b911e 100644 (file)
@@ -29,9 +29,6 @@ class CoreExport XLine : public classbase
 {
  protected:
 
-       /** Creator */
-       InspIRCd* ServerInstance;
-
        /** Default 'apply' action. Quits the user.
         * @param u User to apply the line against
         * @param line The line typed, used for display purposes in the quit message
@@ -48,8 +45,8 @@ class CoreExport XLine : public classbase
         * @param re The reason of the xline
         * @param t The line type, should be set by the derived class constructor
         */
-       XLine(InspIRCd* Instance, time_t s_time, long d, std::string src, std::string re, const std::string &t)
-               : ServerInstance(Instance), set_time(s_time), duration(d), source(src), reason(re), type(t)
+       XLine(time_t s_time, long d, std::string src, std::string re, const std::string &t)
+               : set_time(s_time), duration(d), source(src), reason(re), type(t)
        {
                expiry = set_time + duration;
        }
@@ -156,8 +153,8 @@ class CoreExport KLine : public XLine
         * @param ident Ident to match
         * @param host Host to match
         */
-       KLine(InspIRCd* Instance, time_t s_time, long d, std::string src, std::string re, std::string ident, std::string host)
-               : XLine(Instance, s_time, d, src, re, "K"), identmask(ident), hostmask(host)
+       KLine(time_t s_time, long d, std::string src, std::string re, std::string ident, std::string host)
+               : XLine(s_time, d, src, re, "K"), identmask(ident), hostmask(host)
        {
                matchtext = this->identmask;
                matchtext.append("@").append(this->hostmask);
@@ -204,8 +201,8 @@ class CoreExport GLine : public XLine
         * @param ident Ident to match
         * @param host Host to match
         */
-       GLine(InspIRCd* Instance, time_t s_time, long d, std::string src, std::string re, std::string ident, std::string host)
-               : XLine(Instance, s_time, d, src, re, "G"), identmask(ident), hostmask(host)
+       GLine(time_t s_time, long d, std::string src, std::string re, std::string ident, std::string host)
+               : XLine(s_time, d, src, re, "G"), identmask(ident), hostmask(host)
        {
                matchtext = this->identmask;
                matchtext.append("@").append(this->hostmask);
@@ -250,8 +247,8 @@ class CoreExport ELine : public XLine
         * @param ident Ident to match
         * @param host Host to match
         */
-       ELine(InspIRCd* Instance, time_t s_time, long d, std::string src, std::string re, std::string ident, std::string host)
-               : XLine(Instance, s_time, d, src, re, "E"), identmask(ident), hostmask(host)
+       ELine(time_t s_time, long d, std::string src, std::string re, std::string ident, std::string host)
+               : XLine(s_time, d, src, re, "E"), identmask(ident), hostmask(host)
        {
                matchtext = this->identmask;
                matchtext.append("@").append(this->hostmask);
@@ -295,8 +292,8 @@ class CoreExport ZLine : public XLine
         * @param re The reason of the xline
         * @param ip IP to match
         */
-       ZLine(InspIRCd* Instance, time_t s_time, long d, std::string src, std::string re, std::string ip)
-               : XLine(Instance, s_time, d, src, re, "Z"), ipaddr(ip)
+       ZLine(time_t s_time, long d, std::string src, std::string re, std::string ip)
+               : XLine(s_time, d, src, re, "Z"), ipaddr(ip)
        {
        }
 
@@ -333,8 +330,8 @@ class CoreExport QLine : public XLine
         * @param re The reason of the xline
         * @param nickname Nickname to match
         */
-       QLine(InspIRCd* Instance, time_t s_time, long d, std::string src, std::string re, std::string nickname)
-               : XLine(Instance, s_time, d, src, re, "Q"), nick(nickname)
+       QLine(time_t s_time, long d, std::string src, std::string re, std::string nickname)
+               : XLine(s_time, d, src, re, "Q"), nick(nickname)
        {
        }
 
@@ -373,7 +370,6 @@ class CoreExport XLineFactory : public classbase
 {
  protected:
 
-       InspIRCd* ServerInstance;
        std::string type;
 
  public:
@@ -382,7 +378,7 @@ class CoreExport XLineFactory : public classbase
         * @param Instance creator
         * @param t Type of XLine this factory generates
         */
-       XLineFactory(InspIRCd* Instance, const std::string &t) : ServerInstance(Instance), type(t) { }
+       XLineFactory(const std::string &t) : type(t) { }
 
        /** Return the type of XLine this factory generates
         * @return The type of XLine this factory generates
@@ -409,7 +405,6 @@ class CoreExport XLineFactory : public classbase
 /* Required forward declarations
  */
 class ServerConfig;
-class InspIRCd;
 
 class GLineFactory;
 class ELineFactory;
@@ -444,10 +439,6 @@ typedef XLineLookup::iterator LookupIter;
 class CoreExport XLineManager : public classbase
 {
  protected:
-       /** The owner/creator of this class
-        */
-       InspIRCd* ServerInstance;
-
        /** Used to hold XLines which have not yet been applied.
         */
        std::vector<XLine *> pending_lines;
@@ -478,7 +469,7 @@ class CoreExport XLineManager : public classbase
        /** Constructor
         * @param Instance A pointer to the creator object
         */
-       XLineManager(InspIRCd* Instance);
+       XLineManager();
 
        /** Destructor
         */
@@ -591,14 +582,14 @@ class CoreExport XLineManager : public classbase
 class CoreExport GLineFactory : public XLineFactory
 {
  public:
-       GLineFactory(InspIRCd* Instance) : XLineFactory(Instance, "G") { }
+       GLineFactory() : XLineFactory("G") { }
 
        /** Generate a GLine
         */
        XLine* Generate(time_t set_time, long duration, std::string source, std::string reason, std::string xline_specific_mask)
        {
                IdentHostPair ih = ServerInstance->XLines->IdentSplit(xline_specific_mask);
-               return new GLine(ServerInstance, set_time, duration, source, reason, ih.first, ih.second);
+               return new GLine(set_time, duration, source, reason, ih.first, ih.second);
        }
 };
 
@@ -607,14 +598,14 @@ class CoreExport GLineFactory : public XLineFactory
 class CoreExport ELineFactory : public XLineFactory
 {
  public:
-       ELineFactory(InspIRCd* Instance) : XLineFactory(Instance, "E") { }
+       ELineFactory() : XLineFactory("E") { }
 
        /** Generate an ELine
         */
        XLine* Generate(time_t set_time, long duration, std::string source, std::string reason, std::string xline_specific_mask)
        {
                IdentHostPair ih = ServerInstance->XLines->IdentSplit(xline_specific_mask);
-               return new ELine(ServerInstance, set_time, duration, source, reason, ih.first, ih.second);
+               return new ELine(set_time, duration, source, reason, ih.first, ih.second);
        }
 };
 
@@ -623,14 +614,14 @@ class CoreExport ELineFactory : public XLineFactory
 class CoreExport KLineFactory : public XLineFactory
 {
  public:
-        KLineFactory(InspIRCd* Instance) : XLineFactory(Instance, "K") { }
+        KLineFactory() : XLineFactory("K") { }
 
        /** Generate a KLine
         */
         XLine* Generate(time_t set_time, long duration, std::string source, std::string reason, std::string xline_specific_mask)
         {
                 IdentHostPair ih = ServerInstance->XLines->IdentSplit(xline_specific_mask);
-                return new KLine(ServerInstance, set_time, duration, source, reason, ih.first, ih.second);
+                return new KLine(set_time, duration, source, reason, ih.first, ih.second);
         }
 };
 
@@ -639,13 +630,13 @@ class CoreExport KLineFactory : public XLineFactory
 class CoreExport QLineFactory : public XLineFactory
 {
  public:
-        QLineFactory(InspIRCd* Instance) : XLineFactory(Instance, "Q") { }
+        QLineFactory() : XLineFactory("Q") { }
 
        /** Generate a QLine
         */
         XLine* Generate(time_t set_time, long duration, std::string source, std::string reason, std::string xline_specific_mask)
         {
-                return new QLine(ServerInstance, set_time, duration, source, reason, xline_specific_mask);
+                return new QLine(set_time, duration, source, reason, xline_specific_mask);
         }
 };
 
@@ -654,13 +645,13 @@ class CoreExport QLineFactory : public XLineFactory
 class CoreExport ZLineFactory : public XLineFactory
 {
  public:
-        ZLineFactory(InspIRCd* Instance) : XLineFactory(Instance, "Z") { }
+        ZLineFactory() : XLineFactory("Z") { }
 
        /** Generate a ZLine
         */
         XLine* Generate(time_t set_time, long duration, std::string source, std::string reason, std::string xline_specific_mask)
         {
-                return new ZLine(ServerInstance, set_time, duration, source, reason, xline_specific_mask);
+                return new ZLine(set_time, duration, source, reason, xline_specific_mask);
         }
 };
 
index 524baaad2e4805471a53ccf1030259c8c4ce8113..0ca2d693f1030f470cbb9ed2f9945ce10ba82d79 100644 (file)
@@ -23,7 +23,7 @@ BanCacheHit *BanCacheManager::AddHit(const std::string &ip, const std::string &t
        if (this->BanHash->find(ip) != this->BanHash->end()) // can't have two cache entries on the same IP, sorry..
                return NULL;
 
-       b = new BanCacheHit(ServerInstance, ip, type, reason);
+       b = new BanCacheHit(ip, type, reason);
 
        this->BanHash->insert(std::make_pair(ip, b));
        return b;
@@ -36,7 +36,7 @@ BanCacheHit *BanCacheManager::AddHit(const std::string &ip, const std::string &t
        if (this->BanHash->find(ip) != this->BanHash->end()) // can't have two cache entries on the same IP, sorry..
                return NULL;
 
-       b = new BanCacheHit(ServerInstance, ip, type, reason, seconds);
+       b = new BanCacheHit(ip, type, reason, seconds);
 
        this->BanHash->insert(std::make_pair(ip, b));
        return b;
index c60ec28905d9c910b4a4960ce8d73c8f56dc2e68..1375ffa30e80233ef345a2ef648bdda6a97880e8 100644 (file)
 #include <cstdarg>
 #include "mode.h"
 
-Channel::Channel(InspIRCd* Instance, const std::string &cname, time_t ts)
+Channel::Channel(const std::string &cname, time_t ts)
 {
        chan_hash::iterator findchan = ServerInstance->chanlist->find(cname);
-       if (findchan != Instance->chanlist->end())
+       if (findchan != ServerInstance->chanlist->end())
                throw CoreException("Cannot create duplicate channel " + cname);
 
        (*(ServerInstance->chanlist))[cname.c_str()] = this;
@@ -70,7 +70,7 @@ int Channel::SetTopic(User *u, std::string &ntopic, bool forceset)
                        ModResult res;
                        /* 0: check status, 1: don't, -1: disallow change silently */
 
-                       FIRST_MOD_RESULT(ServerInstance, OnPreTopicChange, res, (u,this,ntopic));
+                       FIRST_MOD_RESULT(OnPreTopicChange, res, (u,this,ntopic));
 
                        if (res == MOD_RES_DENY)
                                return CMD_FAILURE;
@@ -184,7 +184,7 @@ void Channel::SetDefaultModes()
  * add a channel to a user, creating the record for it if needed and linking
  * it to the user record
  */
-Channel* Channel::JoinUser(InspIRCd* Instance, User *user, const char* cn, bool override, const char* key, bool bursting, time_t TS)
+Channel* Channel::JoinUser(User *user, const char* cn, bool override, const char* key, bool bursting, time_t TS)
 {
        // Fix: unregistered users could be joined using /SAJOIN
        if (!user || !cn || user->registered != REG_ALL)
@@ -207,7 +207,7 @@ Channel* Channel::JoinUser(InspIRCd* Instance, User *user, const char* cn, bool
                {
                        if (user->HasPrivPermission("channels/high-join-limit"))
                        {
-                               if (user->chans.size() >= Instance->Config->OperMaxChans)
+                               if (user->chans.size() >= ServerInstance->Config->OperMaxChans)
                                {
                                        user->WriteNumeric(ERR_TOOMANYCHANNELS, "%s %s :You are on too many channels",user->nick.c_str(), cn);
                                        return NULL;
@@ -224,8 +224,8 @@ Channel* Channel::JoinUser(InspIRCd* Instance, User *user, const char* cn, bool
                }
        }
 
-       strlcpy(cname, cn, Instance->Config->Limits.ChanMax);
-       Ptr = Instance->FindChan(cname);
+       strlcpy(cname, cn, ServerInstance->Config->Limits.ChanMax);
+       Ptr = ServerInstance->FindChan(cname);
        bool created_by_local = false;
 
        if (!Ptr)
@@ -236,7 +236,7 @@ Channel* Channel::JoinUser(InspIRCd* Instance, User *user, const char* cn, bool
                if (!IS_LOCAL(user))
                {
                        if (!TS)
-                               Instance->Logs->Log("CHANNEL",DEBUG,"*** BUG *** Channel::JoinUser called for REMOTE user '%s' on channel '%s' but no TS given!", user->nick.c_str(), cn);
+                               ServerInstance->Logs->Log("CHANNEL",DEBUG,"*** BUG *** Channel::JoinUser called for REMOTE user '%s' on channel '%s' but no TS given!", user->nick.c_str(), cn);
                }
                else
                {
@@ -247,12 +247,12 @@ Channel* Channel::JoinUser(InspIRCd* Instance, User *user, const char* cn, bool
                if (IS_LOCAL(user) && override == false)
                {
                        ModResult MOD_RESULT;
-                       FIRST_MOD_RESULT(Instance, OnUserPreJoin, MOD_RESULT, (user, NULL, cname, privs, key ? key : ""));
+                       FIRST_MOD_RESULT(OnUserPreJoin, MOD_RESULT, (user, NULL, cname, privs, key ? key : ""));
                        if (MOD_RESULT == MOD_RES_DENY)
                                return NULL;
                }
 
-               Ptr = new Channel(Instance, cname, TS);
+               Ptr = new Channel(cname, TS);
        }
        else
        {
@@ -267,7 +267,7 @@ Channel* Channel::JoinUser(InspIRCd* Instance, User *user, const char* cn, bool
                if (IS_LOCAL(user) && override == false)
                {
                        ModResult MOD_RESULT;
-                       FIRST_MOD_RESULT(Instance, OnUserPreJoin, MOD_RESULT, (user, Ptr, cname, privs, key ? key : ""));
+                       FIRST_MOD_RESULT(OnUserPreJoin, MOD_RESULT, (user, Ptr, cname, privs, key ? key : ""));
                        if (MOD_RESULT == MOD_RES_DENY)
                        {
                                return NULL;
@@ -276,11 +276,11 @@ Channel* Channel::JoinUser(InspIRCd* Instance, User *user, const char* cn, bool
                        {
                                std::string ckey = Ptr->GetModeParameter('k');
                                bool invited = user->IsInvited(Ptr->name.c_str());
-                               bool can_bypass = Instance->Config->InvBypassModes && invited;
+                               bool can_bypass = ServerInstance->Config->InvBypassModes && invited;
 
                                if (!ckey.empty())
                                {
-                                       FIRST_MOD_RESULT(Instance, OnCheckKey, MOD_RESULT, (user, Ptr, key ? key : ""));
+                                       FIRST_MOD_RESULT(OnCheckKey, MOD_RESULT, (user, Ptr, key ? key : ""));
                                        if (!MOD_RESULT.check((key && ckey == key) || can_bypass))
                                        {
                                                // If no key provided, or key is not the right one, and can't bypass +k (not invited or option not enabled)
@@ -291,7 +291,7 @@ Channel* Channel::JoinUser(InspIRCd* Instance, User *user, const char* cn, bool
 
                                if (Ptr->IsModeSet('i'))
                                {
-                                       FIRST_MOD_RESULT(Instance, OnCheckInvite, MOD_RESULT, (user, Ptr));
+                                       FIRST_MOD_RESULT(OnCheckInvite, MOD_RESULT, (user, Ptr));
                                        if (!MOD_RESULT.check(invited))
                                        {
                                                user->WriteNumeric(ERR_INVITEONLYCHAN, "%s %s :Cannot join channel (Invite only)",user->nick.c_str(), Ptr->name.c_str());
@@ -302,7 +302,7 @@ Channel* Channel::JoinUser(InspIRCd* Instance, User *user, const char* cn, bool
                                std::string limit = Ptr->GetModeParameter('l');
                                if (!limit.empty())
                                {
-                                       FIRST_MOD_RESULT(Instance, OnCheckLimit, MOD_RESULT, (user, Ptr));
+                                       FIRST_MOD_RESULT(OnCheckLimit, MOD_RESULT, (user, Ptr));
                                        if (!MOD_RESULT.check((Ptr->GetUserCounter() < atol(limit.c_str()) || can_bypass)))
                                        {
                                                user->WriteNumeric(ERR_CHANNELISFULL, "%s %s :Cannot join channel (Channel is full)",user->nick.c_str(), Ptr->name.c_str());
@@ -334,10 +334,10 @@ Channel* Channel::JoinUser(InspIRCd* Instance, User *user, const char* cn, bool
                Ptr->SetDefaultModes();
        }
 
-       return Channel::ForceChan(Instance, Ptr, user, privs, bursting, created_by_local);
+       return Channel::ForceChan(Ptr, user, privs, bursting, created_by_local);
 }
 
-Channel* Channel::ForceChan(InspIRCd* Instance, Channel* Ptr, User* user, const std::string &privs, bool bursting, bool created)
+Channel* Channel::ForceChan(Channel* Ptr, User* user, const std::string &privs, bool bursting, bool created)
 {
        std::string nick = user->nick;
 
@@ -347,22 +347,22 @@ Channel* Channel::ForceChan(InspIRCd* Instance, Channel* Ptr, User* user, const
        for (std::string::const_iterator x = privs.begin(); x != privs.end(); x++)
        {
                const char status = *x;
-               ModeHandler* mh = Instance->Modes->FindMode(status, MODETYPE_CHANNEL);
+               ModeHandler* mh = ServerInstance->Modes->FindMode(status, MODETYPE_CHANNEL);
                if (mh)
                {
                        /* Set, and make sure that the mode handler knows this mode was now set */
                        Ptr->SetPrefix(user, mh->GetModeChar(), true);
-                       mh->OnModeChange(Instance->FakeClient, Instance->FakeClient, Ptr, nick, true);
+                       mh->OnModeChange(ServerInstance->FakeClient, ServerInstance->FakeClient, Ptr, nick, true);
                }
        }
 
        CUList except_list;
-       FOREACH_MOD_I(Instance,I_OnUserJoin,OnUserJoin(memb, bursting, created, except_list));
+       FOREACH_MOD(I_OnUserJoin,OnUserJoin(memb, bursting, created, except_list));
 
        Ptr->WriteAllExcept(user, false, 0, except_list, "JOIN :%s", Ptr->name.c_str());
 
        /* Theyre not the first ones in here, make sure everyone else sees the modes we gave the user */
-       std::string ms = Instance->Modes->ModeString(user, Ptr);
+       std::string ms = ServerInstance->Modes->ModeString(user, Ptr);
        if ((Ptr->GetUserCounter() > 1) && (ms.length()))
                Ptr->WriteAllExceptSender(user, true, 0, "MODE %s +%s", Ptr->name.c_str(), ms.c_str());
 
@@ -376,14 +376,14 @@ Channel* Channel::ForceChan(InspIRCd* Instance, Channel* Ptr, User* user, const
                }
                Ptr->UserList(user);
        }
-       FOREACH_MOD_I(Instance,I_OnPostJoin,OnPostJoin(memb));
+       FOREACH_MOD(I_OnPostJoin,OnPostJoin(memb));
        return Ptr;
 }
 
 bool Channel::IsBanned(User* user)
 {
        ModResult result;
-       FIRST_MOD_RESULT(ServerInstance, OnCheckChannelBan, result, (user, this));
+       FIRST_MOD_RESULT(OnCheckChannelBan, result, (user, this));
 
        if (result != MOD_RES_PASSTHRU)
                return (result == MOD_RES_DENY);
@@ -399,7 +399,7 @@ bool Channel::IsBanned(User* user)
 bool Channel::CheckBan(User* user, const std::string& mask)
 {
        ModResult result;
-       FIRST_MOD_RESULT(ServerInstance, OnCheckBan, result, (user, this, mask));
+       FIRST_MOD_RESULT(OnCheckBan, result, (user, this, mask));
        if (result != MOD_RES_PASSTHRU)
                return (result == MOD_RES_DENY);
 
@@ -428,7 +428,7 @@ bool Channel::CheckBan(User* user, const std::string& mask)
 ModResult Channel::GetExtBanStatus(User *user, char type)
 {
        ModResult rv;
-       FIRST_MOD_RESULT(ServerInstance, OnExtBanCheck, rv, (user, this, type));
+       FIRST_MOD_RESULT(OnExtBanCheck, rv, (user, this, type));
        if (rv != MOD_RES_PASSTHRU)
                return rv;
        for (BanList::iterator i = this->bans.begin(); i != this->bans.end(); i++)
@@ -472,7 +472,7 @@ long Channel::PartUser(User *user, std::string &reason)
                if (iter != ServerInstance->chanlist->end())
                {
                        ModResult res;
-                       FIRST_MOD_RESULT(ServerInstance, OnChannelPreDelete, res, (this));
+                       FIRST_MOD_RESULT(OnChannelPreDelete, res, (this));
                        if (res == MOD_RES_DENY)
                                return 1; // delete halted by module
                        FOREACH_MOD(I_OnChannelDelete, OnChannelDelete(this));
@@ -516,7 +516,7 @@ long Channel::KickUser(User *src, User *user, const char* reason)
                if (ServerInstance->ULine(src->server))
                        res = MOD_RES_ALLOW;
                else
-                       FIRST_MOD_RESULT(ServerInstance, OnUserPreKick, res, (src,memb,reason));
+                       FIRST_MOD_RESULT(OnUserPreKick, res, (src,memb,reason));
 
                if (res == MOD_RES_DENY)
                        return this->GetUserCounter();
@@ -553,7 +553,7 @@ long Channel::KickUser(User *src, User *user, const char* reason)
                if (iter != ServerInstance->chanlist->end())
                {
                        ModResult res;
-                       FIRST_MOD_RESULT(ServerInstance, OnChannelPreDelete, res, (this));
+                       FIRST_MOD_RESULT(OnChannelPreDelete, res, (this));
                        if (res == MOD_RES_DENY)
                                return 1; // delete halted by module
                        FOREACH_MOD(I_OnChannelDelete, OnChannelDelete(this));
@@ -783,7 +783,7 @@ void Channel::UserList(User *user)
        if (!IS_LOCAL(user))
                return;
 
-       FIRST_MOD_RESULT(ServerInstance, OnUserList, call_modules, (user, this));
+       FIRST_MOD_RESULT(OnUserList, call_modules, (user, this));
 
        if (call_modules != MOD_RES_ALLOW)
        {
index cbf6a1005a614402b9fe285efc365353316c0f93..c8ca7d59e404ab8a504b8fd396f23273b796f13d 100644 (file)
@@ -29,7 +29,7 @@
 int InspIRCd::PassCompare(Extensible* ex, const std::string &data, const std::string &input, const std::string &hashtype)
 {
        ModResult res;
-       FIRST_MOD_RESULT(this, OnPassCompare, res, (ex, data, input, hashtype));
+       FIRST_MOD_RESULT(OnPassCompare, res, (ex, data, input, hashtype));
 
        /* Module matched */
        if (res == MOD_RES_ALLOW)
@@ -262,7 +262,7 @@ bool CommandParser::ProcessCommand(User *user, std::string &cmd)
        if (cm == cmdlist.end())
        {
                ModResult MOD_RESULT;
-               FIRST_MOD_RESULT(ServerInstance, OnPreCommand, MOD_RESULT, (command, command_p, user, false, cmd));
+               FIRST_MOD_RESULT(OnPreCommand, MOD_RESULT, (command, command_p, user, false, cmd));
                if (MOD_RESULT == MOD_RES_DENY)
                        return true;
 
@@ -325,7 +325,7 @@ bool CommandParser::ProcessCommand(User *user, std::string &cmd)
         * truncate to max_params if necessary. -- w00t
         */
        ModResult MOD_RESULT;
-       FIRST_MOD_RESULT(ServerInstance, OnPreCommand, MOD_RESULT, (command, command_p, user, false, cmd));
+       FIRST_MOD_RESULT(OnPreCommand, MOD_RESULT, (command, command_p, user, false, cmd));
        if (MOD_RESULT == MOD_RES_DENY)
                return true;
 
@@ -382,7 +382,7 @@ bool CommandParser::ProcessCommand(User *user, std::string &cmd)
                cm->second->total_bytes += cmd.length();
 
                /* module calls too */
-               FIRST_MOD_RESULT(ServerInstance, OnPreCommand, MOD_RESULT, (command, command_p, user, true, cmd));
+               FIRST_MOD_RESULT(OnPreCommand, MOD_RESULT, (command, command_p, user, true, cmd));
                if (MOD_RESULT == MOD_RES_DENY)
                        return do_more;
 
@@ -437,7 +437,7 @@ bool CommandParser::CreateCommand(Command *f)
        return false;
 }
 
-CommandParser::CommandParser(InspIRCd* Instance) : ServerInstance(Instance)
+CommandParser::CommandParser(
 {
        para.resize(128);
 }
index d93f74559a85abd32a49aa7293df3c392c392ac0..b0d432f29178b3dcd6ea8398a5ba4918d7726720 100644 (file)
@@ -52,7 +52,7 @@ CmdResult CommandAway::Handle (const std::vector<std::string>& parameters, User
 
        if ((parameters.size()) && (!parameters[0].empty()))
        {
-               FIRST_MOD_RESULT(ServerInstance, OnSetAway, MOD_RESULT, (user, parameters[0]));
+               FIRST_MOD_RESULT(OnSetAway, MOD_RESULT, (user, parameters[0]));
 
                if (MOD_RESULT == MOD_RES_DENY && IS_LOCAL(user))
                        return CMD_FAILURE;
@@ -64,7 +64,7 @@ CmdResult CommandAway::Handle (const std::vector<std::string>& parameters, User
        }
        else
        {
-               FIRST_MOD_RESULT(ServerInstance, OnSetAway, MOD_RESULT, (user, ""));
+               FIRST_MOD_RESULT(OnSetAway, MOD_RESULT, (user, ""));
 
                if (MOD_RESULT == MOD_RES_DENY && IS_LOCAL(user))
                        return CMD_FAILURE;
index 7845fa2f1151d04223a5074a8b877d3574a0273c..6ea3df7c562bee2b8f87a12f6259834cfb3cdbbc 100644 (file)
@@ -87,7 +87,7 @@ CmdResult CommandEline::Handle (const std::vector<std::string>& parameters, User
 
                long duration = ServerInstance->Duration(parameters[1].c_str());
 
-               ELine* el = new ELine(ServerInstance, ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), ih.first.c_str(), ih.second.c_str());
+               ELine* el = new ELine(ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), ih.first.c_str(), ih.second.c_str());
                if (ServerInstance->XLines->AddLine(el, user))
                {
                        if (!duration)
index ad30674285a70f51c8da1e7471e0cef9fa047189..ea2850f6f1deadab3c5801bee51468c9f229d496 100644 (file)
@@ -70,7 +70,7 @@ CmdResult CommandGline::Handle (const std::vector<std::string>& parameters, User
                }
 
                long duration = ServerInstance->Duration(parameters[1].c_str());
-               GLine* gl = new GLine(ServerInstance, ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), ih.first.c_str(), ih.second.c_str());
+               GLine* gl = new GLine(ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), ih.first.c_str(), ih.second.c_str());
                if (ServerInstance->XLines->AddLine(gl, user))
                {
                        if (!duration)
index 89437e25217352f37aa0b3aa2dc1c675669087f1..9da6096a41600f9f40df89377758cca013ab5de8 100644 (file)
@@ -70,7 +70,7 @@ CmdResult CommandInvite::Handle (const std::vector<std::string>& parameters, Use
                        return CMD_FAILURE;
                }
 
-               FIRST_MOD_RESULT(ServerInstance, OnUserPreInvite, MOD_RESULT, (user,u,c,timeout));
+               FIRST_MOD_RESULT(OnUserPreInvite, MOD_RESULT, (user,u,c,timeout));
 
                if (MOD_RESULT == MOD_RES_DENY)
                {
index 73cae4746db71e0f6521657d5fb4c9ee57e8f17d..806823f76e50a72b9f2498f4f951ce15f34e3727 100644 (file)
@@ -55,7 +55,7 @@ CmdResult CommandJoin::Handle (const std::vector<std::string>& parameters, User
 
                if (ServerInstance->IsChannel(parameters[0].c_str(), ServerInstance->Config->Limits.ChanMax))
                {
-                       Channel::JoinUser(ServerInstance, user, parameters[0].c_str(), false, parameters[1].c_str(), false);
+                       Channel::JoinUser(user, parameters[0].c_str(), false, parameters[1].c_str(), false);
                        return CMD_SUCCESS;
                }
        }
@@ -66,7 +66,7 @@ CmdResult CommandJoin::Handle (const std::vector<std::string>& parameters, User
 
                if (ServerInstance->IsChannel(parameters[0].c_str(), ServerInstance->Config->Limits.ChanMax))
                {
-                       Channel::JoinUser(ServerInstance, user, parameters[0].c_str(), false, "", false);
+                       Channel::JoinUser(user, parameters[0].c_str(), false, "", false);
                        return CMD_SUCCESS;
                }
        }
index 1001d4c8ae1c3567271b471e2aca1f5fd906ab62..88db2764de5c17e0d07662df45621e967dcccff2 100644 (file)
@@ -60,7 +60,7 @@ CmdResult CommandKill::Handle (const std::vector<std::string>& parameters, User
                         * Moved this event inside the IS_LOCAL check also, we don't want half the network killing a user
                         * and the other half not. This would be a bad thing. ;p -- w00t
                         */
-                       FIRST_MOD_RESULT(ServerInstance, OnKill, MOD_RESULT, (user, u, parameters[1]));
+                       FIRST_MOD_RESULT(OnKill, MOD_RESULT, (user, u, parameters[1]));
 
                        if (MOD_RESULT == MOD_RES_DENY)
                                return CMD_FAILURE;
index 3ec2461b4f3b93ddf73146d14aec21efae6e19b2..9184a3505e42acbfef188b006a27a1582cb19b3d 100644 (file)
@@ -70,7 +70,7 @@ CmdResult CommandKline::Handle (const std::vector<std::string>& parameters, User
                }
 
                long duration = ServerInstance->Duration(parameters[1].c_str());
-               KLine* kl = new KLine(ServerInstance, ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), ih.first.c_str(), ih.second.c_str());
+               KLine* kl = new KLine(ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), ih.first.c_str(), ih.second.c_str());
                if (ServerInstance->XLines->AddLine(kl,user))
                {
                        if (!duration)
index 99b8348abff8d3431c48632dea767dca2f84d3cc..bdaff8723d62364ba66323762d44a155db613022 100644 (file)
@@ -84,7 +84,7 @@ CmdResult CommandNick::Handle (const std::vector<std::string>& parameters, User
                 */
                oldnick.assign(user->nick, 0, IS_LOCAL(user) ? ServerInstance->Config->Limits.NickMax : MAXBUF);
                ModResult MOD_RESULT;
-               FIRST_MOD_RESULT(ServerInstance, OnUserPreNick, MOD_RESULT, (user,parameters[0]));
+               FIRST_MOD_RESULT(OnUserPreNick, MOD_RESULT, (user,parameters[0]));
                if (MOD_RESULT == MOD_RES_DENY)
                        return CMD_FAILURE;
                if (user->registered == REG_ALL)
@@ -165,7 +165,7 @@ CmdResult CommandNick::Handle (const std::vector<std::string>& parameters, User
 
 
        ModResult MOD_RESULT;
-       FIRST_MOD_RESULT(ServerInstance, OnUserPreNick, MOD_RESULT, (user, parameters[0]));
+       FIRST_MOD_RESULT(OnUserPreNick, MOD_RESULT, (user, parameters[0]));
        if (MOD_RESULT == MOD_RES_DENY)
                // if a module returns true, the nick change is silently forbidden.
                return CMD_FAILURE;
@@ -191,7 +191,7 @@ CmdResult CommandNick::Handle (const std::vector<std::string>& parameters, User
                if (user->registered == REG_NICKUSER)
                {
                        /* user is registered now, bit 0 = USER command, bit 1 = sent a NICK command */
-                       FIRST_MOD_RESULT(ServerInstance, OnUserRegister, MOD_RESULT, (user));
+                       FIRST_MOD_RESULT(OnUserRegister, MOD_RESULT, (user));
                        if (MOD_RESULT == MOD_RES_DENY)
                                return CMD_FAILURE;
 
index ced17072fd0b6021cbececd78127419972d30274..a14473643e12c67a1f591fd8855a59a06e20b325 100644 (file)
@@ -51,7 +51,7 @@ CmdResult CommandNotice::Handle (const std::vector<std::string>& parameters, Use
 
                ModResult MOD_RESULT;
                std::string temp = parameters[1];
-               FIRST_MOD_RESULT(ServerInstance, OnUserPreNotice, MOD_RESULT, (user, (void*)parameters[0].c_str(), TYPE_SERVER, temp, 0, exempt_list));
+               FIRST_MOD_RESULT(OnUserPreNotice, MOD_RESULT, (user, (void*)parameters[0].c_str(), TYPE_SERVER, temp, 0, exempt_list));
                if (MOD_RESULT == MOD_RES_DENY)
                        return CMD_FAILURE;
                const char* text = temp.c_str();
@@ -97,7 +97,7 @@ CmdResult CommandNotice::Handle (const std::vector<std::string>& parameters, Use
                        ModResult MOD_RESULT;
 
                        std::string temp = parameters[1];
-                       FIRST_MOD_RESULT(ServerInstance, OnUserPreNotice, MOD_RESULT, (user,chan,TYPE_CHANNEL,temp,status, exempt_list));
+                       FIRST_MOD_RESULT(OnUserPreNotice, MOD_RESULT, (user,chan,TYPE_CHANNEL,temp,status, exempt_list));
                        if (MOD_RESULT == MOD_RES_DENY)
                                return CMD_FAILURE;
 
@@ -173,7 +173,7 @@ CmdResult CommandNotice::Handle (const std::vector<std::string>& parameters, Use
 
                ModResult MOD_RESULT;
                std::string temp = parameters[1];
-               FIRST_MOD_RESULT(ServerInstance, OnUserPreNotice, MOD_RESULT, (user,dest,TYPE_USER,temp,0,exempt_list));
+               FIRST_MOD_RESULT(OnUserPreNotice, MOD_RESULT, (user,dest,TYPE_USER,temp,0,exempt_list));
                if (MOD_RESULT == MOD_RES_DENY) {
                        return CMD_FAILURE;
                }
index 781ad8bacb25497c88e8d0171c35fc4b8925b9f0..0eacfd0bcc31d8663f8b99609c42e714bd8344e2 100644 (file)
@@ -51,7 +51,7 @@ CmdResult CommandPrivmsg::Handle (const std::vector<std::string>& parameters, Us
 
                ModResult MOD_RESULT;
                std::string temp = parameters[1];
-               FIRST_MOD_RESULT(ServerInstance, OnUserPreMessage, MOD_RESULT, (user, (void*)parameters[0].c_str(), TYPE_SERVER, temp, 0, except_list));
+               FIRST_MOD_RESULT(OnUserPreMessage, MOD_RESULT, (user, (void*)parameters[0].c_str(), TYPE_SERVER, temp, 0, except_list));
                if (MOD_RESULT == MOD_RES_DENY)
                        return CMD_FAILURE;
 
@@ -108,7 +108,7 @@ CmdResult CommandPrivmsg::Handle (const std::vector<std::string>& parameters, Us
                        ModResult MOD_RESULT;
 
                        std::string temp = parameters[1];
-                       FIRST_MOD_RESULT(ServerInstance, OnUserPreMessage, MOD_RESULT, (user,chan,TYPE_CHANNEL,temp,status,except_list));
+                       FIRST_MOD_RESULT(OnUserPreMessage, MOD_RESULT, (user,chan,TYPE_CHANNEL,temp,status,except_list));
                        if (MOD_RESULT == MOD_RES_DENY)
                                return CMD_FAILURE;
 
@@ -192,7 +192,7 @@ CmdResult CommandPrivmsg::Handle (const std::vector<std::string>& parameters, Us
                ModResult MOD_RESULT;
 
                std::string temp = parameters[1];
-               FIRST_MOD_RESULT(ServerInstance, OnUserPreMessage, MOD_RESULT, (user, dest, TYPE_USER, temp, 0, except_list));
+               FIRST_MOD_RESULT(OnUserPreMessage, MOD_RESULT, (user, dest, TYPE_USER, temp, 0, except_list));
                if (MOD_RESULT == MOD_RES_DENY)
                        return CMD_FAILURE;
 
index ffe8c5ee62ec9c43afbf02c1bd45d78cbdec9468..762fd53c4ba3f8b647b0a04c0940c5f61ce6c378 100644 (file)
@@ -45,7 +45,7 @@ CmdResult CommandQline::Handle (const std::vector<std::string>& parameters, User
                }
 
                long duration = ServerInstance->Duration(parameters[1].c_str());
-               QLine* ql = new QLine(ServerInstance, ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), parameters[0].c_str());
+               QLine* ql = new QLine(ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), parameters[0].c_str());
                if (ServerInstance->XLines->AddLine(ql,user))
                {
                        if (!duration)
index b2a9fbde47c34c2bb7d25a5e68a58aaae80aa8a7..5d5caa32abd216d6ad1f59b550066a844a747764 100644 (file)
@@ -85,7 +85,7 @@ CmdResult CommandRehash::Handle (const std::vector<std::string>& parameters, Use
                FOREACH_MOD(I_OnGarbageCollect, OnGarbageCollect());
 
 
-               ServerInstance->ConfigThread = new ConfigReaderThread(ServerInstance, user->uuid);
+               ServerInstance->ConfigThread = new ConfigReaderThread(user->uuid);
                ServerInstance->Threads->Start(ServerInstance->ConfigThread);
 
                return CMD_SUCCESS;
index e2f81f33c4c2e1dd04e19ce09f363b18bf08aabc..e396e0c84e69b4d2f7eb14ce98c963fa81ff657c 100644 (file)
@@ -71,7 +71,7 @@ CmdResult CommandUser::Handle (const std::vector<std::string>& parameters, User
                ModResult MOD_RESULT;
 
                /* user is registered now, bit 0 = USER command, bit 1 = sent a NICK command */
-               FIRST_MOD_RESULT(ServerInstance, OnUserRegister, MOD_RESULT, (user));
+               FIRST_MOD_RESULT(OnUserRegister, MOD_RESULT, (user));
                if (MOD_RESULT == MOD_RES_DENY)
                        return CMD_FAILURE;
 
index 78a7e7544c7586b5ac0748bf8a4015b3bedf8b65..4a9ac94994cb0475823a25558270b04ea0dc5a08 100644 (file)
@@ -20,7 +20,7 @@ CommandWhowas::CommandWhowas( Module* parent) : Command(parent, "WHOWAS", 1)
 {
        syntax = "<nick>{,<nick>}";
        Penalty = 2;
-       timer = new WhoWasMaintainTimer(ServerInstance, 3600);
+       timer = new WhoWasMaintainTimer(3600);
        ServerInstance->Timers->AddTimer(timer);
 }
 
@@ -309,7 +309,7 @@ class ModuleWhoWas : public Module
 {
        CommandWhowas cmd;
  public:
-       ModuleWhoWas(InspIRCd *Me) : Module(Me), cmd(this)
+       ModuleWhoWas() : cmd(this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index e2cca76497e2ebde8c41c9c6631a1b1534b49258..d37300974904475c6c7ed51a65ad032782078c1c 100644 (file)
@@ -66,7 +66,7 @@ CmdResult CommandZline::Handle (const std::vector<std::string>& parameters, User
 
                long duration = ServerInstance->Duration(parameters[1].c_str());
 
-               ZLine* zl = new ZLine(ServerInstance, ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), ipaddr);
+               ZLine* zl = new ZLine(ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), ipaddr);
                if (ServerInstance->XLines->AddLine(zl,user))
                {
                        if (!duration)
index 159ca598fce99bb6f24c7a40015f624ef12c7beb..3fb60034d0f816f3965228dd4c5dd884167df717 100644 (file)
@@ -32,7 +32,7 @@
 #include "commands/cmd_whowas.h"
 #include "modes/cmode_h.h"
 
-ServerConfig::ServerConfig(InspIRCd* Instance) : ServerInstance(Instance)
+ServerConfig::ServerConfig()
 {
        *sid = *ServerName = *Network = *ServerDesc = *AdminName = '\0';
        *HideWhoisServer = *AdminEmail = *AdminNick = *diepass = *restartpass = *FixedQuit = *HideKillsServer = '\0';
@@ -45,7 +45,7 @@ ServerConfig::ServerConfig(InspIRCd* Instance) : ServerInstance(Instance)
        dns_timeout = DieDelay = 5;
        MaxTargets = 20;
        NetBufferSize = 10240;
-       SoftLimit = Instance->SE->GetMaxFds();
+       SoftLimit = ServerInstance->SE->GetMaxFds();
        MaxConn = SOMAXCONN;
        MaxWhoResults = 0;
        debugging = 0;
@@ -199,7 +199,7 @@ static bool ValidateMaxTargets(ServerConfig* conf, const char*, const char*, Val
 {
        if ((data.GetInteger() < 1) || (data.GetInteger() > 31))
        {
-               conf->GetInstance()->Logs->Log("CONFIG",DEFAULT,"WARNING: <security:maxtargets> value is greater than 31 or less than 1, set to 20.");
+               ServerInstance->Logs->Log("CONFIG",DEFAULT,"WARNING: <security:maxtargets> value is greater than 31 or less than 1, set to 20.");
                data.Set(20);
        }
        return true;
@@ -207,10 +207,10 @@ static bool ValidateMaxTargets(ServerConfig* conf, const char*, const char*, Val
 
 static bool ValidateSoftLimit(ServerConfig* conf, const char*, const char*, ValueItem &data)
 {
-       if ((data.GetInteger() < 1) || (data.GetInteger() > conf->GetInstance()->SE->GetMaxFds()))
+       if ((data.GetInteger() < 1) || (data.GetInteger() > ServerInstance->SE->GetMaxFds()))
        {
-               conf->GetInstance()->Logs->Log("CONFIG",DEFAULT,"WARNING: <performance:softlimit> value is greater than %d or less than 0, set to %d.",conf->GetInstance()->SE->GetMaxFds(),conf->GetInstance()->SE->GetMaxFds());
-               data.Set(conf->GetInstance()->SE->GetMaxFds());
+               ServerInstance->Logs->Log("CONFIG",DEFAULT,"WARNING: <performance:softlimit> value is greater than %d or less than 0, set to %d.",ServerInstance->SE->GetMaxFds(),ServerInstance->SE->GetMaxFds());
+               data.Set(ServerInstance->SE->GetMaxFds());
        }
        return true;
 }
@@ -218,7 +218,7 @@ static bool ValidateSoftLimit(ServerConfig* conf, const char*, const char*, Valu
 static bool ValidateMaxConn(ServerConfig* conf, const char*, const char*, ValueItem &data)
 {
        if (data.GetInteger() > SOMAXCONN)
-               conf->GetInstance()->Logs->Log("CONFIG",DEFAULT,"WARNING: <performance:somaxconn> value may be higher than the system-defined SOMAXCONN value!");
+               ServerInstance->Logs->Log("CONFIG",DEFAULT,"WARNING: <performance:somaxconn> value may be higher than the system-defined SOMAXCONN value!");
        return true;
 }
 
@@ -275,7 +275,7 @@ static bool ValidateDnsServer(ServerConfig* conf, const char*, const char*, Valu
        {
                std::string nameserver;
                // attempt to look up their nameserver from /etc/resolv.conf
-               conf->GetInstance()->Logs->Log("CONFIG",DEFAULT,"WARNING: <dns:server> not defined, attempting to find working server in /etc/resolv.conf...");
+               ServerInstance->Logs->Log("CONFIG",DEFAULT,"WARNING: <dns:server> not defined, attempting to find working server in /etc/resolv.conf...");
                std::ifstream resolv("/etc/resolv.conf");
                bool found_server = false;
 
@@ -288,19 +288,19 @@ static bool ValidateDnsServer(ServerConfig* conf, const char*, const char*, Valu
                                        resolv >> nameserver;
                                        data.Set(nameserver.c_str());
                                        found_server = true;
-                                       conf->GetInstance()->Logs->Log("CONFIG",DEFAULT,"<dns:server> set to '%s' as first resolver in /etc/resolv.conf.",nameserver.c_str());
+                                       ServerInstance->Logs->Log("CONFIG",DEFAULT,"<dns:server> set to '%s' as first resolver in /etc/resolv.conf.",nameserver.c_str());
                                }
                        }
 
                        if (!found_server)
                        {
-                               conf->GetInstance()->Logs->Log("CONFIG",DEFAULT,"/etc/resolv.conf contains no viable nameserver entries! Defaulting to nameserver '127.0.0.1'!");
+                               ServerInstance->Logs->Log("CONFIG",DEFAULT,"/etc/resolv.conf contains no viable nameserver entries! Defaulting to nameserver '127.0.0.1'!");
                                data.Set("127.0.0.1");
                        }
                }
                else
                {
-                       conf->GetInstance()->Logs->Log("CONFIG",DEFAULT,"/etc/resolv.conf can't be opened! Defaulting to nameserver '127.0.0.1'!");
+                       ServerInstance->Logs->Log("CONFIG",DEFAULT,"/etc/resolv.conf can't be opened! Defaulting to nameserver '127.0.0.1'!");
                        data.Set("127.0.0.1");
                }
        }
@@ -310,11 +310,11 @@ static bool ValidateDnsServer(ServerConfig* conf, const char*, const char*, Valu
 
 static bool ValidateServerName(ServerConfig* conf, const char*, const char*, ValueItem &data)
 {
-       conf->GetInstance()->Logs->Log("CONFIG",DEFAULT,"Validating server name");
+       ServerInstance->Logs->Log("CONFIG",DEFAULT,"Validating server name");
        /* If we already have a servername, and they changed it, we should throw an exception. */
        if (!strchr(data.GetString(), '.'))
        {
-               conf->GetInstance()->Logs->Log("CONFIG",DEFAULT,"WARNING: <server:name> '%s' is not a fully-qualified domain name. Changed to '%s.'",
+               ServerInstance->Logs->Log("CONFIG",DEFAULT,"WARNING: <server:name> '%s' is not a fully-qualified domain name. Changed to '%s.'",
                        data.GetString(),data.GetString());
                std::string moo = data.GetValue();
                data.Set(moo.append("."));
@@ -328,7 +328,7 @@ static bool ValidateNetBufferSize(ServerConfig* conf, const char*, const char*,
        // 65534 not 65535 because of null terminator
        if ((!data.GetInteger()) || (data.GetInteger() > 65534) || (data.GetInteger() < 1024))
        {
-               conf->GetInstance()->Logs->Log("CONFIG",DEFAULT,"No NetBufferSize specified or size out of range, setting to default of 10240.");
+               ServerInstance->Logs->Log("CONFIG",DEFAULT,"No NetBufferSize specified or size out of range, setting to default of 10240.");
                data.Set(10240);
        }
        return true;
@@ -338,7 +338,7 @@ static bool ValidateMaxWho(ServerConfig* conf, const char*, const char*, ValueIt
 {
        if ((data.GetInteger() > 65535) || (data.GetInteger() < 1))
        {
-               conf->GetInstance()->Logs->Log("CONFIG",DEFAULT,"<performance:maxwho> size out of range, setting to default of 128.");
+               ServerInstance->Logs->Log("CONFIG",DEFAULT,"<performance:maxwho> size out of range, setting to default of 128.");
                data.Set(128);
        }
        return true;
@@ -346,14 +346,14 @@ static bool ValidateMaxWho(ServerConfig* conf, const char*, const char*, ValueIt
 
 static bool ValidateHalfOp(ServerConfig* conf, const char*, const char*, ValueItem &data)
 {
-       ModeHandler* mh = conf->GetInstance()->Modes->FindMode('h', MODETYPE_CHANNEL);
+       ModeHandler* mh = ServerInstance->Modes->FindMode('h', MODETYPE_CHANNEL);
        if (data.GetBool() && !mh) {
-               conf->GetInstance()->Logs->Log("CONFIG", DEFAULT, "Enabling halfop mode.");
-               mh = new ModeChannelHalfOp(conf->GetInstance());
-               conf->GetInstance()->Modes->AddMode(mh);
+               ServerInstance->Logs->Log("CONFIG", DEFAULT, "Enabling halfop mode.");
+               mh = new ModeChannelHalfOp;
+               ServerInstance->Modes->AddMode(mh);
        } else if (!data.GetBool() && mh) {
-               conf->GetInstance()->Logs->Log("CONFIG", DEFAULT, "Disabling halfop mode.");
-               conf->GetInstance()->Modes->DelMode(mh);
+               ServerInstance->Logs->Log("CONFIG", DEFAULT, "Disabling halfop mode.");
+               ServerInstance->Modes->DelMode(mh);
                delete mh;
        }
        return true;
@@ -412,11 +412,11 @@ static bool ValidateInvite(ServerConfig* conf, const char*, const char*, ValueIt
 
 static bool ValidateSID(ServerConfig* conf, const char*, const char*, ValueItem &data)
 {
-       conf->GetInstance()->Logs->Log("CONFIG",DEFAULT,"Validating server id");
+       ServerInstance->Logs->Log("CONFIG",DEFAULT,"Validating server id");
 
        const char *sid = data.GetString();
 
-       if (*sid && !conf->GetInstance()->IsSID(sid))
+       if (*sid && !ServerInstance->IsSID(sid))
        {
                throw CoreException(std::string(sid) + " is not a valid server ID. A server ID must be 3 characters long, with the first character a digit and the next two characters a digit or letter.");
        }
@@ -428,7 +428,7 @@ static bool ValidateSID(ServerConfig* conf, const char*, const char*, ValueItem
 
 static bool ValidateWhoWas(ServerConfig* conf, const char*, const char*, ValueItem &data)
 {
-       conf->WhoWasMaxKeep = conf->GetInstance()->Duration(data.GetString());
+       conf->WhoWasMaxKeep = ServerInstance->Duration(data.GetString());
 
        if (conf->WhoWasGroupSize < 0)
                conf->WhoWasGroupSize = 0;
@@ -439,10 +439,10 @@ static bool ValidateWhoWas(ServerConfig* conf, const char*, const char*, ValueIt
        if (conf->WhoWasMaxKeep < 3600)
        {
                conf->WhoWasMaxKeep = 3600;
-               conf->GetInstance()->Logs->Log("CONFIG",DEFAULT,"WARNING: <whowas:maxkeep> value less than 3600, setting to default 3600");
+               ServerInstance->Logs->Log("CONFIG",DEFAULT,"WARNING: <whowas:maxkeep> value less than 3600, setting to default 3600");
        }
 
-       Module* whowas = conf->GetInstance()->Modules->Find("cmd_whowas.so");
+       Module* whowas = ServerInstance->Modules->Find("cmd_whowas.so");
        if (whowas)
        {
                WhowasRequest(NULL, whowas, WhowasRequest::WHOWAS_PRUNE).Send();
@@ -476,8 +476,8 @@ static bool DoZLine(ServerConfig* conf, const char* tag, const char** entries, V
        const char* reason = values[0].GetString();
        const char* ipmask = values[1].GetString();
 
-       ZLine* zl = new ZLine(conf->GetInstance(), conf->GetInstance()->Time(), 0, "<Config>", reason, ipmask);
-       if (!conf->GetInstance()->XLines->AddLine(zl, NULL))
+       ZLine* zl = new ZLine(ServerInstance->Time(), 0, "<Config>", reason, ipmask);
+       if (!ServerInstance->XLines->AddLine(zl, NULL))
                delete zl;
 
        return true;
@@ -488,8 +488,8 @@ static bool DoQLine(ServerConfig* conf, const char* tag, const char** entries, V
        const char* reason = values[0].GetString();
        const char* nick = values[1].GetString();
 
-       QLine* ql = new QLine(conf->GetInstance(), conf->GetInstance()->Time(), 0, "<Config>", reason, nick);
-       if (!conf->GetInstance()->XLines->AddLine(ql, NULL))
+       QLine* ql = new QLine(ServerInstance->Time(), 0, "<Config>", reason, nick);
+       if (!ServerInstance->XLines->AddLine(ql, NULL))
                delete ql;
 
        return true;
@@ -500,11 +500,11 @@ static bool DoKLine(ServerConfig* conf, const char* tag, const char** entries, V
        const char* reason = values[0].GetString();
        const char* host = values[1].GetString();
 
-       XLineManager* xlm = conf->GetInstance()->XLines;
+       XLineManager* xlm = ServerInstance->XLines;
 
        IdentHostPair ih = xlm->IdentSplit(host);
 
-       KLine* kl = new KLine(conf->GetInstance(), conf->GetInstance()->Time(), 0, "<Config>", reason, ih.first.c_str(), ih.second.c_str());
+       KLine* kl = new KLine(ServerInstance->Time(), 0, "<Config>", reason, ih.first.c_str(), ih.second.c_str());
        if (!xlm->AddLine(kl, NULL))
                delete kl;
        return true;
@@ -515,11 +515,11 @@ static bool DoELine(ServerConfig* conf, const char* tag, const char** entries, V
        const char* reason = values[0].GetString();
        const char* host = values[1].GetString();
 
-       XLineManager* xlm = conf->GetInstance()->XLines;
+       XLineManager* xlm = ServerInstance->XLines;
 
        IdentHostPair ih = xlm->IdentSplit(host);
 
-       ELine* el = new ELine(conf->GetInstance(), conf->GetInstance()->Time(), 0, "<Config>", reason, ih.first.c_str(), ih.second.c_str());
+       ELine* el = new ELine(ServerInstance->Time(), 0, "<Config>", reason, ih.first.c_str(), ih.second.c_str());
        if (!xlm->AddLine(el, NULL))
                delete el;
        return true;
@@ -2012,11 +2012,6 @@ std::string ServerConfig::GetFullProgDir()
        return "/";
 }
 
-InspIRCd* ServerConfig::GetInstance()
-{
-       return ServerInstance;
-}
-
 std::string ServerConfig::GetSID()
 {
        return sid;
@@ -2068,7 +2063,7 @@ bool ValueItem::GetBool()
 
 void ConfigReaderThread::Run()
 {
-       Config = new ServerConfig(ServerInstance);
+       Config = new ServerConfig;
        Config->Read();
        done = true;
 }
@@ -2097,7 +2092,7 @@ void ConfigReaderThread::Finish()
                ServerInstance->ResetMaxBans();
                Config->ApplyDisabledCommands(Config->DisabledCommands);
                User* user = TheUserUID.empty() ? ServerInstance->FindNick(TheUserUID) : NULL;
-               FOREACH_MOD_I(ServerInstance, I_OnRehash, OnRehash(user));
+               FOREACH_MOD(I_OnRehash, OnRehash(user));
                ServerInstance->BuildISupport();
 
                delete old;
index 3356700ef9aadd7e22817861db1253fec179fbf6..a28881ad2f4d00667ad5d722d9bc88a0e8f78cd1 100644 (file)
@@ -96,9 +96,8 @@ class DNSRequest
        DNS*            dnsobj;         /* DNS caller (where we get our FD from) */
        unsigned long   ttl;            /* Time to live */
        std::string     orig;           /* Original requested name/ip */
-       InspIRCd*       ServerInstance;
 
-       DNSRequest(InspIRCd* Instance, DNS* dns, int id, const std::string &original);
+       DNSRequest(DNS* dns, int id, const std::string &original);
        ~DNSRequest();
        DNSInfo ResultIsReady(DNSHeader &h, int length);
        int SendRequests(const DNSHeader *header, const int length, QueryType qt);
@@ -107,11 +106,10 @@ class DNSRequest
 class CacheTimer : public Timer
 {
  private:
-       InspIRCd* ServerInstance;
        DNS* dns;
  public:
-       CacheTimer(InspIRCd* Instance, DNS* thisdns)
-               : Timer(3600, Instance->Time(), true), ServerInstance(Instance), dns(thisdns) { }
+       CacheTimer(DNS* thisdns)
+               : Timer(3600, ServerInstance->Time(), true), dns(thisdns) { }
 
        virtual void Tick(time_t)
        {
@@ -121,11 +119,10 @@ class CacheTimer : public Timer
 
 class RequestTimeout : public Timer
 {
-       InspIRCd* ServerInstance;
        DNSRequest* watch;
        int watchid;
  public:
-       RequestTimeout(unsigned long n, InspIRCd* SI, DNSRequest* watching, int id) : Timer(n, SI->Time()), ServerInstance(SI), watch(watching), watchid(id)
+       RequestTimeout(unsigned long n, DNSRequest* watching, int id) : Timer(n, ServerInstance->Time()), watch(watching), watchid(id)
        {
        }
        ~RequestTimeout()
@@ -152,13 +149,13 @@ class RequestTimeout : public Timer
 };
 
 /* Allocate the processing buffer */
-DNSRequest::DNSRequest(InspIRCd* Instance, DNS* dns, int rid, const std::string &original) : dnsobj(dns), ServerInstance(Instance)
+DNSRequest::DNSRequest(DNS* dns, int rid, const std::string &original) : dnsobj(dns)
 {
        res = new unsigned char[512];
        *res = 0;
        orig = original;
-       RequestTimeout* RT = new RequestTimeout(Instance->Config->dns_timeout ? Instance->Config->dns_timeout : 5, Instance, this, rid);
-       Instance->Timers->AddTimer(RT); /* The timer manager frees this */
+       RequestTimeout* RT = new RequestTimeout(ServerInstance->Config->dns_timeout ? ServerInstance->Config->dns_timeout : 5, this, rid);
+       ServerInstance->Timers->AddTimer(RT); /* The timer manager frees this */
 }
 
 /* Deallocate the processing buffer */
@@ -259,7 +256,7 @@ DNSRequest* DNS::AddQuery(DNSHeader *header, int &id, const char* original)
        while (requests[id])
                id = this->PRNG() & DNS::MAX_REQUEST_ID;
 
-       DNSRequest* req = new DNSRequest(ServerInstance, this, id, original);
+       DNSRequest* req = new DNSRequest(this, id, original);
 
        header->id[0] = req->id[0] = id >> 8;
        header->id[1] = req->id[1] = id & 0xFF;
@@ -386,7 +383,7 @@ void DNS::Rehash()
 }
 
 /** Initialise the DNS UDP socket so that we can send requests */
-DNS::DNS(InspIRCd* Instance) : ServerInstance(Instance)
+DNS::DNS()
 {
        ServerInstance->Logs->Log("RESOLVER",DEBUG,"DNS::DNS");
        /* Clear the Resolver class table */
@@ -412,7 +409,7 @@ DNS::DNS(InspIRCd* Instance) : ServerInstance(Instance)
         */
        this->Rehash();
 
-       this->PruneTimer = new CacheTimer(ServerInstance, this);
+       this->PruneTimer = new CacheTimer(this);
 
        ServerInstance->Timers->AddTimer(this->PruneTimer);
 }
@@ -904,7 +901,7 @@ void Resolver::TriggerCachedResult()
 }
 
 /** High level abstraction of dns used by application at large */
-Resolver::Resolver(InspIRCd* Instance, const std::string &source, QueryType qt, bool &cached, Module* creator) : ServerInstance(Instance), Creator(creator), input(source), querytype(qt)
+Resolver::Resolver(const std::string &source, QueryType qt, bool &cached, Module* creator) : Creator(creator), input(source), querytype(qt)
 {
        ServerInstance->Logs->Log("RESOLVER",DEBUG,"Resolver::Resolver");
        cached = false;
index 704c4d9ddc7736f20f48c92a1d7937e789f536ba..8731489c435cc5761f0a452b2ca6dbd5fedbaa90 100644 (file)
@@ -19,7 +19,7 @@
 #include <dlfcn.h>
 #endif
 
-DLLManager::DLLManager(InspIRCd*, const char *fname)
+DLLManager::DLLManager(const char *fname)
 {
        err = NULL;
 
index b99b9e5bbd05dabc9689aaa3b67ec0d6bea1d2bf..1a88823c46b6c4f01d6c4d815ac14c4462d27b81 100644 (file)
@@ -19,8 +19,8 @@
 #include "inspircd_se_config.h"
 #include "filelogger.h"
 
-FileLogStream::FileLogStream(InspIRCd *Instance, int loglevel, FileWriter *fw)
-       : LogStream(Instance, loglevel), f(fw)
+FileLogStream::FileLogStream(int loglevel, FileWriter *fw)
+       : LogStream(loglevel), f(fw)
 {
        ServerInstance->Logs->AddLoggerRef(f);
 }
index 04c24418c5424f7d0ac620ace63bf4fa4d4f2079..bf2a218a6e8475c7d5a51ea259474b2dfe1232fa 100644 (file)
@@ -316,7 +316,7 @@ CoreExport const char* irc::Spacify(const char* n)
 }
 
 
-irc::modestacker::modestacker(InspIRCd* Instance, bool add) : ServerInstance(Instance), adding(add)
+irc::modestacker::modestacker(bool add) : adding(add)
 {
        sequence.clear();
        sequence.push_back("");
index 80feae464c6e52468463de830163772c3d8a58be..155e29dd465b7ec6e664f580c6a32b8f3ad0b92f 100644 (file)
@@ -21,7 +21,7 @@ std::string InspIRCd::GetServerDescription(const char* servername)
 {
        std::string description;
 
-       FOREACH_MOD_I(this,I_OnGetServerDescription,OnGetServerDescription(servername,description));
+       FOREACH_MOD(I_OnGetServerDescription,OnGetServerDescription(servername,description));
 
        if (!description.empty())
        {
@@ -318,8 +318,8 @@ bool InspIRCd::OpenLog(char**, int)
                return false;
        }
 
-       FileWriter* fw = new FileWriter(this, Config->log_file);
-       FileLogStream *f = new FileLogStream(this, (Config->forcedebug ? DEBUG : DEFAULT), fw);
+       FileWriter* fw = new FileWriter(Config->log_file);
+       FileLogStream *f = new FileLogStream((Config->forcedebug ? DEBUG : DEFAULT), fw);
 
        this->Logs->AddLogType("*", f, true);
 
@@ -341,9 +341,9 @@ void InspIRCd::SendWhoisLine(User* user, User* dest, int numeric, const std::str
        std::string copy_text = text;
 
        ModResult MOD_RESULT;
-       FIRST_MOD_RESULT(this, OnWhoisLine, MOD_RESULT, (user, dest, numeric, copy_text));
+       FIRST_MOD_RESULT(OnWhoisLine, MOD_RESULT, (user, dest, numeric, copy_text));
 
-       if (!MOD_RESULT)
+       if (MOD_RESULT != MOD_RES_DENY)
                user->WriteServ("%d %s", numeric, copy_text.c_str());
 }
 
index 0fc3535e21a9af0d5b4333d9f121d2ec05aade97..300d01650a1f9daf21bbb861aa374002defdf536 100644 (file)
@@ -317,20 +317,9 @@ void InspIRCd::WritePID(const std::string &filename)
 }
 
 InspIRCd::InspIRCd(int argc, char** argv) :
-        /* Functor initialisation. Note that the ordering here is very important.
-         *
-         * THIS MUST MATCH ORDER OF DECLARATION OF THE HandleWhateverFunc classes
-         * within class InspIRCd.
-         */
-        HandleIsNick(this),
-        HandleIsIdent(this),
-        HandleFloodQuitUser(this),
-        HandleIsChannel(this),
-        HandleIsSID(this),
-        HandleRehash(this),
         ConfigFileName("inspircd.conf"),
 
-        /* Functor pointer initialisation. Must match the order of the list above
+        /* Functor pointer initialisation.
          *
          * THIS MUST MATCH THE ORDER OF DECLARATION OF THE FUNCTORS, e.g. the methods
          * themselves within the class.
@@ -383,20 +372,20 @@ InspIRCd::InspIRCd(int argc, char** argv) :
        this->TIME = time(NULL);
 
        // This must be created first, so other parts of Insp can use it while starting up
-       this->Logs = new LogManager(this);
+       this->Logs = new LogManager;
 
        SocketEngineFactory SEF;
        SE = SEF.Create();
 
-       this->Threads = new ThreadEngine(this);
+       this->Threads = new ThreadEngine;
 
        /* Default implementation does nothing */
-       this->PI = new ProtocolInterface(this);
+       this->PI = new ProtocolInterface;
 
        this->s_signal = 0;
 
        // Create base manager classes early, so nothing breaks
-       this->Users = new UserManager(this);
+       this->Users = new UserManager;
 
        this->Users->unregistered_count = 0;
 
@@ -404,14 +393,14 @@ InspIRCd::InspIRCd(int argc, char** argv) :
        this->Users->uuidlist = new user_hash();
        this->chanlist = new chan_hash();
 
-       this->Config = new ServerConfig(this);
-       this->SNO = new SnomaskManager(this);
-       this->BanCache = new BanCacheManager(this);
+       this->Config = new ServerConfig;
+       this->SNO = new SnomaskManager;
+       this->BanCache = new BanCacheManager;
        this->Modules = new ModuleManager();
        this->stats = new serverstats();
-       this->Timers = new TimerManager(this);
-       this->Parser = new CommandParser(this);
-       this->XLines = new XLineManager(this);
+       this->Timers = new TimerManager;
+       this->Parser = new CommandParser;
+       this->XLines = new XLineManager;
 
        this->Config->argv = argv;
        this->Config->argc = argc;
@@ -484,7 +473,7 @@ InspIRCd::InspIRCd(int argc, char** argv) :
        // Handle forking
        if(!do_nofork)
        {
-               DWORD ExitCode = WindowsForkStart(this);
+               DWORD ExitCode = WindowsForkStart();
                if(ExitCode)
                        exit(ExitCode);
        }
@@ -492,7 +481,7 @@ InspIRCd::InspIRCd(int argc, char** argv) :
        // Set up winsock
        WSADATA wsadata;
        WSAStartup(MAKEWORD(2,0), &wsadata);
-       ChangeWindowsSpecificPointers(this);
+       ChangeWindowsSpecificPointers();
 #endif
        Config->MyExecutable = argv[0];
 
@@ -535,7 +524,7 @@ InspIRCd::InspIRCd(int argc, char** argv) :
        printf_c("\t\033[1;32mpeavey, aquanight, psychon, dz, danieldg\033[0m\n\n");
        printf_c("Others:\t\t\t\033[1;32mSee /INFO Output\033[0m\n");
 
-       this->Modes = new ModeParser(this);
+       this->Modes = new ModeParser;
 
        if (!do_root)
                this->CheckRoot();
@@ -573,7 +562,7 @@ InspIRCd::InspIRCd(int argc, char** argv) :
        this->Config->Apply(NULL, "");
        Logs->OpenFileLogs();
 
-       this->Res = new DNS(this);
+       this->Res = new DNS;
 
        this->AddServerName(Config->ServerName);
 
@@ -600,7 +589,7 @@ InspIRCd::InspIRCd(int argc, char** argv) :
        }
 
        /* set up fake client again this time with the correct uid */
-       this->FakeClient = new FakeUser(this, "!");
+       this->FakeClient = new FakeUser("!");
        this->FakeClient->SetFakeServer(Config->ServerName);
 
        // Get XLine to do it's thing.
@@ -660,10 +649,10 @@ InspIRCd::InspIRCd(int argc, char** argv) :
                }
        }
 #else
-       WindowsIPC = new IPC(this);
+       WindowsIPC = new IPC;
        if(!Config->nofork)
        {
-               WindowsForkKillOwner(this);
+               WindowsForkKillOwner();
                FreeConsole();
        }
        /* Set win32 service as running, if we are running as a service */
@@ -739,7 +728,7 @@ int InspIRCd::Run()
        /* See if we're supposed to be running the test suite rather than entering the mainloop */
        if (Config->TestSuite)
        {
-               TestSuite* ts = new TestSuite(this);
+               TestSuite* ts = new TestSuite;
                delete ts;
                Exit(0);
        }
@@ -793,7 +782,7 @@ int InspIRCd::Run()
                        if ((TIME % 3600) == 0)
                        {
                                this->RehashUsersAndChans();
-                               FOREACH_MOD_I(this, I_OnGarbageCollect, OnGarbageCollect());
+                               FOREACH_MOD(I_OnGarbageCollect, OnGarbageCollect());
                        }
 
                        Timers->TickTimers(TIME);
@@ -801,7 +790,7 @@ int InspIRCd::Run()
 
                        if ((TIME % 5) == 0)
                        {
-                               FOREACH_MOD_I(this,I_OnBackgroundTimer,OnBackgroundTimer(TIME));
+                               FOREACH_MOD(I_OnBackgroundTimer,OnBackgroundTimer(TIME));
                                SNO->FlushSnotices();
                        }
 #ifndef WIN32
@@ -852,7 +841,7 @@ int InspIRCd::Run()
 bool InspIRCd::AllModulesReportReady(User* user)
 {
        ModResult res;
-       FIRST_MOD_RESULT(this, OnCheckReady, res, (user));
+       FIRST_MOD_RESULT(OnCheckReady, res, (user));
        return (res == MOD_RES_PASSTHRU);
 }
 
index dfd2f11f7a7ad302233b2d641bebd07b0bbd0738..a8c7139598b84f158e0ab90ba9f694ed4ab8b278 100644 (file)
@@ -21,7 +21,7 @@
 irc::sockets::sockaddrs ListenSocketBase::client;
 irc::sockets::sockaddrs ListenSocketBase::server;
 
-ListenSocketBase::ListenSocketBase(InspIRCd* Instance, int port, const std::string &addr) : ServerInstance(Instance), desc("plaintext")
+ListenSocketBase::ListenSocketBase(int port, const std::string &addr) : desc("plaintext")
 {
        irc::sockets::sockaddrs bind_to;
 
@@ -44,20 +44,20 @@ ListenSocketBase::ListenSocketBase(InspIRCd* Instance, int port, const std::stri
 
        if (this->fd > -1)
        {
-               int rv = Instance->SE->Bind(this->fd, &bind_to.sa, sizeof(bind_to));
+               int rv = ServerInstance->SE->Bind(this->fd, &bind_to.sa, sizeof(bind_to));
                if (rv >= 0)
-                       rv = Instance->SE->Listen(this->fd, Instance->Config->MaxConn);
+                       rv = ServerInstance->SE->Listen(this->fd, ServerInstance->Config->MaxConn);
 
                if (rv < 0)
                {
-                       Instance->SE->Shutdown(this, 2);
-                       Instance->SE->Close(this);
+                       ServerInstance->SE->Shutdown(this, 2);
+                       ServerInstance->SE->Close(this);
                        this->fd = -1;
                }
                else
                {
-                       Instance->SE->NonBlocking(this->fd);
-                       Instance->SE->AddFd(this, FD_WANT_POLL_READ | FD_WANT_NO_WRITE);
+                       ServerInstance->SE->NonBlocking(this->fd);
+                       ServerInstance->SE->AddFd(this, FD_WANT_POLL_READ | FD_WANT_NO_WRITE);
                }
        }
 }
@@ -169,5 +169,5 @@ void ListenSocketBase::HandleEvent(EventType e, int err)
 
 void ClientListenSocket::OnAcceptReady(int nfd)
 {
-       ServerInstance->Users->AddUser(ServerInstance, nfd, this, &client, &server);
+       ServerInstance->Users->AddUser(nfd, this, &client, &server);
 }
index 049b4b5e7aa0883ca48fa77af7f4f3afdba443b1..e2baa4b8da4137b0434579b8b8a68a40a77865ad 100644 (file)
@@ -48,8 +48,8 @@ void LogManager::SetupNoFork()
 {
        if (!noforkstream)
        {
-               FileWriter* fw = new FileWriter(ServerInstance, stdout);
-               noforkstream = new FileLogStream(ServerInstance, ServerInstance->Config->forcedebug ? DEBUG : DEFAULT, fw);
+               FileWriter* fw = new FileWriter(stdout);
+               noforkstream = new FileLogStream(ServerInstance->Config->forcedebug ? DEBUG : DEFAULT, fw);
        }
        else
        {
@@ -70,7 +70,7 @@ void LogManager::OpenFileLogs()
        {
                return;
        }
-       ConfigReader* Conf = new ConfigReader(ServerInstance);
+       ConfigReader* Conf = new ConfigReader;
        std::map<std::string, FileWriter*> logmap;
        std::map<std::string, FileWriter*>::iterator i;
        for (int index = 0; index < Conf->Enumerate("log"); ++index)
@@ -109,14 +109,14 @@ void LogManager::OpenFileLogs()
                if ((i = logmap.find(target)) == logmap.end())
                {
                        FILE* f = fopen(target.c_str(), "a");
-                       fw = new FileWriter(ServerInstance, f);
+                       fw = new FileWriter(f);
                        logmap.insert(std::make_pair(target, fw));
                }
                else
                {
                        fw = i->second;
                }
-               FileLogStream* fls = new FileLogStream(ServerInstance, loglevel, fw);
+               FileLogStream* fls = new FileLogStream(loglevel, fw);
                AddLogTypes(type, fls, true);
        }
 }
@@ -330,8 +330,8 @@ void LogManager::Log(const std::string &type, int loglevel, const std::string &m
 }
 
 
-FileWriter::FileWriter(InspIRCd* Instance, FILE* logfile)
-: ServerInstance(Instance), log(logfile), writeops(0)
+FileWriter::FileWriter(FILE* logfile)
+: log(logfile), writeops(0)
 {
 }
 
index b7ee7b38500643e1abea6222cebae9f7dbd12890..4478dce73df3f09981da9f200a06b01182572679 100644 (file)
@@ -188,7 +188,7 @@ ModeAction SimpleChannelModeHandler::OnModeChange(User* source, User* dest, Chan
        return MODEACTION_DENY;
 }
 
-ModeWatcher::ModeWatcher(InspIRCd* Instance, char modeletter, ModeType type) : ServerInstance(Instance), mode(modeletter), m_type(type)
+ModeWatcher::ModeWatcher(char modeletter, ModeType type) : mode(modeletter), m_type(type)
 {
 }
 
@@ -268,7 +268,7 @@ ModeAction ModeParser::TryMode(User* user, User* targetuser, Channel* chan, bool
        int pcnt = mh->GetNumParams(adding);
 
        ModResult MOD_RESULT;
-       FIRST_MOD_RESULT(ServerInstance, OnRawMode, MOD_RESULT, (user, chan, modechar, parameter, adding, pcnt));
+       FIRST_MOD_RESULT(OnRawMode, MOD_RESULT, (user, chan, modechar, parameter, adding, pcnt));
 
        if (IS_LOCAL(user) && (MOD_RESULT == MOD_RES_DENY))
                return MODEACTION_DENY;
@@ -395,7 +395,7 @@ void ModeParser::Process(const std::vector<std::string>& parameters, User *user,
        else
        {
                ModResult MOD_RESULT;
-               FIRST_MOD_RESULT(ServerInstance, OnPreMode, MOD_RESULT, (user, targetuser, targetchannel, parameters));
+               FIRST_MOD_RESULT(OnPreMode, MOD_RESULT, (user, targetuser, targetchannel, parameters));
                if (MOD_RESULT == MOD_RES_DENY)
                        return;
                SkipAccessChecks = (MOD_RESULT == MOD_RES_ALLOW);
@@ -545,7 +545,7 @@ void ModeParser::DisplayListModes(User* user, Channel* chan, std::string &mode_s
                        return;
 
                ModResult MOD_RESULT;
-               FIRST_MOD_RESULT(ServerInstance, OnRawMode, MOD_RESULT, (user, chan, mletter, "", true, 0));
+               FIRST_MOD_RESULT(OnRawMode, MOD_RESULT, (user, chan, mletter, "", true, 0));
                if (MOD_RESULT == MOD_RES_DENY)
                        continue;
 
@@ -958,29 +958,29 @@ void ModeHandler::RemoveMode(Channel* channel, irc::modestacker* stack)
        }
 }
 
-ModeParser::ModeParser(InspIRCd* Instance)
+ModeParser::ModeParser()
 {
        ModeHandler* modes[] =
        {
-               new ModeChannelSecret(Instance),
-               new ModeChannelPrivate(Instance),
-               new ModeChannelModerated(Instance),
-               new ModeChannelTopicOps(Instance),
-
-               new ModeChannelNoExternal(Instance),
-               new ModeChannelInviteOnly(Instance),
-               new ModeChannelKey(Instance),
-               new ModeChannelLimit(Instance),
-
-               new ModeChannelBan(Instance),
-               new ModeChannelOp(Instance),
-               new ModeChannelHalfOp(Instance),
-               new ModeChannelVoice(Instance),
-
-               new ModeUserWallops(Instance),
-               new ModeUserInvisible(Instance),
-               new ModeUserOperator(Instance),
-               new ModeUserServerNoticeMask(Instance),
+               new ModeChannelSecret,
+               new ModeChannelPrivate,
+               new ModeChannelModerated,
+               new ModeChannelTopicOps,
+
+               new ModeChannelNoExternal,
+               new ModeChannelInviteOnly,
+               new ModeChannelKey,
+               new ModeChannelLimit,
+
+               new ModeChannelBan,
+               new ModeChannelOp,
+               new ModeChannelHalfOp,
+               new ModeChannelVoice,
+
+               new ModeUserWallops,
+               new ModeUserInvisible,
+               new ModeUserOperator,
+               new ModeUserServerNoticeMask,
 #define BUILTIN_MODE_COUNT 16
        };
 
index d9ecb5b07a7ad548137b5abd17aa4fb08a7f16a6..119660ff54aa25b713ed87c3c8db00cb8c5c4c63 100644 (file)
@@ -25,7 +25,7 @@
 #include "hashcomp.h"
 #include "modes/cmode_b.h"
 
-ModeChannelBan::ModeChannelBan(InspIRCd* Instance) : ModeHandler(NULL, 'b', PARAM_ALWAYS, MODETYPE_CHANNEL)
+ModeChannelBan::ModeChannelBan() : ModeHandler(NULL, 'b', PARAM_ALWAYS, MODETYPE_CHANNEL)
 {
        list = true;
 }
@@ -117,7 +117,7 @@ std::string& ModeChannelBan::AddBan(User *user, std::string &dest, Channel *chan
        }
 
        ModResult MOD_RESULT;
-       FIRST_MOD_RESULT(ServerInstance, OnAddBan, MOD_RESULT, (user,chan,dest));
+       FIRST_MOD_RESULT(OnAddBan, MOD_RESULT, (user,chan,dest));
        if (MOD_RESULT == MOD_RES_DENY)
        {
                dest = "";
@@ -170,7 +170,7 @@ std::string& ModeChannelBan::DelBan(User *user, std::string& dest, Channel *chan
                if (!strcasecmp(i->data.c_str(), dest.c_str()))
                {
                        ModResult MOD_RESULT;
-                       FIRST_MOD_RESULT(ServerInstance, OnDelBan, MOD_RESULT, (user, chan, dest));
+                       FIRST_MOD_RESULT(OnDelBan, MOD_RESULT, (user, chan, dest));
                        if (MOD_RESULT == MOD_RES_DENY)
                        {
                                dest = "";
index 927c7ea7366b956d63539e0409d2b544f650452d..d5472c154650f035dc6239e2c70f6dad9a6a2cf8 100644 (file)
@@ -19,7 +19,7 @@
 #include "modules.h"
 #include "modes/cmode_h.h"
 
-ModeChannelHalfOp::ModeChannelHalfOp(InspIRCd* Instance) : ModeHandler(NULL, 'h', PARAM_ALWAYS, MODETYPE_CHANNEL)
+ModeChannelHalfOp::ModeChannelHalfOp() : ModeHandler(NULL, 'h', PARAM_ALWAYS, MODETYPE_CHANNEL)
 {
        list = true;
        prefix = '%';
index 60183b001186065122fa5ffd9024371ab8342137..ac9245d62775e319f836ed94eba762eef18135ab 100644 (file)
@@ -17,7 +17,7 @@
 #include "users.h"
 #include "modes/cmode_i.h"
 
-ModeChannelInviteOnly::ModeChannelInviteOnly(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, NULL, 'i')
+ModeChannelInviteOnly::ModeChannelInviteOnly() : SimpleChannelModeHandler(NULL, 'i')
 {
 }
 
index ea035e7b888431473b3312e685961ae3cf93d549..4105660d11d5183a6090d334a06fe5d0e1f6f61a 100644 (file)
@@ -17,7 +17,7 @@
 #include "users.h"
 #include "modes/cmode_k.h"
 
-ModeChannelKey::ModeChannelKey(InspIRCd* Instance) : ModeHandler(NULL, 'k', PARAM_ALWAYS, MODETYPE_CHANNEL)
+ModeChannelKey::ModeChannelKey() : ModeHandler(NULL, 'k', PARAM_ALWAYS, MODETYPE_CHANNEL)
 {
 }
 
index 1aea53a612c84a48cad423d5de399e727270aeee..aa713ec560d1ad95f7ffaaf17bb0968d16236778 100644 (file)
@@ -17,7 +17,7 @@
 #include "users.h"
 #include "modes/cmode_l.h"
 
-ModeChannelLimit::ModeChannelLimit(InspIRCd* Instance) : ModeHandler(NULL, 'l', PARAM_SETONLY, MODETYPE_CHANNEL)
+ModeChannelLimit::ModeChannelLimit() : ModeHandler(NULL, 'l', PARAM_SETONLY, MODETYPE_CHANNEL)
 {
 }
 
index 1e40e9a168d4e6eb8042ac28ea5155cc7f1b39f5..13f39fd796443056af740c21c31ebf7236bdebcb 100644 (file)
@@ -17,7 +17,7 @@
 #include "users.h"
 #include "modes/cmode_m.h"
 
-ModeChannelModerated::ModeChannelModerated(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, NULL, 'm')
+ModeChannelModerated::ModeChannelModerated() : SimpleChannelModeHandler(NULL, 'm')
 {
 }
 
index bdc3521a5b89d1b4a96d13fe0d877dbdac58313c..4aac083e05128eb22eb40086258417bc0d5171c2 100644 (file)
@@ -17,7 +17,7 @@
 #include "users.h"
 #include "modes/cmode_n.h"
 
-ModeChannelNoExternal::ModeChannelNoExternal(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, NULL, 'n')
+ModeChannelNoExternal::ModeChannelNoExternal() : SimpleChannelModeHandler(NULL, 'n')
 {
 }
 
index 8af364ad48e32251fb7e20d0b7aad4edae49af45..8160a38a648afc46d893d7679d412b0bd621dcad 100644 (file)
@@ -19,7 +19,7 @@
 #include "modules.h"
 #include "modes/cmode_o.h"
 
-ModeChannelOp::ModeChannelOp(InspIRCd* Instance) : ModeHandler(NULL, 'o', PARAM_ALWAYS, MODETYPE_CHANNEL)
+ModeChannelOp::ModeChannelOp() : ModeHandler(NULL, 'o', PARAM_ALWAYS, MODETYPE_CHANNEL)
 {
        list = true;
        prefix = '@';
index d5f52eb78cf31a1e6091f072916d052d8b045dd8..92f44f18aed55f12ac2eafee18f810b63774a624 100644 (file)
@@ -17,7 +17,7 @@
 #include "users.h"
 #include "modes/cmode_p.h"
 
-ModeChannelPrivate::ModeChannelPrivate(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, NULL, 'p')
+ModeChannelPrivate::ModeChannelPrivate() : SimpleChannelModeHandler(NULL, 'p')
 {
 }
 
index d5ec5bbed25592dbac25fb1666717e7c24c37f21..486520899856faa44323595079980d20a0abdb64 100644 (file)
@@ -17,7 +17,7 @@
 #include "users.h"
 #include "modes/cmode_s.h"
 
-ModeChannelSecret::ModeChannelSecret(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, NULL, 's')
+ModeChannelSecret::ModeChannelSecret() : SimpleChannelModeHandler(NULL, 's')
 {
 }
 
index b3f266086327777100da1d528e51cea288e3f604..627717f33356fbcd7ece0ab6953e04d529eb65a5 100644 (file)
@@ -17,7 +17,7 @@
 #include "users.h"
 #include "modes/cmode_t.h"
 
-ModeChannelTopicOps::ModeChannelTopicOps(InspIRCd* Instance) : ModeHandler(NULL, 't', PARAM_NONE, MODETYPE_CHANNEL)
+ModeChannelTopicOps::ModeChannelTopicOps() : ModeHandler(NULL, 't', PARAM_NONE, MODETYPE_CHANNEL)
 {
 }
 
index 76faa8aaecba1b0eaf416b6ffc80aaea6716e50f..f744623a609db02e690313b1aff2b681c9386277 100644 (file)
@@ -20,7 +20,7 @@
 #include "modules.h"
 #include "modes/cmode_v.h"
 
-ModeChannelVoice::ModeChannelVoice(InspIRCd* Instance) : ModeHandler(NULL, 'v', PARAM_ALWAYS, MODETYPE_CHANNEL)
+ModeChannelVoice::ModeChannelVoice() : ModeHandler(NULL, 'v', PARAM_ALWAYS, MODETYPE_CHANNEL)
 {
        list = true;
        prefix = '+';
index 5c7c41b629948e0c528d00b5df99181418e048c2..515ffd10e52ba8f997d9b4c3e93d5ad79838a131 100644 (file)
@@ -17,7 +17,7 @@
 #include "users.h"
 #include "modes/umode_i.h"
 
-ModeUserInvisible::ModeUserInvisible(InspIRCd* Instance) : SimpleUserModeHandler(NULL, 'i')
+ModeUserInvisible::ModeUserInvisible() : SimpleUserModeHandler(NULL, 'i')
 {
 }
 
index ec9b4ad5b5a9efc491a371a573c289d2db340fea..1d6992144a9b793783a1c27e2064ecbbe729344e 100644 (file)
@@ -17,7 +17,7 @@
 #include "users.h"
 #include "modes/umode_o.h"
 
-ModeUserOperator::ModeUserOperator(InspIRCd* Instance) : ModeHandler(NULL, 'o', PARAM_NONE, MODETYPE_USER)
+ModeUserOperator::ModeUserOperator() : ModeHandler(NULL, 'o', PARAM_NONE, MODETYPE_USER)
 {
        oper = true;
 }
index abfc480d9cd92a1177aa502e18108f15dd29ca7b..9d4d0932929cc18afb6077cdeded724c2fb86b7c 100644 (file)
@@ -17,7 +17,7 @@
 #include "users.h"
 #include "modes/umode_s.h"
 
-ModeUserServerNoticeMask::ModeUserServerNoticeMask(InspIRCd* Instance) : ModeHandler(NULL, 's', PARAM_SETONLY, MODETYPE_USER)
+ModeUserServerNoticeMask::ModeUserServerNoticeMask() : ModeHandler(NULL, 's', PARAM_SETONLY, MODETYPE_USER)
 {
        oper = true;
 }
index 8cc31094db91fb823e9a930342b0b02eca43cfe3..e1608169eddb60f0fd46c732b13b930954f36dd4 100644 (file)
@@ -17,7 +17,7 @@
 #include "users.h"
 #include "modes/umode_w.h"
 
-ModeUserWallops::ModeUserWallops(InspIRCd* Instance) : SimpleUserModeHandler(NULL, 'w')
+ModeUserWallops::ModeUserWallops() : SimpleUserModeHandler(NULL, 'w')
 {
 }
 
index d38496444160842ed986a3b01c071e5ccb719827..9e775ed1e2c109cc340ec7e9a60aa5115f7afb52 100644 (file)
@@ -90,7 +90,7 @@ Module* Event::GetSource()
        return this->source;
 }
 
-char* Event::Send(InspIRCd* SI)
+char* Event::Send()
 {
        FOREACH_MOD(I_OnEvent,OnEvent(this));
        return NULL;
@@ -104,7 +104,7 @@ std::string Event::GetEventID()
 
 // These declarations define the behavours of the base class Module (which does nothing at all)
 
-Module::Module(InspIRCd*) { }
+Module::Module() { }
 Module::~Module() { }
 
 ModResult      Module::OnSendSnotice(char &snomask, std::string &type, const std::string &message) { return MOD_RES_PASSTHRU; }
@@ -426,7 +426,7 @@ bool ModuleManager::Load(const char* filename)
                /* This will throw a CoreException if there's a problem loading
                 * the module file or getting a pointer to the init_module symbol.
                 */
-               newhandle = new ircd_module(ServerInstance, modfile, "init_module");
+               newhandle = new ircd_module(modfile, "init_module");
                newmod = newhandle->CallInit();
 
                if (newmod)
@@ -494,7 +494,7 @@ bool ModuleManager::Load(const char* filename)
        }
 
        this->ModCount++;
-       FOREACH_MOD_I(ServerInstance,I_OnLoadModule,OnLoadModule(newmod, filename_str));
+       FOREACH_MOD(I_OnLoadModule,OnLoadModule(newmod, filename_str));
 
        /* We give every module a chance to re-prioritize when we introduce a new one,
         * not just the one thats loading, as the new module could affect the preference
@@ -556,7 +556,7 @@ bool ModuleManager::Unload(const char* filename)
                /* Tidy up any dangling resolvers */
                ServerInstance->Res->CleanResolvers(modfind->second.second);
 
-               FOREACH_MOD_I(ServerInstance,I_OnUnloadModule,OnUnloadModule(modfind->second.second, modfind->first));
+               FOREACH_MOD(I_OnUnloadModule,OnUnloadModule(modfind->second.second, modfind->first));
 
                this->DetachAll(modfind->second.second);
 
@@ -877,7 +877,7 @@ const std::vector<std::string> ModuleManager::GetAllModuleNames(int filter)
        return retval;
 }
 
-ConfigReader::ConfigReader(InspIRCd* Instance)
+ConfigReader::ConfigReader()
 {
        this->error = 0;
 }
@@ -957,12 +957,12 @@ int ConfigReader::EnumerateValues(const std::string &tag, int index)
        return ServerInstance->Config->ConfVarEnum(tag, index);
 }
 
-FileReader::FileReader(InspIRCd* Instance, const std::string &filename)
+FileReader::FileReader(const std::string &filename)
 {
        LoadFile(filename);
 }
 
-FileReader::FileReader(InspIRCd* Instance)
+FileReader::FileReader()
 {
 }
 
index d442cc16d321ab7fe5a28c23a29ab4950cb367d4..13b35fdfbd6586bf15ce78b48494da206ffcd157 100644 (file)
@@ -29,8 +29,7 @@ class ModuleGeoIP : public Module
 
 
  public:
-       ModuleGeoIP(InspIRCd *Me) : Module(Me)
-       {
+       ModuleGeoIP()   {
                OnRehash(NULL);
                Implementation eventlist[] = { I_OnRehash, I_OnUserRegister };
                ServerInstance->Modules->Attach(eventlist, this, 2);
@@ -51,7 +50,7 @@ class ModuleGeoIP : public Module
        {
                GeoBans.clear();
 
-               ConfigReader conf(ServerInstance);
+               ConfigReader conf;
 
                banunknown = conf.ReadFlag("geoip", "banunknown", 0);
 
index 45202e6fa708c91965a137c6bd3b667a7f3a5264..6fa5abfe7705666beb7ee2a0f1888d82febafa2f 100644 (file)
@@ -46,9 +46,8 @@ class ModuleLDAPAuth : public Module
        LDAP *conn;
 
 public:
-       ModuleLDAPAuth(InspIRCd* Me)
-       : Module(Me)
-       {
+       ModuleLDAPAuth()
+               {
                conn = NULL;
                Implementation eventlist[] = { I_OnUserDisconnect, I_OnCheckReady, I_OnRehash, I_OnUserRegister };
                ServerInstance->Modules->Attach(eventlist, this, 4);
@@ -63,7 +62,7 @@ public:
 
        virtual void OnRehash(User* user)
        {
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
 
                base                    = Conf.ReadValue("ldapauth", "baserdn", 0);
                attribute               = Conf.ReadValue("ldapauth", "attribute", 0);
index ed06d68904aa82313232346beabc7981cb675106..634a99fa78233615ffeed6e369808f0c4d6be541 100644 (file)
@@ -41,9 +41,8 @@ class ModuleLDAPAuth : public Module
        LDAP *conn;
 
 public:
-       ModuleLDAPAuth(InspIRCd* Me)
-       : Module(Me)
-       {
+       ModuleLDAPAuth()
+               {
                conn = NULL;
                Implementation eventlist[] = { I_OnRehash, I_OnPassCompare };
                ServerInstance->Modules->Attach(eventlist, this, 2);
@@ -58,7 +57,7 @@ public:
 
        virtual void OnRehash(User* user)
        {
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
 
                base                    = Conf.ReadValue("ldapoper", "baserdn", 0);
                ldapserver              = Conf.ReadValue("ldapoper", "server", 0);
index f588586968c538bc728f3ad7f21a4b662bbfb70d..8cd9e2ea7a955f103de3376b113a7ea51fa56d52 100644 (file)
@@ -51,11 +51,9 @@ class QueryThread : public SocketThread
 {
   private:
        ModuleMsSQL* Parent;
-       InspIRCd* ServerInstance;
   public:
-       QueryThread(InspIRCd* si, ModuleMsSQL* mod)
-       : SocketThread(si), Parent(mod), ServerInstance(si)
-       {
+       QueryThread(ModuleMsSQL* mod)
+       : SocketThread(si), Parent(mod),        {
        }
        ~QueryThread() { }
        virtual void Run();
@@ -232,7 +230,6 @@ class SQLConn : public classbase
 {
  private:
        ResultQueue results;
-       InspIRCd* ServerInstance;
        Module* mod;
        SQLhost host;
        TDSLOGIN* login;
@@ -242,8 +239,8 @@ class SQLConn : public classbase
  public:
        QueryQueue queue;
 
-       SQLConn(InspIRCd* SI, Module* m, const SQLhost& hi)
-       : ServerInstance(SI), mod(m), host(hi), login(NULL), sock(NULL), context(NULL)
+       SQLConn(Module* m, const SQLhost& hi)
+       : mod(m), host(hi), login(NULL), sock(NULL), context(NULL)
        {
                if (OpenDB())
                {
@@ -643,8 +640,8 @@ class ModuleMsSQL : public Module
        QueryThread* queryDispatcher;
 
  public:
-       ModuleMsSQL(InspIRCd* Me)
-       : Module(Me), currid(0)
+       ModuleMsSQL()
+       : currid(0)
        {
                LoggingMutex = new Mutex();
                ResultsMutex = new Mutex();
@@ -658,7 +655,7 @@ class ModuleMsSQL : public Module
 
                ReadConf();
 
-               queryDispatcher = new QueryThread(ServerInstance, this);
+               queryDispatcher = new QueryThread(this);
                ServerInstance->Threads->Start(queryDispatcher);
 
                ServerInstance->Modules->PublishInterface("SQL", this);
@@ -709,7 +706,7 @@ class ModuleMsSQL : public Module
 
        bool HostInConf(const SQLhost &h)
        {
-               ConfigReader conf(ServerInstance);
+               ConfigReader conf;
                for(int i = 0; i < conf.Enumerate("database"); i++)
                {
                        SQLhost host;
@@ -729,7 +726,7 @@ class ModuleMsSQL : public Module
        {
                ClearOldConnections();
 
-               ConfigReader conf(ServerInstance);
+               ConfigReader conf;
                for(int i = 0; i < conf.Enumerate("database"); i++)
                {
                        SQLhost host;
@@ -760,7 +757,7 @@ class ModuleMsSQL : public Module
 
                SQLConn* newconn;
 
-               newconn = new SQLConn(ServerInstance, this, hi);
+               newconn = new SQLConn(this, hi);
 
                connections.insert(std::make_pair(hi.id, newconn));
        }
index 3718eecf85284768a0cd08b36cdb7e1f4742cb3f..023ead94be6dfef950b6542fd4113b28ae3c6093 100644 (file)
@@ -89,7 +89,6 @@ class ModuleSQL : public Module
  public:
 
         ConfigReader *Conf;
-        InspIRCd* PublicServerInstance;
         int currid;
         bool rehashing;
         DispatcherThread* Dispatcher;
@@ -97,7 +96,7 @@ class ModuleSQL : public Module
         Mutex LoggingMutex;
         Mutex ConnMutex;
 
-        ModuleSQL(InspIRCd* Me);
+        ModuleSQL();
         ~ModuleSQL();
         unsigned long NewID();
         const char* OnRequest(Request* request);
@@ -593,7 +592,7 @@ void ClearAllConnections()
        }
 }
 
-void ConnectDatabases(InspIRCd* ServerInstance, ModuleSQL* Parent)
+void ConnectDatabases(ModuleSQL* Parent)
 {
        for (ConnMap::iterator i = Connections.begin(); i != Connections.end(); i++)
        {
@@ -612,7 +611,7 @@ void ConnectDatabases(InspIRCd* ServerInstance, ModuleSQL* Parent)
        }
 }
 
-void LoadDatabases(ConfigReader* conf, InspIRCd* ServerInstance, ModuleSQL* Parent)
+void LoadDatabases(ConfigReader* conf, ModuleSQL* Parent)
 {
        Parent->ConnMutex.Lock();
        ClearOldConnections(conf);
@@ -639,7 +638,7 @@ void LoadDatabases(ConfigReader* conf, InspIRCd* ServerInstance, ModuleSQL* Pare
                        ThisSQL->setInitialQuery(initquery);
                }
        }
-       ConnectDatabases(ServerInstance, Parent);
+       ConnectDatabases(Parent);
        Parent->ConnMutex.Unlock();
 }
 
@@ -673,23 +672,22 @@ class DispatcherThread : public SocketThread
 {
  private:
        ModuleSQL* Parent;
-       InspIRCd* ServerInstance;
  public:
-       DispatcherThread(InspIRCd* Instance, ModuleSQL* CreatorModule) : SocketThread(Instance), Parent(CreatorModule), ServerInstance(Instance) { }
+       DispatcherThread(ModuleSQL* CreatorModule) : SocketThread(Instance), Parent(CreatorModule),{ }
        ~DispatcherThread() { }
        virtual void Run();
        virtual void OnNotify();
 };
 
-ModuleSQL::ModuleSQL(InspIRCd* Me) : Module(Me), rehashing(false)
+ModuleSQL::ModuleSQL() : rehashing(false)
 {
        ServerInstance->Modules->UseInterface("SQLutils");
 
-       Conf = new ConfigReader(ServerInstance);
+       Conf = new ConfigReader;
        PublicServerInstance = ServerInstance;
        currid = 0;
 
-       Dispatcher = new DispatcherThread(ServerInstance, this);
+       Dispatcher = new DispatcherThread(this);
        ServerInstance->Threads->Start(Dispatcher);
 
        if (!ServerInstance->Modules->PublishFeature("SQL", this))
index c61e0983cf103f53c505a98e2a0a6298b1956709..c0d301107e9488d177da328feb6ab0e4d3fb85a2 100644 (file)
@@ -93,7 +93,7 @@ class ReconnectTimer : public Timer
  private:
        Module* mod;
  public:
-       ReconnectTimer(InspIRCd* SI, Module* m)
+       ReconnectTimer(Module* m)
        : Timer(5, SI->Time(), false), mod(m)
        {
        }
@@ -301,7 +301,6 @@ public:
 class SQLConn : public EventHandler
 {
  private:
-       InspIRCd*               ServerInstance;
        SQLhost                 confhost;       /* The <database> entry */
        Module*                 us;                     /* Pointer to the SQL provider itself */
        PGconn*                 sql;            /* PgSQL database connection handle */
@@ -311,8 +310,8 @@ class SQLConn : public EventHandler
        time_t                  idle;           /* Time we last heard from the database */
 
  public:
-       SQLConn(InspIRCd* SI, Module* self, const SQLhost& hi)
-       : EventHandler(), ServerInstance(SI), confhost(hi), us(self), sql(NULL), status(CWRITE), qinprog(false)
+       SQLConn(Module* self, const SQLhost& hi)
+       : EventHandler(), confhost(hi), us(self), sql(NULL), status(CWRITE), qinprog(false)
        {
                idle = this->ServerInstance->Time();
                if(!DoConnect())
@@ -763,8 +762,8 @@ class ModulePgSQL : public Module
        ReconnectTimer* retimer;
 
  public:
-       ModulePgSQL(InspIRCd* Me)
-       : Module(Me), currid(0)
+       ModulePgSQL()
+       : currid(0)
        {
                ServerInstance->Modules->UseInterface("SQLutils");
 
@@ -813,7 +812,7 @@ class ModulePgSQL : public Module
 
        bool HostInConf(const SQLhost &h)
        {
-               ConfigReader conf(ServerInstance);
+               ConfigReader conf;
                for(int i = 0; i < conf.Enumerate("database"); i++)
                {
                        SQLhost host;
@@ -834,7 +833,7 @@ class ModulePgSQL : public Module
        {
                ClearOldConnections();
 
-               ConfigReader conf(ServerInstance);
+               ConfigReader conf;
                for(int i = 0; i < conf.Enumerate("database"); i++)
                {
                        SQLhost host;
@@ -889,7 +888,7 @@ class ModulePgSQL : public Module
 
                SQLConn* newconn;
 
-               newconn = new SQLConn(ServerInstance, this, hi);
+               newconn = new SQLConn(this, hi);
 
                connections.insert(std::make_pair(hi.id, newconn));
        }
@@ -905,7 +904,7 @@ class ModulePgSQL : public Module
                                break;
                        }
                }
-               retimer = new ReconnectTimer(ServerInstance, this);
+               retimer = new ReconnectTimer(this);
                ServerInstance->Timers->AddTimer(retimer);
        }
 
index 5254f04a678d731ebdcae113b87069371d3e5ae7..4389ad6858db42da6c6fae90fb25bedeabc5f181 100644 (file)
@@ -39,14 +39,14 @@ private:
        pcre* regex;
 
 public:
-       PCRERegex(const std::string& rx, InspIRCd* Me) : Regex(rx, Me)
+       PCRERegex(const std::string& rx, ) : Regex(rx, Me)
        {
                const char* error;
                int erroffset;
                regex = pcre_compile(rx.c_str(), 0, &error, &erroffset, NULL);
                if (!regex)
                {
-                       Me->Logs->Log("REGEX", DEBUG, "pcre_compile failed: /%s/ [%d] %s", rx.c_str(), erroffset, error);
+                       ServerInstance->Logs->Log("REGEX", DEBUG, "pcre_compile failed: /%s/ [%d] %s", rx.c_str(), erroffset, error);
                        throw PCREException(rx, error, erroffset);
                }
        }
@@ -70,11 +70,10 @@ public:
 class ModuleRegexPCRE : public Module
 {
 public:
-       ModuleRegexPCRE(InspIRCd* Me) : Module(Me)
-       {
-               Me->Modules->PublishInterface("RegularExpression", this);
+       ModuleRegexPCRE()       {
+               ServerInstance->Modules->PublishInterface("RegularExpression", this);
                Implementation eventlist[] = { I_OnRequest };
-               Me->Modules->Attach(eventlist, this, 1);
+               ServerInstance->Modules->Attach(eventlist, this, 1);
        }
 
        virtual Version GetVersion()
index 34a7e9babdccee00a537131e3d848ea07da95770..5fe4db29fb35d8835b56030802ae06a2419d534b 100644 (file)
@@ -34,7 +34,7 @@ private:
        regex_t regbuf;
 
 public:
-       POSIXRegex(const std::string& rx, InspIRCd* Me, bool extended) : Regex(rx, Me)
+       POSIXRegex(const std::string& rx, bool extended) : Regex(rx, Me)
        {
                int flags = (extended ? REG_EXTENDED : 0) | REG_NOSUB;
                int errcode;
@@ -76,11 +76,10 @@ class ModuleRegexPOSIX : public Module
 private:
        bool extended;
 public:
-       ModuleRegexPOSIX(InspIRCd* Me) : Module(Me)
-       {
-               Me->Modules->PublishInterface("RegularExpression", this);
+       ModuleRegexPOSIX()      {
+               ServerInstance->Modules->PublishInterface("RegularExpression", this);
                Implementation eventlist[] = { I_OnRequest, I_OnRehash };
-               Me->Modules->Attach(eventlist, this, 2);
+               ServerInstance->Modules->Attach(eventlist, this, 2);
                OnRehash(NULL);
        }
 
@@ -96,7 +95,7 @@ public:
 
        virtual void OnRehash(User* u)
        {
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
                extended = Conf.ReadFlag("posix", "extended", 0);
        }
 
index c50429a5ef009123fcebd6fd6b5165940ccad332..1ed35605b7d2d11efd5fe76dc5d403b99cad40d1 100644 (file)
@@ -36,7 +36,7 @@ private:
        regex_t regbuf;
 
 public:
-       TRERegex(const std::string& rx, InspIRCd* Me) : Regex(rx, Me)
+       TRERegex(const std::string& rx, ) : Regex(rx, Me)
        {
                int flags = REG_EXTENDED | REG_NOSUB;
                int errcode;
@@ -76,11 +76,10 @@ public:
 class ModuleRegexTRE : public Module
 {
 public:
-       ModuleRegexTRE(InspIRCd* Me) : Module(Me)
-       {
-               Me->Modules->PublishInterface("RegularExpression", this);
+       ModuleRegexTRE()        {
+               ServerInstance->Modules->PublishInterface("RegularExpression", this);
                Implementation eventlist[] = { I_OnRequest };
-               Me->Modules->Attach(eventlist, this, 1);
+               ServerInstance->Modules->Attach(eventlist, this, 1);
        }
 
        virtual Version GetVersion()
index 1f2df8a1a0cd5f77266975a716dfdce1eaff313d..d7c0675bb2ce663361305c731507709d92388e13 100644 (file)
@@ -32,9 +32,8 @@ class ModuleSQLAuth : public Module
        bool verbose;
 
 public:
-       ModuleSQLAuth(InspIRCd* Me)
-       : Module(Me)
-       {
+       ModuleSQLAuth()
+               {
                ServerInstance->Modules->UseInterface("SQLutils");
                ServerInstance->Modules->UseInterface("SQL");
 
@@ -60,7 +59,7 @@ public:
 
        virtual void OnRehash(User* user)
        {
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
 
                databaseid      = Conf.ReadValue("sqlauth", "dbid", 0);                 /* Database ID, given to the SQL service provider */
                freeformquery   = Conf.ReadValue("sqlauth", "query", 0);        /* Field name where username can be found */
index 86b2cb3789d1c1997ba86a3954aea9084f22ed96..0631131023be98de60058ec17e891a7cb3d9464e 100644 (file)
@@ -51,7 +51,7 @@ class ResultNotifier : public BufferedSocket
        ModuleSQLite3* mod;
 
  public:
-       ResultNotifier(ModuleSQLite3* m, InspIRCd* SI, int newfd, char* ip) : BufferedSocket(SI, newfd, ip), mod(m)
+       ResultNotifier(ModuleSQLite3* m, int newfd, char* ip) : BufferedSocket(SI, newfd, ip), mod(m)
        {
        }
 
@@ -77,7 +77,7 @@ class SQLiteListener : public ListenSocketBase
        FileReader* index;
 
  public:
-       SQLiteListener(ModuleSQLite3* P, InspIRCd* Instance, int port, const std::string &addr) : ListenSocketBase(Instance, port, addr), Parent(P)
+       SQLiteListener(ModuleSQLite3* P, int port, const std::string &addr) : ListenSocketBase(port, addr), Parent(P)
        {
                uslen = sizeof(sock_us);
                if (getsockname(this->fd,(sockaddr*)&sock_us,&uslen))
@@ -274,14 +274,13 @@ class SQLConn : public classbase
 {
  private:
        ResultQueue results;
-       InspIRCd* ServerInstance;
        Module* mod;
        SQLhost host;
        sqlite3* conn;
 
  public:
-       SQLConn(InspIRCd* SI, Module* m, const SQLhost& hi)
-       : ServerInstance(SI), mod(m), host(hi)
+       SQLConn(Module* m, const SQLhost& hi)
+       : mod(m), host(hi)
        {
                if (OpenDB() != SQLITE_OK)
                {
@@ -543,8 +542,8 @@ class ModuleSQLite3 : public Module
        unsigned long currid;
 
  public:
-       ModuleSQLite3(InspIRCd* Me)
-       : Module(Me), currid(0)
+       ModuleSQLite3()
+       : currid(0)
        {
                ServerInstance->Modules->UseInterface("SQLutils");
 
@@ -632,7 +631,7 @@ class ModuleSQLite3 : public Module
 
        bool HostInConf(const SQLhost &h)
        {
-               ConfigReader conf(ServerInstance);
+               ConfigReader conf;
                for(int i = 0; i < conf.Enumerate("database"); i++)
                {
                        SQLhost host;
@@ -652,7 +651,7 @@ class ModuleSQLite3 : public Module
        {
                ClearOldConnections();
 
-               ConfigReader conf(ServerInstance);
+               ConfigReader conf;
                for(int i = 0; i < conf.Enumerate("database"); i++)
                {
                        SQLhost host;
@@ -681,7 +680,7 @@ class ModuleSQLite3 : public Module
 
                SQLConn* newconn;
 
-               newconn = new SQLConn(ServerInstance, this, hi);
+               newconn = new SQLConn(this, hi);
 
                connections.insert(std::make_pair(hi.id, newconn));
        }
index 556cc8b31c33f04bd2ee806571b67213de21b392..4713f24a973dfb1cf3a5312166f0efcd84f3cc00 100644 (file)
@@ -28,8 +28,6 @@ std::map<unsigned long,QueryInfo*> active_queries;
 
 class QueryInfo
 {
-private:
-       InspIRCd* ServerInstance;
 public:
        QueryState qs;
        unsigned long id;
@@ -43,7 +41,7 @@ public:
        time_t date;
        bool insert;
 
-       QueryInfo(InspIRCd* Instance, const std::string &n, const std::string &s, const std::string &h, unsigned long i, int cat)
+       QueryInfo(const std::string &n, const std::string &s, const std::string &h, unsigned long i, int cat)
        {
                ServerInstance = Instance;
                qs = FIND_SOURCE;
@@ -183,9 +181,8 @@ class ModuleSQLLog : public Module
 {
 
  public:
-       ModuleSQLLog(InspIRCd* Me)
-       : Module(Me)
-       {
+       ModuleSQLLog()
+               {
                ServerInstance->Modules->UseInterface("SQLutils");
                ServerInstance->Modules->UseInterface("SQL");
 
@@ -213,7 +210,7 @@ class ModuleSQLLog : public Module
 
        void ReadConfig()
        {
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
                dbid = Conf.ReadValue("sqllog","dbid",0);       // database id of a database configured in sql module
        }
 
@@ -253,7 +250,7 @@ class ModuleSQLLog : public Module
                SQLrequest req = SQLrequest(this, SQLModule, dbid, SQLquery("SELECT id,actor FROM ircd_log_actors WHERE actor='?'") % source);
                if(req.Send())
                {
-                       QueryInfo* i = new QueryInfo(ServerInstance, nick, source, host, req.id, category);
+                       QueryInfo* i = new QueryInfo(nick, source, host, req.id, category);
                        i->qs = FIND_SOURCE;
                        active_queries[req.id] = i;
                }
index 3b0e6e2265042fd3caeb23ab987fff03ec9394d6..47aa8d1fd2b32afca2c93f4b36b0f5b2b7068263 100644 (file)
@@ -32,9 +32,8 @@ class ModuleSQLOper : public Module
        parameterlist names;
 
 public:
-       ModuleSQLOper(InspIRCd* Me)
-       : Module(Me)
-       {
+       ModuleSQLOper()
+               {
                ServerInstance->Modules->UseInterface("SQLutils");
                ServerInstance->Modules->UseInterface("SQL");
                ServerInstance->Modules->UseInterface("HashRequest");
@@ -114,7 +113,7 @@ public:
 
        virtual void OnRehash(User* user)
        {
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
 
                databaseid = Conf.ReadValue("sqloper", "dbid", 0); /* Database ID of a database configured for the service provider module */
                hashtype = assign(Conf.ReadValue("sqloper", "hash", 0));
@@ -298,7 +297,7 @@ public:
 
        bool OperUser(User* user, const std::string &pattern, const std::string &type)
        {
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
 
                for (int j = 0; j < Conf.Enumerate("type"); j++)
                {
index c257d4098e6cd83286d6fd7ca0db91b80e508992..6d40ee22cc44dde0d8b30e9bec62dc335e854e8b 100644 (file)
@@ -30,9 +30,8 @@ private:
        IdChanMap idchan;
 
 public:
-       ModuleSQLutils(InspIRCd* Me)
-       : Module(Me)
-       {
+       ModuleSQLutils()
+               {
                ServerInstance->Modules->PublishInterface("SQLutils", this);
                Implementation eventlist[] = { I_OnChannelDelete, I_OnUnloadModule, I_OnRequest, I_OnUserDisconnect };
                ServerInstance->Modules->Attach(eventlist, this, 4);
index 3362e9378cd9c259c59807ae067fe12184f8df2f..1fe84649f57b00578fc3c3add315da3ccb7cafb5 100644 (file)
@@ -143,8 +143,8 @@ class ModuleSSLGnuTLS : public Module
        GenericCap capHandler;
  public:
 
-       ModuleSSLGnuTLS(InspIRCd* Me)
-               : Module(Me), starttls(this), capHandler(this, "tls")
+       ModuleSSLGnuTLS()
+               : starttls(this), capHandler(this, "tls")
        {
                ServerInstance->Modules->PublishInterface("BufferedSocketHook", this);
 
@@ -169,7 +169,7 @@ class ModuleSSLGnuTLS : public Module
 
        void OnRehash(User* user)
        {
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
 
                listenports.clear();
                sslports.clear();
@@ -200,7 +200,7 @@ class ModuleSSLGnuTLS : public Module
 
                OnRehash(user);
 
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
 
                std::string confdir(ServerInstance->ConfigFileName);
                // +1 so we the path ends with a /
index 645add4c28a4be963a59d49811f5276caf5846bb..f566b326b3a41d30cb852d180238435b73e58ac4 100644 (file)
@@ -100,7 +100,7 @@ class ModuleSSLOpenSSL : public Module
 
  public:
 
-       ModuleSSLOpenSSL(InspIRCd* Me)
+       ModuleSSLOpenSSL()
        {
                ServerInstance->Modules->PublishInterface("BufferedSocketHook", this);
 
@@ -144,7 +144,7 @@ class ModuleSSLOpenSSL : public Module
 
        void OnRehash(User* user)
        {
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
 
                listenports.clear();
                sslports.clear();
@@ -175,7 +175,7 @@ class ModuleSSLOpenSSL : public Module
 
                OnRehash(user);
 
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
 
                std::string confdir(ServerInstance->ConfigFileName);
                // +1 so we the path ends with a /
index 21603c3c8276c2292f1c9f217c01c934c8bdefd7..3e41f533ffcfb284ed0ebe3d69c0754303a2e667 100644 (file)
@@ -20,9 +20,8 @@ private:
 
 
 public:
-       ModuleTestClient(InspIRCd* Me)
-               : Module(Me)
-       {
+       ModuleTestClient()
+                       {
                Implementation eventlist[] = { I_OnRequest, I_OnBackgroundTimer };
                ServerInstance->Modules->Attach(eventlist, this, 2);
        }
index 557ad1cfab5cd7315af6129b0dadfd193db2a5a4..976a27b5c7293bec55c4a336b428aaec1f3d989d 100644 (file)
@@ -56,9 +56,8 @@ class ModuleZLib : public Module
        unsigned int net_buffer_size;
  public:
 
-       ModuleZLib(InspIRCd* Me)
-               : Module(Me)
-       {
+       ModuleZLib()
+                       {
                ServerInstance->Modules->PublishInterface("BufferedSocketHook", this);
 
                sessions = new izip_session[ServerInstance->SE->GetMaxFds()];
index 8ff325730225774e7cdec786ce55efa01c1cae67..c8aadfcae149cf29b0a01568b2665455d575519b 100644 (file)
@@ -20,12 +20,11 @@ class ModuleAbbreviation : public Module
 
  public:
 
-       ModuleAbbreviation(InspIRCd* Me)
-               : Module(Me)
-       {
-               Me->Modules->Attach(I_OnPreCommand, this);
+       ModuleAbbreviation()
+                       {
+               ServerInstance->Modules->Attach(I_OnPreCommand, this);
                /* Must do this first */
-               Me->Modules->SetPriority(this, I_OnPreCommand, PRIORITY_FIRST);
+               ServerInstance->Modules->SetPriority(this, I_OnPreCommand, PRIORITY_FIRST);
        }
 
        virtual Version GetVersion()
index 57c6834afb30304177613260f6233f80760fd54d..3f3c3b1ba916e2667a90b6bfdbedc10a21bee85d 100644 (file)
@@ -65,7 +65,7 @@ class ModuleAlias : public Module
 
        virtual void ReadAliases()
        {
-               ConfigReader MyConf(ServerInstance);
+               ConfigReader MyConf;
 
                AllowBots = MyConf.ReadFlag("fantasy", "allowbots", "no", 0);
 
@@ -93,13 +93,12 @@ class ModuleAlias : public Module
 
  public:
 
-       ModuleAlias(InspIRCd* Me)
-               : Module(Me)
-       {
+       ModuleAlias()
+                       {
                ReadAliases();
-               Me->Modules->Attach(I_OnPreCommand, this);
-               Me->Modules->Attach(I_OnRehash, this);
-               Me->Modules->Attach(I_OnUserMessage, this);
+               ServerInstance->Modules->Attach(I_OnPreCommand, this);
+               ServerInstance->Modules->Attach(I_OnRehash, this);
+               ServerInstance->Modules->Attach(I_OnUserMessage, this);
 
        }
 
index ae4e0b92e83271d3eae50bd211a31d6a48ed7a6e..0de9925015184107406cd975a44b98344a3f0c09 100644 (file)
@@ -18,7 +18,7 @@
 class AllowInvite : public SimpleChannelModeHandler
 {
  public:
-       AllowInvite(InspIRCd* Instance, Module* Creator) : SimpleChannelModeHandler(Instance, Creator, 'A') { }
+       AllowInvite(Module* Creator) : SimpleChannelModeHandler(Creator, 'A') { }
 };
 
 class ModuleAllowInvite : public Module
@@ -26,7 +26,7 @@ class ModuleAllowInvite : public Module
        AllowInvite ni;
  public:
 
-       ModuleAllowInvite(InspIRCd* Me) : Module(Me), ni(Me, this)
+       ModuleAllowInvite() : ni(this)
        {
                if (!ServerInstance->Modes->AddMode(&ni))
                        throw ModuleException("Could not add new modes!");
index 5a05e3339f0fce9f34b61c5808c5134c6f2f805d..37f6a5fd245a08f841e7d9176fb5b1bf3f7368d8 100644 (file)
@@ -49,8 +49,8 @@ class Modulealltime : public Module
 {
        CommandAlltime mycommand;
  public:
-       Modulealltime(InspIRCd *Me)
-               : Module(Me), mycommand(this)
+       Modulealltime()
+               : mycommand(this)
        {
                ServerInstance->AddCommand(&mycommand);
        }
index e429f5c569bd21ab5b9352c578baef11f0bd848b..a89e9dd4d2901b0e053139c8f52cf8bd303fd9c2 100644 (file)
@@ -20,7 +20,7 @@ class ModuleAntiBear : public Module
 {
        LocalIntExt bearExt;
  public:
-       ModuleAntiBear(InspIRCd* Me) : Module(Me), bearExt("antibear_timewait", this)
+       ModuleAntiBear() : bearExt("antibear_timewait", this)
        {
                Extensible::Register(&bearExt);
                Implementation eventlist[] = { I_OnUserRegister, I_OnPreCommand };
@@ -42,7 +42,7 @@ class ModuleAntiBear : public Module
                {
                        if (!strncmp(parameters[1].c_str(), "\1TIME Mon May 01 18:54:20 2006", 30))
                        {
-                               ZLine* zl = new ZLine(ServerInstance, ServerInstance->Time(), 86400, ServerInstance->Config->ServerName,
+                               ZLine* zl = new ZLine(ServerInstance->Time(), 86400, ServerInstance->Config->ServerName,
                                                "Unless you're stuck in a time warp, you appear to be a bear bot!", user->GetIPString());
                                if (ServerInstance->XLines->AddLine(zl,NULL))
                                {
index c5a56619ecba737a8fae53be3df9a8da550c4f58..8d4931e3b17e8ff66359d6d164d3b024d1fad09c 100644 (file)
@@ -18,9 +18,8 @@
 class ModuleAntiBottler : public Module
 {
  public:
-       ModuleAntiBottler(InspIRCd* Me)
-               : Module(Me)
-       {
+       ModuleAntiBottler()
+                       {
 
                Implementation eventlist[] = { I_OnPreCommand };
                ServerInstance->Modules->Attach(eventlist, this, 1);
index aa1aa633abc166fbe27841a551ac9debd1fcd715..0d149ccf27f9e96dc39ecd3dcd1144aebb77a2ff 100644 (file)
@@ -18,7 +18,7 @@
 class AuditoriumMode : public ModeHandler
 {
  public:
-       AuditoriumMode(InspIRCd* Instance, Module* Creator) : ModeHandler(Creator, 'u', PARAM_NONE, MODETYPE_CHANNEL)
+       AuditoriumMode(Module* Creator) : ModeHandler(Creator, 'u', PARAM_NONE, MODETYPE_CHANNEL)
        {
                levelrequired = OP_VALUE;
        }
@@ -44,8 +44,8 @@ class ModuleAuditorium : public Module
        bool ShowOps;
        bool OperOverride;
  public:
-       ModuleAuditorium(InspIRCd* Me)
-               : Module(Me), aum(Me, this)
+       ModuleAuditorium()
+               : aum(this)
        {
                if (!ServerInstance->Modes->AddMode(&aum))
                        throw ModuleException("Could not add new modes!");
@@ -53,7 +53,7 @@ class ModuleAuditorium : public Module
                OnRehash(NULL);
 
                Implementation eventlist[] = { I_OnUserJoin, I_OnUserPart, I_OnUserKick, I_OnUserQuit, I_OnNamesListItem, I_OnRehash, I_OnHostCycle };
-               Me->Modules->Attach(eventlist, this, 7);
+               ServerInstance->Modules->Attach(eventlist, this, 7);
 
        }
 
@@ -64,7 +64,7 @@ class ModuleAuditorium : public Module
 
        void OnRehash(User* user)
        {
-               ConfigReader conf(ServerInstance);
+               ConfigReader conf;
                ShowOps = conf.ReadFlag("auditorium", "showops", 0);
                OperOverride = conf.ReadFlag("auditorium", "operoverride", 0);
        }
index 0cd915ef9dc5dfd5a3938bb5c72f57f5014a0fd9..35b30f0d46aaf14843782cb9ebfd090da050bc10 100644 (file)
@@ -31,7 +31,7 @@
 class BanException : public ListModeBase
 {
  public:
-       BanException(InspIRCd* Instance, Module* Creator) : ListModeBase(Instance, Creator, 'e', "End of Channel Exception List", 348, 349, true) { }
+       BanException(Module* Creator) : ListModeBase(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, this)
+       ModuleBanException() : be(this)
        {
                if (!ServerInstance->Modes->AddMode(&be))
                        throw ModuleException("Could not add new modes!");
@@ -48,7 +48,7 @@ public:
 
                be.DoImplements(this);
                Implementation list[] = { I_OnRehash, I_OnRequest, I_On005Numeric, I_OnExtBanCheck, I_OnCheckChannelBan };
-               Me->Modules->Attach(list, this, 5);
+               ServerInstance->Modules->Attach(list, this, 5);
 
        }
 
index dae5a775e4f771aeb6f8707d2c53bcc50c8d2bb0..11ce93c9a4054f3c13a919bde779b49bc9f246be 100644 (file)
@@ -39,7 +39,7 @@ class BanRedirect : public ModeWatcher
 {
  public:
        SimpleExtItem<BanRedirectList> extItem;
-       BanRedirect(InspIRCd* Instance, Module* parent) : ModeWatcher(Instance, 'b', MODETYPE_CHANNEL),
+       BanRedirect(Module* parent) : ModeWatcher('b', MODETYPE_CHANNEL),
                extItem("banredirect", parent)
        {
        }
@@ -202,8 +202,8 @@ class ModuleBanRedirect : public Module
        Module* ExceptionModule;
 
  public:
-       ModuleBanRedirect(InspIRCd* Me)
-       : Module(Me), re(Me, this)
+       ModuleBanRedirect()
+       : re(this)
        {
                nofollow = false;
 
@@ -214,7 +214,7 @@ class ModuleBanRedirect : public Module
 
                Extensible::Register(&re.extItem);
                Implementation list[] = { I_OnRehash, I_OnUserPreJoin, I_OnChannelDelete, I_OnCleanup };
-               Me->Modules->Attach(list, this, 4);
+               ServerInstance->Modules->Attach(list, this, 4);
        }
 
        virtual void OnChannelDelete(Channel* chan)
@@ -231,7 +231,7 @@ class ModuleBanRedirect : public Module
 
                        if(redirects)
                        {
-                               irc::modestacker modestack(ServerInstance, false);
+                               irc::modestacker modestack(false);
                                StringDeque stackresult;
                                std::vector<std::string> mode_junk;
                                mode_junk.push_back(chan->name);
@@ -315,7 +315,7 @@ class ModuleBanRedirect : public Module
                                                        user->WriteNumeric(474, "%s %s :Cannot join channel (You are banned)", user->nick.c_str(), chan->name.c_str());
                                                        user->WriteNumeric(470, "%s %s %s :You are banned from this channel, so you are automatically transfered to the redirected channel.", user->nick.c_str(), chan->name.c_str(), redir->targetchan.c_str());
                                                        nofollow = true;
-                                                       Channel::JoinUser(ServerInstance, user, redir->targetchan.c_str(), false, "", false, ServerInstance->Time());
+                                                       Channel::JoinUser(user, redir->targetchan.c_str(), false, "", false, ServerInstance->Time());
                                                        nofollow = false;
                                                        return MOD_RES_ALLOW;
                                                }
index c9d20e3ef6b549e5fb337977c3bb0e93d6485be5..7c4d6341958da3d65f903fe112a6dff9e70e3b15 100644 (file)
@@ -45,7 +45,7 @@ class ModuleBlockAmsg : public Module
        SimpleExtItem<BlockedMessage> blockamsg;
 
  public:
-       ModuleBlockAmsg(InspIRCd* Me) : Module(Me), blockamsg("blockamsg", this)
+       ModuleBlockAmsg() : blockamsg("blockamsg", this)
        {
                this->OnRehash(NULL);
                Extensible::Register(&blockamsg);
@@ -65,7 +65,7 @@ class ModuleBlockAmsg : public Module
 
        virtual void OnRehash(User* user)
        {
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
 
                ForgetDelay = Conf.ReadInteger("blockamsg", "delay", 0, false);
 
index 88c09d91cf52ecc37ac0aa3c77480554f8e67ad2..9e81050f3203d63d3460a30ad03e76606b9714b5 100644 (file)
@@ -21,7 +21,7 @@
 class BlockCaps : public SimpleChannelModeHandler
 {
  public:
-       BlockCaps(InspIRCd* Instance, Module* Creator) : SimpleChannelModeHandler(Instance, Creator, 'B') { }
+       BlockCaps(Module* Creator) : SimpleChannelModeHandler(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, this)
+       ModuleBlockCAPS() : bc(this)
        {
                OnRehash(NULL);
                if (!ServerInstance->Modes->AddMode(&bc))
@@ -60,7 +60,7 @@ public:
 
                        Channel* c = (Channel*)dest;
 
-                       if (CHANOPS_EXEMPT(ServerInstance, 'B') && c->GetPrefixValue(user) == OP_VALUE)
+                       if (CHANOPS_EXEMPT('B') && c->GetPrefixValue(user) == OP_VALUE)
                        {
                                return MOD_RES_PASSTHRU;
                        }
@@ -101,7 +101,7 @@ public:
 
        void ReadConf()
        {
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
                percent = Conf.ReadInteger("blockcaps", "percent", "100", 0, true);
                minlen = Conf.ReadInteger("blockcaps", "minlen", "1", 0, true);
                std::string hmap = Conf.ReadValue("blockcaps", "capsmap", 0);
index d0423dfe9583e13f9516adfad552c585692718af..1c7cd8c52c331a39805fbed509f70436da4fd85c 100644 (file)
@@ -20,7 +20,7 @@
 class BlockColor : public SimpleChannelModeHandler
 {
  public:
-       BlockColor(InspIRCd* Instance, Module* Creator) : SimpleChannelModeHandler(Instance, Creator, 'c') { }
+       BlockColor(Module* Creator) : SimpleChannelModeHandler(Creator, 'c') { }
 };
 
 class ModuleBlockColour : public Module
@@ -29,7 +29,7 @@ class ModuleBlockColour : public Module
        BlockColor bc;
  public:
 
-       ModuleBlockColour(InspIRCd* Me) : Module(Me), bc(Me, this)
+       ModuleBlockColour() : bc(this)
        {
                if (!ServerInstance->Modes->AddMode(&bc))
                        throw ModuleException("Could not add new modes!");
@@ -48,7 +48,7 @@ class ModuleBlockColour : public Module
                {
                        Channel* c = (Channel*)dest;
 
-                       if (CHANOPS_EXEMPT(ServerInstance, 'c') && c->GetPrefixValue(user) == OP_VALUE)
+                       if (CHANOPS_EXEMPT('c') && c->GetPrefixValue(user) == OP_VALUE)
                        {
                                return MOD_RES_PASSTHRU;
                        }
index f2a72781e2eaa22d0e1d0030000423591487181e..4c8007b8b8b41022d211589fc9dd1e3b7931e2c8 100644 (file)
 class BotMode : public SimpleUserModeHandler
 {
  public:
-       BotMode(InspIRCd* Instance, Module* Creator) : SimpleUserModeHandler(Creator, 'B') { }
+       BotMode(Module* Creator) : SimpleUserModeHandler(Creator, 'B') { }
 };
 
 class ModuleBotMode : public Module
 {
        BotMode bm;
  public:
-       ModuleBotMode(InspIRCd* Me)
-               : Module(Me), bm(Me, this)
+       ModuleBotMode()
+               : bm(this)
        {
                if (!ServerInstance->Modes->AddMode(&bm))
                        throw ModuleException("Could not add new modes!");
index a6bdb851159ae86c14fefb17d2649ff73605c5c4..45d3f0e5ccddca52eb2d78b0fc89bd7ddb68ab9e 100644 (file)
@@ -128,7 +128,7 @@ struct CallerIDExtInfo : public ExtensionItem
 class User_g : public SimpleUserModeHandler
 {
 public:
-       User_g(InspIRCd* Instance, Module* Creator) : SimpleUserModeHandler(Creator, 'g') { }
+       User_g(Module* Creator) : SimpleUserModeHandler(Creator, 'g') { }
 };
 
 class CommandAccept : public Command
@@ -342,7 +342,7 @@ private:
        }
 
 public:
-       ModuleCallerID(InspIRCd* Me) : Module(Me), cmd(this), myumode(Me, this)
+       ModuleCallerID() : cmd(this), myumode(this)
        {
                OnRehash(NULL);
 
@@ -429,7 +429,7 @@ public:
 
        virtual void OnRehash(User* user)
        {
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
                cmd.maxaccepts = Conf.ReadInteger("callerid", "maxaccepts", "16", 0, true);
                operoverride = Conf.ReadFlag("callerid", "operoverride", "0", 0);
                tracknick = Conf.ReadFlag("callerid", "tracknick", "0", 0);
index 355c6d0fb27336e3bf773c53aff13adba09ad0c7..dbd81ed5395585156f0e2729d82ccc9468db2711 100644 (file)
@@ -69,7 +69,7 @@ class CommandCAP : public Command
 
                        reghold.set(user, 1);
                        Event event((char*) &Data, this->creator, "cap_req");
-                       event.Send(ServerInstance);
+                       event.Send();
 
                        if (Data.ack.size() > 0)
                        {
@@ -97,7 +97,7 @@ class CommandCAP : public Command
 
                        reghold.set(user, 1);
                        Event event((char*) &Data, this->creator, subcommand == "LS" ? "cap_ls" : "cap_list");
-                       event.Send(ServerInstance);
+                       event.Send();
 
                        std::string Result;
                        if (Data.wanted.size() > 0)
@@ -117,7 +117,7 @@ class CommandCAP : public Command
 
                        reghold.set(user, 1);
                        Event event((char*) &Data, this->creator, "cap_clear");
-                       event.Send(ServerInstance);
+                       event.Send();
 
                        std::string Result = irc::stringjoiner(" ", Data.ack, 0, Data.ack.size() - 1).GetJoined();
                        user->WriteServ("CAP * ACK :%s", Result.c_str());
@@ -135,8 +135,8 @@ class ModuleCAP : public Module
 {
        CommandCAP cmd;
  public:
-       ModuleCAP(InspIRCd* Me)
-               : Module(Me), cmd(this)
+       ModuleCAP()
+               : cmd(this)
        {
                ServerInstance->AddCommand(&cmd);
                Extensible::Register(&cmd.reghold);
index 2abedd975be913b5b9bf1252aa953527308101f2..bfb30f5e8a687c1b461f3132195f9b32121819c7 100644 (file)
@@ -23,8 +23,8 @@ class CBan : public XLine
 public:
        irc::string matchtext;
 
-       CBan(InspIRCd* Instance, time_t s_time, long d, std::string src, std::string re, std::string ch)
-               : XLine(Instance, s_time, d, src, re, "CBAN")
+       CBan(time_t s_time, long d, std::string src, std::string re, std::string ch)
+               : XLine(s_time, d, src, re, "CBAN")
        {
                this->matchtext = ch.c_str();
        }
@@ -63,13 +63,13 @@ public:
 class CBanFactory : public XLineFactory
 {
  public:
-       CBanFactory(InspIRCd* Instance) : XLineFactory(Instance, "CBAN") { }
+       CBanFactory() : XLineFactory("CBAN") { }
 
        /** Generate a shun
        */
        XLine* Generate(time_t set_time, long duration, std::string source, std::string reason, std::string xline_specific_mask)
        {
-               return new CBan(ServerInstance, set_time, duration, source, reason, xline_specific_mask);
+               return new CBan(set_time, duration, source, reason, xline_specific_mask);
        }
 
        bool AutoApplyToUserList(XLine *x)
@@ -116,7 +116,7 @@ class CommandCBan : public Command
 
                        try
                        {
-                               r = new CBan(ServerInstance, ServerInstance->Time(), duration, user->nick.c_str(), reason, parameters[0].c_str());
+                               r = new CBan(ServerInstance->Time(), duration, user->nick.c_str(), reason, parameters[0].c_str());
                        }
                        catch (...)
                        {
@@ -162,7 +162,7 @@ class ModuleCBan : public Module
        CBanFactory f;
 
  public:
-       ModuleCBan(InspIRCd* Me) : Module(Me), mycommand(this), f(Me)
+       ModuleCBan() : mycommand(this)
        {
                ServerInstance->XLines->RegisterFactory(&f);
 
index af3baa292c260940a03d5bd40b1d46922ae94244..29410962ba93d829364cf069ae762a1c2a2c7cde 100644 (file)
@@ -26,7 +26,7 @@ typedef std::map<irc::string,irc::string> censor_t;
 class CensorUser : public SimpleUserModeHandler
 {
  public:
-       CensorUser(InspIRCd* Instance, Module* Creator) : SimpleUserModeHandler(Creator, 'G') { }
+       CensorUser(Module* Creator) : SimpleUserModeHandler(Creator, 'G') { }
 };
 
 /** Handles channel mode +G
@@ -34,7 +34,7 @@ class CensorUser : public SimpleUserModeHandler
 class CensorChannel : public SimpleChannelModeHandler
 {
  public:
-       CensorChannel(InspIRCd* Instance, Module* Creator) : SimpleChannelModeHandler(Instance, Creator, 'G') { }
+       CensorChannel(Module* Creator) : SimpleChannelModeHandler(Creator, 'G') { }
 };
 
 class ModuleCensor : public Module
@@ -44,8 +44,8 @@ class ModuleCensor : public Module
        CensorChannel cc;
 
  public:
-       ModuleCensor(InspIRCd* Me)
-               : Module(Me), cu(Me, this), cc(Me, this)
+       ModuleCensor()
+               : cu(this), cc(this)
        {
                /* Read the configuration file on startup.
                 */
@@ -77,7 +77,7 @@ class ModuleCensor : public Module
                {
                        active = ((Channel*)dest)->IsModeSet('G');
                        Channel* c = (Channel*)dest;
-                       if (CHANOPS_EXEMPT(ServerInstance, 'G') && c->GetPrefixValue(user) == OP_VALUE)
+                       if (CHANOPS_EXEMPT('G') && c->GetPrefixValue(user) == OP_VALUE)
                        {
                                return MOD_RES_PASSTHRU;
                        }
@@ -115,7 +115,7 @@ class ModuleCensor : public Module
                 * reload our config file on rehash - we must destroy and re-allocate the classes
                 * to call the constructor again and re-read our data.
                 */
-               ConfigReader* MyConf = new ConfigReader(ServerInstance);
+               ConfigReader* MyConf = new ConfigReader;
                censors.clear();
 
                for (int index = 0; index < MyConf->Enumerate("badword"); index++)
index 6cdad0958e7debb7d8b688185b5da777b59d55a4..1300092c7afe7c049b6bbee827942722ed0f4191 100644 (file)
@@ -106,8 +106,8 @@ class CGIResolver : public Resolver
        User* them;
        bool notify;
  public:
-       CGIResolver(Module* me, InspIRCd* Instance, bool NotifyOpers, const std::string &source, bool forward, User* u, int userfd, const std::string &type, bool &cached)
-               : Resolver(Instance, source, forward ? DNS_QUERY_A : DNS_QUERY_PTR4, cached, me), typ(type), theirfd(userfd), them(u), notify(NotifyOpers) { }
+       CGIResolver(Module* me, bool NotifyOpers, const std::string &source, bool forward, User* u, int userfd, const std::string &type, bool &cached)
+               : Resolver(source, forward ? DNS_QUERY_A : DNS_QUERY_PTR4, cached, me), typ(type), theirfd(userfd), them(u), notify(NotifyOpers) { }
 
        virtual void OnLookupComplete(const std::string &result, unsigned int ttl, bool cached)
        {
@@ -146,7 +146,7 @@ class ModuleCgiIRC : public Module
        CommandWebirc cmd;
        bool NotifyOpers;
 public:
-       ModuleCgiIRC(InspIRCd* Me) : Module(Me), cmd(this, NotifyOpers)
+       ModuleCgiIRC() : cmd(this, NotifyOpers)
        {
                OnRehash(NULL);
                ServerInstance->AddCommand(&cmd);
@@ -167,7 +167,7 @@ public:
 
        virtual void OnRehash(User* user)
        {
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
                cmd.Hosts.clear();
 
                NotifyOpers = Conf.ReadFlag("cgiirc", "opernotice", 0); // If we send an oper notice when a CGI:IRC has their host changed.
@@ -307,7 +307,7 @@ public:
                                {
 
                                        bool cached;
-                                       CGIResolver* r = new CGIResolver(this, ServerInstance, NotifyOpers, user->password, false, user, user->GetFd(), "PASS", cached);
+                                       CGIResolver* r = new CGIResolver(this, NotifyOpers, user->password, false, user, user->GetFd(), "PASS", cached);
                                        ServerInstance->AddResolver(r, cached);
                                }
                                catch (...)
@@ -358,7 +358,7 @@ public:
                {
 
                        bool cached;
-                       CGIResolver* r = new CGIResolver(this, ServerInstance, NotifyOpers, newipstr, false, user, user->GetFd(), "IDENT", cached);
+                       CGIResolver* r = new CGIResolver(this, NotifyOpers, newipstr, false, user, user->GetFd(), "IDENT", cached);
                        ServerInstance->AddResolver(r, cached);
                }
                catch (...)
index c31cbe9cf2a5b110e0032e778719957285f7a1e6..66635304952bbecad151294567c621ec83fb6943 100644 (file)
@@ -19,9 +19,8 @@ class ModuleChanCreate : public Module
 {
  private:
  public:
-       ModuleChanCreate(InspIRCd* Me)
-               : Module(Me)
-       {
+       ModuleChanCreate()
+                       {
                ServerInstance->SNO->EnableSnomask('j', "CHANCREATE");
                ServerInstance->SNO->EnableSnomask('J', "REMOTECHANCREATE");
                Implementation eventlist[] = { I_OnUserJoin };
index 7c28036b74bb0bd691775a47d6c2e269839afb6d..cd7300372315bd464babb52f7766b1464a6d3194 100644 (file)
@@ -25,7 +25,7 @@
 class ChanFilter : public ListModeBase
 {
  public:
-       ChanFilter(InspIRCd* Instance, Module* Creator) : ListModeBase(Instance, Creator, 'g', "End of channel spamfilter list", 941, 940, false, "chanfilter") { }
+       ChanFilter(Module* Creator) : ListModeBase(Creator, 'g', "End of channel spamfilter list", 941, 940, false, "chanfilter") { }
 
        virtual bool ValidateParam(User* user, Channel* chan, std::string &word)
        {
@@ -62,8 +62,8 @@ class ModuleChanFilter : public Module
 
  public:
 
-       ModuleChanFilter(InspIRCd* Me)
-               : Module(Me), cf(Me, this)
+       ModuleChanFilter()
+               : cf(this)
        {
                if (!ServerInstance->Modes->AddMode(&cf))
                        throw ModuleException("Could not add new modes!");
@@ -78,14 +78,14 @@ class ModuleChanFilter : public Module
 
        virtual void OnRehash(User* user)
        {
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
                hidemask = Conf.ReadFlag("chanfilter", "hidemask", 0);
                cf.DoRehash();
        }
 
        virtual ModResult ProcessMessages(User* user,Channel* chan,std::string &text)
        {
-               if (!IS_LOCAL(user) || (CHANOPS_EXEMPT(ServerInstance, 'g') && chan->GetPrefixValue(user) == OP_VALUE))
+               if (!IS_LOCAL(user) || (CHANOPS_EXEMPT('g') && chan->GetPrefixValue(user) == OP_VALUE))
                        return MOD_RES_PASSTHRU;
 
                modelist* list = cf.extItem.get(chan);
index 0e40ba80ccf3b7177fccb092a735ea5e1bf62fe0..826c6f32f2e2e2cb0fb250ccc2082fc7ecd55f86 100644 (file)
@@ -24,8 +24,7 @@ class ModuleChanLog : public Module
        std::multimap<char, std::string> logstreams;
 
  public:
-       ModuleChanLog(InspIRCd* Me) : Module(Me)
-       {
+       ModuleChanLog()         {
                Implementation eventlist[] = { I_OnRehash, I_OnSendSnotice };
                ServerInstance->Modules->Attach(eventlist, this, 2);
 
@@ -38,7 +37,7 @@ class ModuleChanLog : public Module
 
        virtual void OnRehash(User *user)
        {
-               ConfigReader MyConf(ServerInstance);
+               ConfigReader MyConf;
                std::string snomasks;
                std::string channel;
 
@@ -128,7 +127,7 @@ class ChannelLogStream : public LogStream
        std::string channel;
 
  public:
-       ChannelLogStream(InspIRCd *Instance, int loglevel, const std::string &chan) : LogStream(Instance, loglevel), channel(chan)
+       ChannelLogStream(int loglevel, const std::string &chan) : LogStream(loglevel), channel(chan)
        {
        }
 
index a918eefd2800af51a579c213552da14a1ad5c195..008422c66e2a07535a03614c85d3aef3ad6e8df9 100644 (file)
@@ -19,9 +19,8 @@ static bool allowedmap[256];
 
 class NewIsChannelHandler : public HandlerBase2<bool, const char*, size_t>
 {
-       InspIRCd* Server;
  public:
-       NewIsChannelHandler(InspIRCd* Srv) : Server(Srv) { }
+       NewIsChannelHandler() { }
        virtual ~NewIsChannelHandler() { }
        virtual bool Call(const char*, size_t);
 };
@@ -44,19 +43,14 @@ bool NewIsChannelHandler::Call(const char* chname, size_t max)
 class ModuleChannelNames : public Module
 {
  private:
-       InspIRCd* ServerInstance;
-       NewIsChannelHandler* myhandler;
-       caller2<bool, const char*, size_t> * rememberer;
+       NewIsChannelHandler myhandler;
+       caller2<bool, const char*, size_t> rememberer;
        bool badchan;
 
  public:
-       ModuleChannelNames(InspIRCd* Me) : Module(Me)
+       ModuleChannelNames() : rememberer(ServerInstance->IsChannel)
        {
-               rememberer = (caller2<bool, const char*, size_t> *) malloc(sizeof(caller2<bool, const char*, size_t>));
-               ServerInstance = Me;
-               *rememberer = ServerInstance->IsChannel;
-               myhandler = new NewIsChannelHandler(ServerInstance);
-               ServerInstance->IsChannel = myhandler;
+               ServerInstance->IsChannel = &myhandler;
                badchan = false;
                Implementation eventlist[] = { I_OnRehash, I_OnUserKick };
                ServerInstance->Modules->Attach(eventlist, this, 2);
@@ -95,7 +89,7 @@ class ModuleChannelNames : public Module
 
        virtual void OnRehash(User* user)
        {
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
                std::string denyToken = Conf.ReadValue("channames", "denyrange", 0);
                std::string allowToken = Conf.ReadValue("channames", "allowrange", 0);
                memset(allowedmap, 1, sizeof(allowedmap));
@@ -130,9 +124,7 @@ class ModuleChannelNames : public Module
 
        virtual ~ModuleChannelNames()
        {
-               delete myhandler;
-               ServerInstance->IsChannel = *rememberer;
-               free(rememberer);
+               ServerInstance->IsChannel = rememberer;
                ValidateChans();
        }
 
index 387aeb2b9d5ff1ce48f9f45bee2f7a56c35f68c2..5b7b326bd8512210245d0ccac4afe56ed228b068 100644 (file)
@@ -19,8 +19,7 @@ class ModuleBadChannelExtban : public Module
 {
  private:
  public:
-       ModuleBadChannelExtban(InspIRCd* Me) : Module(Me)
-       {
+       ModuleBadChannelExtban()        {
                Implementation eventlist[] = { I_OnCheckBan, I_On005Numeric };
                ServerInstance->Modules->Attach(eventlist, this, 2);
        }
index 4d046b41597f537acae63d39849d6062b6c1eae8..12b5c1db421ca22cef5293ef98d05941ba48afd3 100644 (file)
@@ -67,7 +67,7 @@ class FounderProtectBase
                const UserMembList* cl = channel->GetUsers();
                std::vector<std::string> mode_junk;
                mode_junk.push_back(channel->name);
-               irc::modestacker modestack(ServerInstance, false);
+               irc::modestacker modestack(false);
                std::deque<std::string> stackresult;
 
                for (UserMembCIter i = cl->begin(); i != cl->end(); i++)
@@ -266,8 +266,8 @@ class ModuleChanProtect : public Module
 
  public:
 
-       ModuleChanProtect(InspIRCd* Me)
-               : Module(Me), FirstInGetsFounder(false), QPrefix(0), APrefix(0), DeprivSelf(false), DeprivOthers(false), booting(true), cp(NULL), cf(NULL)
+       ModuleChanProtect()
+               : FirstInGetsFounder(false), QPrefix(0), APrefix(0), DeprivSelf(false), DeprivOthers(false), booting(true), cp(NULL), cf(NULL)
        {
                /* Load config stuff */
                LoadSettings();
@@ -291,7 +291,7 @@ class ModuleChanProtect : public Module
 
        void LoadSettings()
        {
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
 
                FirstInGetsFounder = Conf.ReadFlag("chanprotect", "noservices", 0);
 
index cf07e364461b6347cb5b2fffdaa839e21fffee27..e3de633254728e10f3a43a75b5ae8913e77e786a 100644 (file)
@@ -203,7 +203,7 @@ class ModuleCheck : public Module
  private:
        CommandCheck mycommand;
  public:
-       ModuleCheck(InspIRCd* Me) : Module(Me), mycommand(this)
+       ModuleCheck() : mycommand(this)
        {
                ServerInstance->AddCommand(&mycommand);
        }
index 43f6dea7ca7d84a9ba382442cc927bac9651f17b..fdec5d6d0cb0d1ce292898f0b253a51156c03427 100644 (file)
@@ -86,7 +86,7 @@ class ModuleChgHost : public Module
        CommandChghost cmd;
        char hostmap[256];
  public:
-       ModuleChgHost(InspIRCd* Me) : cmd(this, hostmap)
+       ModuleChgHost() : cmd(this, hostmap)
        {
                OnRehash(NULL);
                ServerInstance->AddCommand(&cmd);
@@ -97,7 +97,7 @@ class ModuleChgHost : public Module
 
        void OnRehash(User* user)
        {
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
                std::string hmap = Conf.ReadValue("hostname", "charmap", 0);
 
                if (hmap.empty())
index 34d969c0537f517313b15d44007fec190a4b8ce8..135b26446d973a36c7f3391d40b26f155e258895 100644 (file)
@@ -80,7 +80,7 @@ class ModuleChgIdent : public Module
        CommandChgident cmd;
 
 public:
-       ModuleChgIdent(InspIRCd* Me) : Module(Me), cmd(this)
+       ModuleChgIdent() : cmd(this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index 506325eee19ceaaa51408bee732a8bdfdec3124a..17ad9dc4800befc2cdbc19c0a3152759dc93a42b 100644 (file)
@@ -72,7 +72,7 @@ class ModuleChgName : public Module
        CommandChgname cmd;
 
 public:
-       ModuleChgName(InspIRCd* Me) : Module(Me), cmd(this)
+       ModuleChgName() : cmd(this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index 25d997798192c1044d529b643f7df54c4d150bfb..2bd8df80eea37f9dc6b3126e44c85cd0ba8e0b31 100644 (file)
@@ -197,7 +197,7 @@ class CloakUser : public ModeHandler
 
        void DoRehash()
        {
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
                bool lowercase;
 
                /* These are *not* using the need_positive parameter of ReadInteger -
@@ -256,7 +256,7 @@ class ModuleCloaking : public Module
        CloakUser* cu;
 
  public:
-       ModuleCloaking(InspIRCd*)
+       ModuleCloaking()
        {
                /* Attempt to locate the md5 service provider, bail if we can't find it */
                Module* HashModule = ServerInstance->Modules->Find("m_md5.so");
index 966f2970568e0223ab9a15be50eaab63d73b4e32..9742ea29d6c714797c01229c871f952a71a6c16b 100644 (file)
@@ -61,7 +61,7 @@ class ModuleClones : public Module
  private:
        CommandClones cmd;
  public:
-       ModuleClones(InspIRCd* Me) : Module(Me), cmd(this)
+       ModuleClones() : cmd(this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index 762036407a8529f6b6b9d1ccbaa71bb1ad0b8277..1cddc5012805d94fb88508cc68152db80dce422e 100644 (file)
@@ -68,8 +68,8 @@ class ModuleClose : public Module
 {
        CommandClose cmd;
  public:
-       ModuleClose(InspIRCd* Me)
-               : Module(Me), cmd(this)
+       ModuleClose()
+               : cmd(this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index 35d7f51794f1133ffd495194f1f11cfe3d2bed27..20b409b9bfe14da5506ad85547cb44e5d2871404 100644 (file)
@@ -20,7 +20,7 @@
 class PrivacyMode : public ModeHandler
 {
  public:
-       PrivacyMode(InspIRCd* Instance, Module* Creator) : ModeHandler(Creator, 'c', PARAM_NONE, MODETYPE_USER) { }
+       PrivacyMode(Module* Creator) : ModeHandler(Creator, 'c', PARAM_NONE, MODETYPE_USER) { }
 
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
        {
@@ -49,7 +49,7 @@ class ModulePrivacyMode : public Module
 {
        PrivacyMode pm;
  public:
-       ModulePrivacyMode(InspIRCd* Me) : Module(Me), pm(Me, this)
+       ModulePrivacyMode() : pm(this)
        {
                if (!ServerInstance->Modes->AddMode(&pm))
                        throw ModuleException("Could not add new modes!");
index af6b50afd9a40d6d86485a7c8edfc884e80fefe8..b78cc85bee78d1e16ecde69eeaf5a001775ca613 100644 (file)
@@ -42,9 +42,8 @@ class ModuleConnJoin : public Module
                }
 
        public:
-               ModuleConnJoin(InspIRCd* Me)
-                       : Module(Me)
-               {
+               ModuleConnJoin()
+                                       {
                        OnRehash(NULL);
                        Implementation eventlist[] = { I_OnPostConnect, I_OnRehash };
                        ServerInstance->Modules->Attach(eventlist, this, 2);
@@ -58,7 +57,7 @@ class ModuleConnJoin : public Module
 
                virtual void OnRehash(User* user)
                {
-                       ConfigReader* conf = new ConfigReader(ServerInstance);
+                       ConfigReader* conf = new ConfigReader;
                        JoinChan = conf->ReadValue("autojoin", "channel", 0);
                        Joinchans.clear();
                        if (!JoinChan.empty())
@@ -82,7 +81,7 @@ class ModuleConnJoin : public Module
 
                        for(std::vector<std::string>::iterator it = Joinchans.begin(); it != Joinchans.end(); it++)
                                if (ServerInstance->IsChannel(it->c_str(), ServerInstance->Config->Limits.ChanMax))
-                                       Channel::JoinUser(ServerInstance, user, it->c_str(), false, "", false, ServerInstance->Time());
+                                       Channel::JoinUser(user, it->c_str(), false, "", false, ServerInstance->Time());
                }
 
 };
index 195321bfb73f222ad6332e16e945468dffbe48e0..2ad8ab87629c5be3b44f9b04398cc251e183d9de 100644 (file)
@@ -22,10 +22,9 @@ class ModuleModesOnConnect : public Module
        ConfigReader *Conf;
 
  public:
-       ModuleModesOnConnect(InspIRCd* Me) : Module(Me)
-       {
+       ModuleModesOnConnect()  {
 
-               Conf = new ConfigReader(ServerInstance);
+               Conf = new ConfigReader;
                Implementation eventlist[] = { I_OnUserConnect, I_OnRehash };
                ServerInstance->Modules->Attach(eventlist, this, 2);
                // for things like +x on connect, important, otherwise we have to resort to config order (bleh) -- w00t
@@ -36,7 +35,7 @@ class ModuleModesOnConnect : public Module
        virtual void OnRehash(User* user)
        {
                delete Conf;
-               Conf = new ConfigReader(ServerInstance);
+               Conf = new ConfigReader;
        }
 
        virtual ~ModuleModesOnConnect()
index b77116410ffcd8bc6198a8d302532ff67c586ddb..46f4a69eb7605256ceb240330f1b19a158111adf 100644 (file)
@@ -22,8 +22,8 @@ class ModuleWaitPong : public Module
        LocalStringExt ext;
 
  public:
-       ModuleWaitPong(InspIRCd* Me)
-        : Module(Me), ext("waitpong_pingstr", this)
+       ModuleWaitPong()
+        : ext("waitpong_pingstr", this)
        {
                OnRehash(NULL);
                Implementation eventlist[] = { I_OnUserRegister, I_OnCheckReady, I_OnPreCommand, I_OnRehash };
@@ -32,7 +32,7 @@ class ModuleWaitPong : public Module
 
        void OnRehash(User* user)
        {
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
 
                sendsnotice = Conf.ReadFlag("waitpong", "sendsnotice", 0);
 
index d5bb20fe3f05e67aa20f49bbed99d1e2477a62ea..d13dc1e0a1f64922a5fce73c3e1a5ce9216771df 100644 (file)
@@ -25,8 +25,7 @@ class ModuleConnectBan : public Module
        unsigned int ipv4_cidr;
        unsigned int ipv6_cidr;
  public:
-       ModuleConnectBan(InspIRCd* Me) : Module(Me)
-       {
+       ModuleConnectBan()      {
                Implementation eventlist[] = { I_OnUserConnect, I_OnGarbageCollect, I_OnRehash };
                ServerInstance->Modules->Attach(eventlist, this, 3);
                OnRehash(NULL);
@@ -43,7 +42,7 @@ class ModuleConnectBan : public Module
 
        virtual void OnRehash(User* user)
        {
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
                std::string duration;
 
                ipv4_cidr = Conf.ReadInteger("connectban", "ipv4cidr", 0, true);
@@ -91,7 +90,7 @@ class ModuleConnectBan : public Module
                        if (i->second >= threshold)
                        {
                                // Create zline for set duration.
-                               ZLine* zl = new ZLine(ServerInstance, ServerInstance->Time(), banduration, ServerInstance->Config->ServerName, "Connect flooding", u->GetCIDRMask(range));
+                               ZLine* zl = new ZLine(ServerInstance->Time(), banduration, ServerInstance->Config->ServerName, "Connect flooding", u->GetCIDRMask(range));
                                if (ServerInstance->XLines->AddLine(zl,NULL))
                                        ServerInstance->XLines->ApplyLines();
                                else
index 04fe456275d659b9a259c91a5dc8084318c096d8..419dbab9c3a5bf5e18f9859946c3d1b035751268 100644 (file)
@@ -28,8 +28,7 @@ private:
 
 
 public:
-       ModuleConnFlood(InspIRCd* Me) : Module(Me)
-       {
+       ModuleConnFlood()       {
 
                InitConf();
                Implementation eventlist[] = { I_OnRehash, I_OnUserRegister };
@@ -48,7 +47,7 @@ public:
        void InitConf()
        {
                /* read configuration variables */
-               conf = new ConfigReader(ServerInstance);
+               conf = new ConfigReader;
                /* throttle configuration */
                seconds = conf->ReadInteger("connflood", "seconds", 0, true);
                maxconns = conf->ReadInteger("connflood", "maxconns", 0, true);
index aa5749a04a03294eff44e80d0c58ebd347bc8fe2..9ff250cd6349583dc138f5f8a5e52d4653861baa 100644 (file)
@@ -50,7 +50,7 @@ class CommandTitle : public Command
                snprintf(TheHost,MAXBUF,"%s@%s",user->ident.c_str(), user->host.c_str());
                snprintf(TheIP, MAXBUF,"%s@%s",user->ident.c_str(), user->GetIPString());
 
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
                for (int i=0; i<Conf.Enumerate("title"); i++)
                {
                        std::string name = Conf.ReadValue("title", "name", "", i);
@@ -86,7 +86,7 @@ class ModuleCustomTitle : public Module
        CommandTitle cmd;
 
  public:
-       ModuleCustomTitle(InspIRCd* Me) : Module(Me), cmd(this)
+       ModuleCustomTitle() : cmd(this)
        {
                ServerInstance->AddCommand(&cmd);
                Extensible::Register(&cmd.ctitle);
index 6ff275689d0dce28fbc872b1644c3716aff1922e..4b3d3e83bc5bc88e69d9d0e186dba2331079a5da 100644 (file)
@@ -61,7 +61,7 @@ class CommandCycle : public Command
                                if (!channel->PartUser(user, reason))
                                        delete channel;
 
-                               Channel::JoinUser(ServerInstance, user, parameters[0].c_str(), true, "", false, ServerInstance->Time());
+                               Channel::JoinUser(user, parameters[0].c_str(), true, "", false, ServerInstance->Time());
                        }
 
                        return CMD_SUCCESS;
@@ -80,8 +80,8 @@ class ModuleCycle : public Module
 {
        CommandCycle cmd;
  public:
-       ModuleCycle(InspIRCd* Me)
-               : Module(Me), cmd(this)
+       ModuleCycle()
+               : cmd(this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index a25d553d1df2079dd90b2d0e48043655542710b2..10a8d9310f822d366fbd06a10f1a90a8eaab4884 100644 (file)
@@ -239,10 +239,10 @@ class ModuleDCCAllow : public Module
        CommandDccallow cmd;
  public:
 
-       ModuleDCCAllow(InspIRCd* Me)
-               : Module(Me), cmd(this)
+       ModuleDCCAllow()
+               : cmd(this)
        {
-               Conf = new ConfigReader(ServerInstance);
+               Conf = new ConfigReader;
                ext = new SimpleExtItem<dccallowlist>("dccallow", this);
                Extensible::Register(ext);
                ServerInstance->AddCommand(&cmd);
@@ -255,7 +255,7 @@ class ModuleDCCAllow : public Module
        virtual void OnRehash(User* user)
        {
                delete Conf;
-               Conf = new ConfigReader(ServerInstance);
+               Conf = new ConfigReader;
                ReadFileConf();
        }
 
index 82da681000512472045215ccabbba63e25ccaffa..53085271a06c3c373123f400581feaa62c6d9187 100644 (file)
@@ -20,7 +20,7 @@
 class User_d : public ModeHandler
 {
  public:
-       User_d(InspIRCd* Instance, Module* Creator) : ModeHandler(Creator, 'd', PARAM_NONE, MODETYPE_USER) { }
+       User_d(Module* Creator) : ModeHandler(Creator, 'd', PARAM_NONE, MODETYPE_USER) { }
 
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
        {
@@ -53,8 +53,8 @@ class ModuleDeaf : public Module
        std::string deaf_bypasschars_uline;
 
  public:
-       ModuleDeaf(InspIRCd* Me)
-               : Module(Me), m1(Me, this)
+       ModuleDeaf()
+               : m1(this)
        {
                if (!ServerInstance->Modes->AddMode(&m1))
                        throw ModuleException("Could not add new modes!");
@@ -67,7 +67,7 @@ class ModuleDeaf : public Module
 
        virtual void OnRehash(User* user)
        {
-               ConfigReader* conf = new ConfigReader(ServerInstance);
+               ConfigReader* conf = new ConfigReader;
                deaf_bypasschars = conf->ReadValue("deaf", "bypasschars", 0);
                deaf_bypasschars_uline = conf->ReadValue("deaf", "bypasscharsuline", 0);
 
index 182399eaa196cbd8f87e1ce584064cd717cf0607..41038d9cbc68879b8f11a411ce8558287524d141 100644 (file)
@@ -19,7 +19,7 @@ class DelayJoinMode : public ModeHandler
  private:
        CUList empty;
  public:
-       DelayJoinMode(InspIRCd* Instance, Module* Parent) : ModeHandler(Parent, 'D', PARAM_NONE, MODETYPE_CHANNEL)
+       DelayJoinMode(Module* Parent) : ModeHandler(Parent, 'D', PARAM_NONE, MODETYPE_CHANNEL)
        {
                levelrequired = OP_VALUE;
        }
@@ -32,7 +32,7 @@ class ModuleDelayJoin : public Module
        DelayJoinMode djm;
  public:
        LocalIntExt unjoined;
-       ModuleDelayJoin(InspIRCd* Me) : Module(Me), djm(Me, this), unjoined("delayjoin", this)
+       ModuleDelayJoin() : djm(this), unjoined("delayjoin", this)
        {
                if (!ServerInstance->Modes->AddMode(&djm))
                        throw ModuleException("Could not add new modes!");
index 9acfc57ea7bcb257e67540aae5d9b008bf0eebba..7931a598204445b74f1c05ffb1106a4ac327ef1a 100644 (file)
@@ -22,7 +22,7 @@ class DelayMsgMode : public ModeHandler
        CUList empty;
  public:
        LocalIntExt jointime;
-       DelayMsgMode(InspIRCd* Instance, Module* Parent) : ModeHandler(Parent, 'd', PARAM_SETONLY, MODETYPE_CHANNEL)
+       DelayMsgMode(Module* Parent) : ModeHandler(Parent, 'd', PARAM_SETONLY, MODETYPE_CHANNEL)
                , jointime("delaymsg", Parent)
        {
                levelrequired = OP_VALUE;
@@ -54,7 +54,7 @@ class ModuleDelayMsg : public Module
  private:
        DelayMsgMode djm;
  public:
-       ModuleDelayMsg(InspIRCd* Me) : Module(Me), djm(Me, this)
+       ModuleDelayMsg() : djm(this)
        {
                if (!ServerInstance->Modes->AddMode(&djm))
                        throw ModuleException("Could not add new modes!");
index f47d414bd92ec5b14250fe95678a80643ca52217..f95c0b1079d4ce613b92b350ad9d6a3244855e26 100644 (file)
@@ -23,10 +23,9 @@ class ModuleDenyChannels : public Module
        ConfigReader *Conf;
 
  public:
-       ModuleDenyChannels(InspIRCd* Me) : Module(Me)
-       {
+       ModuleDenyChannels()    {
 
-               Conf = new ConfigReader(ServerInstance);
+               Conf = new ConfigReader;
                Implementation eventlist[] = { I_OnUserPreJoin, I_OnRehash };
                ServerInstance->Modules->Attach(eventlist, this, 2);
        }
@@ -34,7 +33,7 @@ class ModuleDenyChannels : public Module
        virtual void OnRehash(User* user)
        {
                delete Conf;
-               Conf = new ConfigReader(ServerInstance);
+               Conf = new ConfigReader;
                /* check for redirect validity and loops/chains */
                for (int i =0; i < Conf->Enumerate("badchan"); i++)
                {
@@ -116,7 +115,7 @@ class ModuleDenyChannels : public Module
                                                if ((!newchan) || (!(newchan->IsModeSet('L'))))
                                                {
                                                        user->WriteNumeric(926, "%s %s :Channel %s is forbidden, redirecting to %s: %s",user->nick.c_str(),cname,cname,redirect.c_str(), reason.c_str());
-                                                       Channel::JoinUser(ServerInstance,user,redirect.c_str(),false,"",false,ServerInstance->Time());
+                                                       Channel::JoinUser(user,redirect.c_str(),false,"",false,ServerInstance->Time());
                                                        return MOD_RES_DENY;
                                                }
                                        }
index 2e590095fcfe1a9a84b68a3863cd34728b114eae..7c2dcb3d81fb85091bf51508f90b3ad552d2cae1 100644 (file)
@@ -54,7 +54,7 @@ class ModuleDeVoice : public Module
 {
        CommandDevoice cmd;
  public:
-       ModuleDeVoice(InspIRCd* Me) : Module(Me), cmd(this)
+       ModuleDeVoice() : cmd(this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index 06709979b9143f0d074c8c3121f874d5c10729f6..cb32ede78e6cd950266f6a1ed69db5b562a37f6f 100644 (file)
@@ -51,8 +51,8 @@ class DNSBLResolver : public Resolver
 
  public:
 
-       DNSBLResolver(Module *me, InspIRCd *Instance, const std::string &hostname, User* u, int userfd, DNSBLConfEntry *conf, bool &cached)
-               : Resolver(Instance, hostname, DNS_QUERY_A, cached, me)
+       DNSBLResolver(Module *me, const std::string &hostname, User* u, int userfd, DNSBLConfEntry *conf, bool &cached)
+               : Resolver(hostname, DNS_QUERY_A, cached, me)
        {
                theirfd = userfd;
                them = u;
@@ -125,7 +125,7 @@ class DNSBLResolver : public Resolver
                                                }
                                                case DNSBLConfEntry::I_KLINE:
                                                {
-                                                       KLine* kl = new KLine(ServerInstance, ServerInstance->Time(), ConfEntry->duration, ServerInstance->Config->ServerName, reason.c_str(),
+                                                       KLine* kl = new KLine(ServerInstance->Time(), ConfEntry->duration, ServerInstance->Config->ServerName, reason.c_str(),
                                                                        "*", them->GetIPString());
                                                        if (ServerInstance->XLines->AddLine(kl,NULL))
                                                        {
@@ -139,7 +139,7 @@ class DNSBLResolver : public Resolver
                                                }
                                                case DNSBLConfEntry::I_GLINE:
                                                {
-                                                       GLine* gl = new GLine(ServerInstance, ServerInstance->Time(), ConfEntry->duration, ServerInstance->Config->ServerName, reason.c_str(),
+                                                       GLine* gl = new GLine(ServerInstance->Time(), ConfEntry->duration, ServerInstance->Config->ServerName, reason.c_str(),
                                                                        "*", them->GetIPString());
                                                        if (ServerInstance->XLines->AddLine(gl,NULL))
                                                        {
@@ -153,7 +153,7 @@ class DNSBLResolver : public Resolver
                                                }
                                                case DNSBLConfEntry::I_ZLINE:
                                                {
-                                                       ZLine* zl = new ZLine(ServerInstance, ServerInstance->Time(), ConfEntry->duration, ServerInstance->Config->ServerName, reason.c_str(),
+                                                       ZLine* zl = new ZLine(ServerInstance->Time(), ConfEntry->duration, ServerInstance->Config->ServerName, reason.c_str(),
                                                                        them->GetIPString());
                                                        if (ServerInstance->XLines->AddLine(zl,NULL))
                                                        {
@@ -215,8 +215,7 @@ class ModuleDNSBL : public Module
                return DNSBLConfEntry::I_UNKNOWN;
        }
  public:
-       ModuleDNSBL(InspIRCd *Me) : Module(Me)
-       {
+       ModuleDNSBL()   {
                ReadConf();
                Implementation eventlist[] = { I_OnRehash, I_OnUserRegister, I_OnStats };
                ServerInstance->Modules->Attach(eventlist, this, 3);
@@ -246,7 +245,7 @@ class ModuleDNSBL : public Module
         */
        virtual void ReadConf()
        {
-               ConfigReader *MyConf = new ConfigReader(ServerInstance);
+               ConfigReader *MyConf = new ConfigReader;
                ClearEntries();
 
                for (int i=0; i< MyConf->Enumerate("dnsbl"); i++)
@@ -358,7 +357,7 @@ class ModuleDNSBL : public Module
 
                                /* now we'd need to fire off lookups for `hostname'. */
                                bool cached;
-                               DNSBLResolver *r = new DNSBLResolver(this, ServerInstance, hostname, user, user->GetFd(), *i, cached);
+                               DNSBLResolver *r = new DNSBLResolver(this, hostname, user, user->GetFd(), *i, cached);
                                ServerInstance->AddResolver(r, cached);
                        }
                }
index 0c020513fc0ccc244cae4f2fc2f5a85e9e252c81..b6dbee4eac99e9c25dac0994f02a31b7364442a7 100644 (file)
@@ -101,7 +101,7 @@ class CommandFilter : public Command
 {
        FilterBase* Base;
  public:
-       CommandFilter(FilterBase* f, const std::string &ssource)
+       CommandFilter(FilterBase* f)
                : Command(reinterpret_cast<Module*>(f), "FILTER", 1, 5), Base(f)
        {
                flags_needed = 'o';
@@ -127,7 +127,7 @@ class FilterBase : public Module
 protected:
        std::vector<std::string> exemptfromfilter; // List of channel names excluded from filtering.
  public:
-       FilterBase(InspIRCd* Me, const std::string &source);
+       FilterBase();
        virtual ~FilterBase();
        virtual ModResult OnUserPreMessage(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list);
        virtual FilterResult* FilterMatch(User* user, const std::string &text, int flags) = 0;
@@ -242,9 +242,9 @@ bool FilterBase::AppliesToMe(User* user, FilterResult* filter, int iflags)
        return true;
 }
 
-FilterBase::FilterBase(InspIRCd* Me, const std::string &source) : Module(Me), filtcommand(this, source)
+FilterBase::FilterBase() : filtcommand(this)
 {
-       Me->Modules->UseInterface("RegularExpression");
+       ServerInstance->Modules->UseInterface("RegularExpression");
        ServerInstance->AddCommand(&filtcommand);
        Implementation eventlist[] = { I_OnPreCommand, I_OnStats, I_OnSyncNetwork, I_OnDecodeMetaData, I_OnUserPreMessage, I_OnUserPreNotice, I_OnRehash, I_OnLoadModule };
        ServerInstance->Modules->Attach(eventlist, this, 8);
@@ -310,7 +310,7 @@ ModResult FilterBase::OnUserPreNotice(User* user,void* dest,int target_type, std
                }
                if (f->action == "gline")
                {
-                       GLine* gl = new GLine(ServerInstance, ServerInstance->Time(), f->gline_time, ServerInstance->Config->ServerName, f->reason.c_str(), "*", user->GetIPString());
+                       GLine* gl = new GLine(ServerInstance->Time(), f->gline_time, ServerInstance->Config->ServerName, f->reason.c_str(), "*", user->GetIPString());
                        if (ServerInstance->XLines->AddLine(gl,NULL))
                        {
                                ServerInstance->XLines->ApplyLines();
@@ -399,7 +399,7 @@ ModResult FilterBase::OnPreCommand(std::string &command, std::vector<std::string
                                if (f->action == "gline")
                                {
                                        /* Note: We gline *@IP so that if their host doesnt resolve the gline still applies. */
-                                       GLine* gl = new GLine(ServerInstance, ServerInstance->Time(), f->gline_time, ServerInstance->Config->ServerName, f->reason.c_str(), "*", user->GetIPString());
+                                       GLine* gl = new GLine(ServerInstance->Time(), f->gline_time, ServerInstance->Config->ServerName, f->reason.c_str(), "*", user->GetIPString());
                                        if (ServerInstance->XLines->AddLine(gl,NULL))
                                        {
                                                ServerInstance->XLines->ApplyLines();
@@ -417,7 +417,7 @@ ModResult FilterBase::OnPreCommand(std::string &command, std::vector<std::string
 
 void FilterBase::OnRehash(User* user)
 {
-       ConfigReader MyConf(ServerInstance);
+       ConfigReader MyConf;
        std::vector<std::string>().swap(exemptfromfilter);
        for (int index = 0; index < MyConf.Enumerate("exemptfromfilter"); ++index)
        {
@@ -467,7 +467,7 @@ void FilterBase::OnLoadModule(Module* mod, const std::string& name)
                        /* Force a rehash to make sure that any filters that couldnt be applied from the conf
                         * on startup or on load are applied right now.
                         */
-                       ConfigReader Config(ServerInstance);
+                       ConfigReader Config;
                        ServerInstance->SNO->WriteGlobalSno('a', "Found and activated regex module '%s' for m_filter.so.", RegexEngine.c_str());
                        ReadFilters(Config);
                }
@@ -562,8 +562,7 @@ class ModuleFilter : public FilterBase
        ImplFilter fr;
 
  public:
-       ModuleFilter(InspIRCd* Me)
-       : FilterBase(Me, "m_filter.so")
+       ModuleFilter()
        {
                OnRehash(NULL);
        }
@@ -644,7 +643,7 @@ class ModuleFilter : public FilterBase
 
        virtual void OnRehash(User* user)
        {
-               ConfigReader MyConf(ServerInstance);
+               ConfigReader MyConf;
                FilterBase::OnRehash(user);
                ReadFilters(MyConf);
        }
index 0a868d347b0fb618f7963b72cdefdf0f2ac4dcb2..9d1550b38c6f7893770f5fea953ad98b56af4a04 100644 (file)
@@ -19,8 +19,7 @@ class ModuleGecosBan : public Module
 {
  private:
  public:
-       ModuleGecosBan(InspIRCd* Me) : Module(Me)
-       {
+       ModuleGecosBan()        {
                Implementation eventlist[] = { I_OnCheckBan, I_On005Numeric };
                ServerInstance->Modules->Attach(eventlist, this, 2);
        }
index 19359a976501a018b7cdd6b9121587e09a220b98..348984e14ee185b2c9f717f7c03a946aea5c4ff8 100644 (file)
@@ -142,8 +142,8 @@ class ModuleGlobalLoad : public Module
        CommandGreloadmodule cmd3;
 
  public:
-       ModuleGlobalLoad(InspIRCd* Me)
-               : Module(Me), cmd1(this), cmd2(this), cmd3(this)
+       ModuleGlobalLoad()
+               : cmd1(this), cmd2(this), cmd3(this)
        {
                ServerInstance->AddCommand(&cmd1);
                ServerInstance->AddCommand(&cmd2);
index 81d9699792a3c9a01a99601b107954d0e083e36f..3574ad605e6728491ebab63105dc892dc641b5b6 100644 (file)
@@ -51,8 +51,8 @@ class ModuleGlobops : public Module
 {
        CommandGlobops cmd;
  public:
-       ModuleGlobops(InspIRCd* Me)
-               : Module(Me), cmd(this)
+       ModuleGlobops()
+               : cmd(this)
        {
                ServerInstance->AddCommand(&cmd);
                ServerInstance->SNO->EnableSnomask('g',"GLOBOPS");
index f16c64e82f483dff55f2b67442392b16bd13bf96..bcf1f1e20fd58f398acbf062176e7811896e8b33 100644 (file)
@@ -22,7 +22,7 @@ static std::map<irc::string, std::string> helpop_map;
 class Helpop : public ModeHandler
 {
  public:
-       Helpop(InspIRCd* Instance, Module* Creator) : ModeHandler(Creator, 'h', PARAM_NONE, MODETYPE_USER)
+       Helpop(Module* Creator) : ModeHandler(Creator, 'h', PARAM_NONE, MODETYPE_USER)
        {
                oper = true;
        }
@@ -120,8 +120,8 @@ class ModuleHelpop : public Module
                Helpop ho;
 
        public:
-               ModuleHelpop(InspIRCd* Me)
-                       : Module(Me), cmd(this), ho(Me, this)
+               ModuleHelpop()
+                       : cmd(this), ho(this)
                {
                        ReadConfig();
                        if (!ServerInstance->Modes->AddMode(&ho))
@@ -133,7 +133,7 @@ class ModuleHelpop : public Module
 
                virtual void ReadConfig()
                {
-                       ConfigReader MyConf(ServerInstance);
+                       ConfigReader MyConf;
 
                        helpop_map.clear();
 
index 6c3dba88ff5ac3d1edd1db3c33dd7a779d0b001a..0d405186b0e60e18aca512c7bbf1e9471c6b4c54 100644 (file)
@@ -20,7 +20,7 @@
 class HideChans : public ModeHandler
 {
  public:
-       HideChans(InspIRCd* Instance, Module* Creator) : ModeHandler(Creator, 'I', PARAM_NONE, MODETYPE_USER) { }
+       HideChans(Module* Creator) : ModeHandler(Creator, 'I', PARAM_NONE, MODETYPE_USER) { }
 
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
        {
@@ -50,7 +50,7 @@ class ModuleHideChans : public Module
        bool AffectsOpers;
        HideChans hm;
  public:
-       ModuleHideChans(InspIRCd* Me) : Module(Me), hm(Me, this)
+       ModuleHideChans() : hm(this)
        {
                if (!ServerInstance->Modes->AddMode(&hm))
                        throw ModuleException("Could not add new modes!");
@@ -71,7 +71,7 @@ class ModuleHideChans : public Module
 
        virtual void OnRehash(User* user)
        {
-               ConfigReader conf(ServerInstance);
+               ConfigReader conf;
                AffectsOpers = conf.ReadFlag("hidechans", "affectsopers", 0);
        }
 
index 8294f53905790976fccbeb38ece6cef6e0552cd3..b9ea5fa2a02f5d3830cafd335167e2754cfa70bc 100644 (file)
@@ -20,7 +20,7 @@
 class HideOper : public ModeHandler
 {
  public:
-       HideOper(InspIRCd* Instance, Module* Creator) : ModeHandler(Creator, 'H', PARAM_NONE, MODETYPE_USER)
+       HideOper(Module* Creator) : ModeHandler(Creator, 'H', PARAM_NONE, MODETYPE_USER)
        {
                oper = true;
        }
@@ -52,8 +52,8 @@ class ModuleHideOper : public Module
 {
        HideOper hm;
  public:
-       ModuleHideOper(InspIRCd* Me)
-               : Module(Me), hm(Me, this)
+       ModuleHideOper()
+               : hm(this)
        {
 
                if (!ServerInstance->Modes->AddMode(&hm))
index a89b5949d95c4cf0dae19cd02c0a4479c87a1264..cb5ab6925396ad4530239f1c88ca5b1cc32063ec 100644 (file)
@@ -36,9 +36,8 @@ class ModuleHostChange : public Module
        std::string MySeparator;
 
  public:
-       ModuleHostChange(InspIRCd* Me)
-               : Module(Me)
-       {
+       ModuleHostChange()
+                       {
                OnRehash(NULL);
                Implementation eventlist[] = { I_OnRehash, I_OnUserConnect };
                ServerInstance->Modules->Attach(eventlist, this, 2);
@@ -62,7 +61,7 @@ class ModuleHostChange : public Module
 
        virtual void OnRehash(User* user)
        {
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
                MySuffix = Conf.ReadValue("host","suffix",0);
                MyPrefix = Conf.ReadValue("host","prefix","",0);
                MySeparator = Conf.ReadValue("host","separator",".",0);
index 929697c5fb6d8df0026436d4b37cfb2a04ec9dc3..e9d05d3e54c11c93fd63efb4cfd894466ff8c5d1 100644 (file)
@@ -315,11 +315,11 @@ class HttpServerSocket : public BufferedSocket
                        claimed = false;
                        HTTPRequest httpr(request_type,uri,&headers,this,ip,postdata);
                        Event acl((char*)&httpr, (Module*)HttpModule, "httpd_acl");
-                       acl.Send(ServerInstance);
+                       acl.Send();
                        if (!claimed)
                        {
                                Event e((char*)&httpr, (Module*)HttpModule, "httpd_url");
-                               e.Send(ServerInstance);
+                               e.Send();
                                if (!claimed)
                                {
                                        SendHTTPError(404);
@@ -342,7 +342,7 @@ class HttpListener : public ListenSocketBase
        FileReader* index;
 
  public:
-       HttpListener(InspIRCd* Instance, FileReader *idx, int port, const std::string &addr) : ListenSocketBase(Instance, port, addr)
+       HttpListener(FileReader *idx, int port, const std::string &addr) : ListenSocketBase(port, addr)
        {
                this->index = idx;
        }
@@ -370,7 +370,7 @@ class ModuleHttpServer : public Module
                std::string indexfile;
                FileReader* index;
                HttpListener *http;
-               ConfigReader c(ServerInstance);
+               ConfigReader c;
 
                httpsocks.clear(); // XXX this will BREAK if this module is made rehashable
                httplisteners.clear();
@@ -381,16 +381,15 @@ class ModuleHttpServer : public Module
                        bindip = c.ReadValue("http", "ip", i);
                        port = c.ReadInteger("http", "port", i, true);
                        indexfile = c.ReadValue("http", "index", i);
-                       index = new FileReader(ServerInstance, indexfile);
+                       index = new FileReader(indexfile);
                        if (!index->Exists())
                                throw ModuleException("Can't read index file: "+indexfile);
-                       http = new HttpListener(ServerInstance, index, port, (char *)bindip.c_str()); // XXX this cast SUCKS.
+                       http = new HttpListener(index, port, (char *)bindip.c_str()); // XXX this cast SUCKS.
                        httplisteners.push_back(http);
                }
        }
 
-       ModuleHttpServer(InspIRCd* Me) : Module(Me)
-       {
+       ModuleHttpServer()      {
                ReadConfig();
                HttpModule = this;
                Implementation eventlist[] = { I_OnRequest };
index 812ea843f2db635c6f690f67d39ae8803046a9a5..8c682cfa9448d05ad12802d9f43a97cd69d5faf5 100644 (file)
@@ -47,7 +47,7 @@ class ModuleHTTPAccessList : public Module
        void ReadConfig()
        {
                acl_list.clear();
-               ConfigReader c(ServerInstance);
+               ConfigReader c;
                int n_items = c.Enumerate("httpdacl");
                for (int i = 0; i < n_items; ++i)
                {
@@ -88,8 +88,7 @@ class ModuleHTTPAccessList : public Module
                }
        }
 
-       ModuleHTTPAccessList(InspIRCd* Me) : Module(Me)
-       {
+       ModuleHTTPAccessList()  {
                ReadConfig();
                Implementation eventlist[] = { I_OnEvent, I_OnRequest };
                ServerInstance->Modules->Attach(eventlist, this, 2);
index 5f902eb2998e43a2528ebd6b9ae6fe6ef4c1267e..55f943d2c33f32b8f0fafe7792a88a915902c1c4 100644 (file)
@@ -28,12 +28,11 @@ class ModuleHttpStats : public Module
 
        void ReadConfig()
        {
-               ConfigReader c(ServerInstance);
+               ConfigReader c;
                this->stylesheet = c.ReadValue("httpstats", "stylesheet", 0);
        }
 
-       ModuleHttpStats(InspIRCd* Me) : Module(Me)
-       {
+       ModuleHttpStats()       {
                ReadConfig();
                this->changed = true;
                Implementation eventlist[] = { I_OnEvent, I_OnRequest };
index 01d77d806c3da39987f7a5a914fe15954c245d0f..46f474e2df2c8a61f9b2ef19cb85dd533e815e78 100644 (file)
@@ -28,12 +28,11 @@ class ModuleHttpStats : public Module
 
        void ReadConfig()
        {
-               ConfigReader c(ServerInstance);
+               ConfigReader c;
                this->stylesheet = c.ReadValue("httpstats", "stylesheet", 0);
        }
 
-       ModuleHttpStats(InspIRCd* Me) : Module(Me)
-       {
+       ModuleHttpStats()       {
                ReadConfig();
                this->changed = true;
                Implementation eventlist[] = { I_OnEvent, I_OnRequest };
index 66bd8835ade5067f23fe9470cf985cce63192f90..d74873e00770d9aaeb3b8c93552f5a7babff61ff 100644 (file)
@@ -75,13 +75,12 @@ class IdentRequestSocket : public EventHandler
 {
  private:
        User *user;                     /* User we are attached to */
-       InspIRCd* ServerInstance;       /* Server instance */
        bool done;                      /* True if lookup is finished */
        std::string result;             /* Holds the ident string if done */
  public:
        time_t age;
 
-       IdentRequestSocket(InspIRCd *Server, User* u) : user(u), ServerInstance(Server), result(u->ident)
+       IdentRequestSocket(User* u) : user(u), result(u->ident)
        {
                age = ServerInstance->Time();
                socklen_t size = 0;
@@ -280,9 +279,9 @@ class ModuleIdent : public Module
        ConfigReader *Conf;
        SimpleExtItem<IdentRequestSocket> ext;
  public:
-       ModuleIdent(InspIRCd *Me) : Module(Me), ext("ident_socket", this)
+       ModuleIdent() : ext("ident_socket", this)
        {
-               Conf = new ConfigReader(ServerInstance);
+               Conf = new ConfigReader;
                OnRehash(NULL);
                Implementation eventlist[] = { I_OnRehash, I_OnUserRegister, I_OnCheckReady, I_OnCleanup, I_OnUserDisconnect };
                ServerInstance->Modules->Attach(eventlist, this, 5);
@@ -301,7 +300,7 @@ class ModuleIdent : public Module
        virtual void OnRehash(User *user)
        {
                delete Conf;
-               Conf = new ConfigReader(ServerInstance);
+               Conf = new ConfigReader;
 
                RequestTimeout = Conf->ReadInteger("ident", "timeout", 0, true);
                if (!RequestTimeout)
@@ -333,7 +332,7 @@ class ModuleIdent : public Module
 
                try
                {
-                       IdentRequestSocket *isock = new IdentRequestSocket(ServerInstance, user);
+                       IdentRequestSocket *isock = new IdentRequestSocket(user);
                        ext.set(user, isock);
                }
                catch (ModuleException &e)
index 068e6d666b905c246748029bb26cf639155faf5f..cfccc3de77cb74bd00d47f488a51a2be2abb8f03 100644 (file)
@@ -19,7 +19,7 @@
 class InvisibleMode : public ModeHandler
 {
  public:
-       InvisibleMode(InspIRCd* Instance, Module* Creator) : ModeHandler(Creator, 'Q', PARAM_NONE, MODETYPE_USER)
+       InvisibleMode(Module* Creator) : ModeHandler(Creator, 'Q', PARAM_NONE, MODETYPE_USER)
        {
                oper = true;
        }
@@ -80,7 +80,7 @@ class InvisibleMode : public ModeHandler
 class InvisibleDeOper : public ModeWatcher
 {
  public:
-       InvisibleDeOper(InspIRCd* Instance) : ModeWatcher(Instance, 'o', MODETYPE_USER)
+       InvisibleDeOper() : ModeWatcher('o', MODETYPE_USER)
        {
        }
 
@@ -105,8 +105,7 @@ class ModuleInvisible : public Module
        InvisibleMode qm;
        InvisibleDeOper ido;
  public:
-       ModuleInvisible(InspIRCd* Me)
-               : Module(Me), qm(Me, this), ido(Me)
+       ModuleInvisible() : qm(this)
        {
                if (!ServerInstance->Modes->AddMode(&qm))
                        throw ModuleException("Could not add new modes!");
index e2a68120bee2f6b9300f899ca0ea89bf48d451e9..777e8efd78ba24d553c8f8863ec4441510ac8860 100644 (file)
  * Now supports CIDR and IP addresses -- Brain
  */
 
-class InspIRCd* ServerInstance;
-
 /** Handles channel mode +I
  */
 class InviteException : public ListModeBase
 {
  public:
-       InviteException(InspIRCd* Instance, Module* Creator) : ListModeBase(Instance, Creator, 'I', "End of Channel Invite Exception List", 346, 347, true) { }
+       InviteException(Module* Creator) : ListModeBase(Creator, 'I', "End of Channel Invite Exception List", 346, 347, true) { }
 };
 
 class ModuleInviteException : public Module
 {
        InviteException ie;
 public:
-       ModuleInviteException(InspIRCd* Me) : Module(Me), ie(Me, this)
+       ModuleInviteException() : ie(this)
        {
                if (!ServerInstance->Modes->AddMode(&ie))
                        throw ModuleException("Could not add new modes!");
index 854276500d7f65924225575e0490936e62c979e4..2520cbfcf880c6e8aa391c6d25fb2e1b6bc17b98 100644 (file)
@@ -19,8 +19,6 @@
  */
 class joinfloodsettings : public classbase
 {
- private:
-       InspIRCd* ServerInstance;
  public:
        int secs;
        int joins;
@@ -29,7 +27,7 @@ class joinfloodsettings : public classbase
        int counter;
        bool locked;
 
-       joinfloodsettings(InspIRCd *Instance, int b, int c) : ServerInstance(Instance), secs(b), joins(c)
+       joinfloodsettings(int b, int c) : secs(b), joins(c)
        {
                reset = ServerInstance->Time() + secs;
                counter = 0;
@@ -87,7 +85,7 @@ class JoinFlood : public ModeHandler
 {
  public:
        SimpleExtItem<joinfloodsettings> ext;
-       JoinFlood(InspIRCd* Instance, Module* Creator) : ModeHandler(Creator, 'j', PARAM_SETONLY, MODETYPE_CHANNEL),
+       JoinFlood(Module* Creator) : ModeHandler(Creator, 'j', PARAM_SETONLY, MODETYPE_CHANNEL),
                ext("joinflood", Creator) { }
 
        ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string &parameter)
@@ -137,7 +135,7 @@ class JoinFlood : public ModeHandler
                                        if (!f)
                                        {
                                                parameter = ConvToStr(njoins) + ":" +ConvToStr(nsecs);
-                                               f = new joinfloodsettings(ServerInstance, nsecs, njoins);
+                                               f = new joinfloodsettings(nsecs, njoins);
                                                ext.set(channel, f);
                                                channel->SetModeParam('j', parameter);
                                                return MODEACTION_ALLOW;
@@ -156,7 +154,7 @@ class JoinFlood : public ModeHandler
                                                        // new mode param, replace old with new
                                                        if ((nsecs > 0) && (njoins > 0))
                                                        {
-                                                               f = new joinfloodsettings(ServerInstance, nsecs, njoins);
+                                                               f = new joinfloodsettings(nsecs, njoins);
                                                                ext.set(channel, f);
                                                                channel->SetModeParam('j', parameter);
                                                                return MODEACTION_ALLOW;
@@ -196,8 +194,8 @@ class ModuleJoinFlood : public Module
 
  public:
 
-       ModuleJoinFlood(InspIRCd* Me)
-               : Module(Me), jf(Me, this)
+       ModuleJoinFlood()
+               : jf(this)
        {
 
                if (!ServerInstance->Modes->AddMode(&jf))
index 78d4bf4b812e907c106bc9d99233363984ea8ca4..0e8f13c4d4f0efe41c4ae0cd01db91bb8deb29bd 100644 (file)
@@ -135,7 +135,7 @@ class ModuleJumpServer : public Module
 {
        CommandJumpserver js;
  public:
-       ModuleJumpServer(InspIRCd* Me) : js(this)
+       ModuleJumpServer() : js(this)
        {
                ServerInstance->AddCommand(&js);
                Implementation eventlist[] = { I_OnUserRegister };
index 05deee417bc78f226797bf268805992112378c66..33eefadb2e110a4e55824d7c05664f81842cefda 100644 (file)
@@ -31,7 +31,7 @@ class KickRejoin : public ModeHandler
 {
  public:
        SimpleExtItem<delaylist> ext;
-       KickRejoin(InspIRCd* Instance, Module* Creator) : ModeHandler(Creator, 'J', PARAM_SETONLY, MODETYPE_CHANNEL),
+       KickRejoin(Module* Creator) : ModeHandler(Creator, 'J', PARAM_SETONLY, MODETYPE_CHANNEL),
                ext("norejoinusers", Creator) { }
 
        ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string &parameter)
@@ -104,8 +104,8 @@ class ModuleKickNoRejoin : public Module
 
 public:
 
-       ModuleKickNoRejoin(InspIRCd* Me)
-               : Module(Me), kr(Me, this)
+       ModuleKickNoRejoin()
+               : kr(this)
        {
                if (!ServerInstance->Modes->AddMode(&kr))
                        throw ModuleException("Could not add new modes!");
index e2f9310d6e2ea097a4cb5d151fa117cbf9ce7e59..28b3b1c50d27702824b48eb85115f16bb685737f 100644 (file)
@@ -77,7 +77,7 @@ class CommandKnock : public Command
 class Knock : public SimpleChannelModeHandler
 {
  public:
-       Knock(InspIRCd* Instance, Module* Creator) : SimpleChannelModeHandler(Instance, Creator, 'K') { }
+       Knock(Module* Creator) : SimpleChannelModeHandler(Creator, 'K') { }
 };
 
 class ModuleKnock : public Module
@@ -85,7 +85,7 @@ class ModuleKnock : public Module
        CommandKnock cmd;
        Knock kn;
  public:
-       ModuleKnock(InspIRCd* Me) : Module(Me), cmd(this), kn(Me, this)
+       ModuleKnock() : cmd(this), kn(this)
        {
                if (!ServerInstance->Modes->AddMode(&kn))
                        throw ModuleException("Could not add new modes!");
index 6844fc95393b222ad6446add064d867839b357b7..78c15dead9f4ebb3b8609a6afbc024ea5c9a7ec6 100644 (file)
@@ -74,7 +74,7 @@ private:
        }
 
 public:
-       ModuleLockserv(InspIRCd* Me) : lockcommand(this, locked), unlockcommand(this, locked)
+       ModuleLockserv() : lockcommand(this, locked), unlockcommand(this, locked)
        {
                ResetLocked();
                ServerInstance->AddCommand(&lockcommand);
index 9a46df1d4f83179fddbeda1537a0cc452f55ed52..4c9d0591f38905c5cf132560db6e488ea5ab378b 100644 (file)
@@ -19,9 +19,8 @@ class ModuleMapHide : public Module
 {
        std::string url;
  public:
-       ModuleMapHide(InspIRCd* Me)
-               : Module(Me)
-       {
+       ModuleMapHide()
+                       {
                ServerInstance->Modules->Attach(I_OnPreCommand, this);
                ServerInstance->Modules->Attach(I_OnRehash, this);
                OnRehash(NULL);
@@ -29,7 +28,7 @@ class ModuleMapHide : public Module
 
        void OnRehash(User* user)
        {
-               ConfigReader MyConf(ServerInstance);
+               ConfigReader MyConf;
                url = MyConf.ReadValue("security", "maphide", 0);
        }
 
index 2771ba495468afeab069fb21f9fa99e5e6d893db..911f6d9263ebd6a5bf448a28a5698f270659560c 100644 (file)
@@ -264,8 +264,8 @@ class ModuleMD5 : public Module
 
  public:
 
-       ModuleMD5(InspIRCd* Me)
-               : Module(Me), key(NULL), chars(NULL)
+       ModuleMD5()
+               : key(NULL), chars(NULL)
        {
                ServerInstance->Modules->PublishInterface("HashRequest", this);
                Implementation eventlist[] = { I_OnRequest };
index 611ff953f3b0c98eb281d7a689864c320af46bbf..5a40664d9b0f81c313e5408ff86bda5735ab8472 100644 (file)
@@ -28,7 +28,7 @@ class floodsettings : public classbase
        time_t reset;
        std::map<User*,int> counters;
 
-       floodsettings(InspIRCd *Instance, bool a, int b, int c) : ServerInstance(Instance), ban(a), secs(b), lines(c)
+       floodsettings(bool a, int b, int c) : ban(a), secs(b), lines(c)
        {
                reset = ServerInstance->Time() + secs;
        };
@@ -77,7 +77,7 @@ class MsgFlood : public ModeHandler
 {
  public:
        SimpleExtItem<floodsettings> ext;
-       MsgFlood(InspIRCd* Instance, Module* Creator) : ModeHandler(Creator, 'f', PARAM_SETONLY, MODETYPE_CHANNEL),
+       MsgFlood(Module* Creator) : ModeHandler(Creator, 'f', PARAM_SETONLY, MODETYPE_CHANNEL),
                ext("messageflood", Creator) { }
 
        ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string &parameter)
@@ -137,7 +137,7 @@ class MsgFlood : public ModeHandler
                                        if (!f)
                                        {
                                                parameter = std::string(ban ? "*" : "") + ConvToStr(nlines) + ":" +ConvToStr(nsecs);
-                                               f = new floodsettings(ServerInstance,ban,nsecs,nlines);
+                                               f = new floodsettings(ban,nsecs,nlines);
                                                ext.set(channel, f);
                                                channel->SetModeParam('f', parameter);
                                                return MODEACTION_ALLOW;
@@ -155,7 +155,7 @@ class MsgFlood : public ModeHandler
                                                {
                                                        if ((((nlines != f->lines) || (nsecs != f->secs) || (ban != f->ban))) && (((nsecs > 0) && (nlines > 0))))
                                                        {
-                                                               floodsettings *fs = new floodsettings(ServerInstance,ban,nsecs,nlines);
+                                                               floodsettings *fs = new floodsettings(ban,nsecs,nlines);
                                                                ext.set(channel, fs);
                                                                channel->SetModeParam('f', parameter);
                                                                return MODEACTION_ALLOW;
@@ -195,8 +195,8 @@ class ModuleMsgFlood : public Module
 
  public:
 
-       ModuleMsgFlood(InspIRCd* Me)
-               : Module(Me), mf(Me, this)
+       ModuleMsgFlood()
+               : mf(this)
        {
                if (!ServerInstance->Modes->AddMode(&mf))
                        throw ModuleException("Could not add new modes!");
@@ -207,7 +207,7 @@ class ModuleMsgFlood : public Module
 
        ModResult ProcessMessages(User* user,Channel* dest, const std::string &text)
        {
-               if (!IS_LOCAL(user) || (CHANOPS_EXEMPT(ServerInstance, 'f') && dest->GetPrefixValue(user) == OP_VALUE))
+               if (!IS_LOCAL(user) || (CHANOPS_EXEMPT('f') && dest->GetPrefixValue(user) == OP_VALUE))
                {
                        return MOD_RES_PASSTHRU;
                }
index 6040252c10909b981e7357914aba10d20ec06505..6e3ca525fe19b1bb03d57e26f5dc2043b4a4333c 100644 (file)
@@ -19,8 +19,7 @@ class ModuleQuietBan : public Module
 {
  private:
  public:
-       ModuleQuietBan(InspIRCd* Me) : Module(Me)
-       {
+       ModuleQuietBan()        {
                Implementation eventlist[] = { I_OnUserPreMessage, I_OnUserPreNotice, I_On005Numeric };
                ServerInstance->Modules->Attach(eventlist, this, 3);
        }
index 6f954df645c6711fe102b2e2269b8385744a2f72..7614cdc7642b85ccb04045bec4730c746ef3a1e6 100644 (file)
@@ -20,7 +20,7 @@ class ModuleNamesX : public Module
 {
  public:
        GenericCap cap;
-       ModuleNamesX(InspIRCd* Me) : Module(Me), cap(this, "multi-prefix")
+       ModuleNamesX() : cap(this, "multi-prefix")
        {
                Implementation eventlist[] = { I_OnPreCommand, I_OnNamesListItem, I_On005Numeric, I_OnEvent };
                ServerInstance->Modules->Attach(eventlist, this, 4);
index 2fe8dcf3988789a6f8ced71646b5100784d75148..04b53f02cbea4e56c33ddcf598a15501df5c2bf7 100755 (executable)
@@ -24,9 +24,8 @@
 
 class lwbNickHandler : public HandlerBase2<bool, const char*, size_t>
 {
-       InspIRCd* Server;
  public:
-       lwbNickHandler(InspIRCd* Srv) : Server(Srv) { }
+       lwbNickHandler() { }
        virtual ~lwbNickHandler() { }
        virtual bool Call(const char*, size_t);
 };
@@ -214,29 +213,21 @@ bool lwbNickHandler::Call(const char* n, size_t max)
 class ModuleNationalChars : public Module
 {
  private:
-
-       InspIRCd* ServerInstance;
-       lwbNickHandler* myhandler;
+       lwbNickHandler myhandler;
        std::string charset, casemapping;
        unsigned char m_additional[256], m_additionalUp[256], m_lower[256], m_upper[256];
-       caller2<bool, const char*, size_t> rememberer;
+       caller2<bool, const char*, size_t> rememberer;
        bool forcequit;
        const unsigned char * lowermap_rememberer;
 
  public:
-       ModuleNationalChars(InspIRCd* Me) : Module(Me)
+       ModuleNationalChars() : rememberer(ServerInstance->IsNick)
        {
-               rememberer = (caller2<bool, const char*, size_t> *) malloc(sizeof(caller2<bool, const char*, size_t>));
-
                lowermap_rememberer = national_case_insensitive_map;
                memcpy(m_lower, rfc_case_insensitive_map, 256);
                national_case_insensitive_map = m_lower;
 
-               ServerInstance = Me;
-
-               *rememberer = ServerInstance->IsNick;
-               myhandler = new lwbNickHandler(ServerInstance);
-               ServerInstance->IsNick = myhandler;
+               ServerInstance->IsNick = &myhandler;
 
                Implementation eventlist[] = { I_OnRehash, I_On005Numeric };
                ServerInstance->Modules->Attach(eventlist, this, 2);
@@ -252,7 +243,7 @@ class ModuleNationalChars : public Module
 
        virtual void OnRehash(User* user)
        {
-               ConfigReader* conf = new ConfigReader(ServerInstance);
+               ConfigReader* conf = new ConfigReader;
                charset = conf->ReadValue("nationalchars", "file", 0);
                casemapping = conf->ReadValue("nationalchars", "casemapping", charset, 0, false);
                charset.insert(0, "../locales/");
@@ -279,9 +270,7 @@ class ModuleNationalChars : public Module
 
        virtual ~ModuleNationalChars()
        {
-               delete myhandler;
-               ServerInstance->IsNick = *rememberer;
-               free(rememberer);
+               ServerInstance->IsNick = rememberer;
                national_case_insensitive_map = lowermap_rememberer;
                CheckForceQuit("National characters module unloaded");
        }
index 5a59814d4b7fd1c04511649962fc71c212be7db3..4e6dca5b9ea376f3cdcaa40a0bac1eb2e864715e 100644 (file)
@@ -19,8 +19,6 @@
  */
 class nickfloodsettings : public classbase
 {
- private:
-       InspIRCd* ServerInstance;
  public:
        int secs;
        int nicks;
@@ -29,9 +27,9 @@ class nickfloodsettings : public classbase
        int counter;
        bool locked;
 
-       nickfloodsettings(InspIRCd *Instance, int b, int c) : ServerInstance(Instance), secs(b), nicks(c)
+       nickfloodsettings(int b, int c) : secs(b), nicks(c)
        {
-               reset = Instance->Time() + secs;
+               reset = ServerInstance->Time() + secs;
                counter = 0;
                locked = false;
        };
@@ -91,7 +89,7 @@ class NickFlood : public ModeHandler
 {
  public:
        SimpleExtItem<nickfloodsettings> ext;
-       NickFlood(InspIRCd* Instance, Module* Creator) : ModeHandler(Creator, 'F', PARAM_SETONLY, MODETYPE_CHANNEL),
+       NickFlood(Module* Creator) : ModeHandler(Creator, 'F', PARAM_SETONLY, MODETYPE_CHANNEL),
                ext("nickflood", Creator) { }
 
        ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string &parameter)
@@ -140,7 +138,7 @@ class NickFlood : public ModeHandler
                                        if (!f)
                                        {
                                                parameter = ConvToStr(nnicks) + ":" +ConvToStr(nsecs);
-                                               f = new nickfloodsettings(ServerInstance, nsecs, nnicks);
+                                               f = new nickfloodsettings(nsecs, nnicks);
                                                ext.set(channel, f);
                                                channel->SetModeParam('F', parameter);
                                                return MODEACTION_ALLOW;
@@ -159,7 +157,7 @@ class NickFlood : public ModeHandler
                                                        // new mode param, replace old with new
                                                        if ((nsecs > 0) && (nnicks > 0))
                                                        {
-                                                               f = new nickfloodsettings(ServerInstance, nsecs, nnicks);
+                                                               f = new nickfloodsettings(nsecs, nnicks);
                                                                ext.set(channel, f);
                                                                channel->SetModeParam('F', parameter);
                                                                return MODEACTION_ALLOW;
@@ -197,8 +195,8 @@ class ModuleNickFlood : public Module
 
  public:
 
-       ModuleNickFlood(InspIRCd* Me)
-               : Module(Me), nf(Me, this)
+       ModuleNickFlood()
+               : nf(this)
        {
                if (!ServerInstance->Modes->AddMode(&nf))
                        throw ModuleException("Could not add new modes!");
@@ -219,7 +217,7 @@ class ModuleNickFlood : public Module
                        nickfloodsettings *f = nf.ext.get(channel);
                        if (f)
                        {
-                               if (CHANOPS_EXEMPT(ServerInstance, 'F') && channel->GetPrefixValue(user) == OP_VALUE)
+                               if (CHANOPS_EXEMPT('F') && channel->GetPrefixValue(user) == OP_VALUE)
                                        continue;
 
                                if (f->islocked())
@@ -256,7 +254,7 @@ class ModuleNickFlood : public Module
                        nickfloodsettings *f = nf.ext.get(channel);
                        if (f)
                        {
-                               if (CHANOPS_EXEMPT(ServerInstance, 'F') && channel->GetPrefixValue(user) == OP_VALUE)
+                               if (CHANOPS_EXEMPT('F') && channel->GetPrefixValue(user) == OP_VALUE)
                                        return;
                                
                                /* moved this here to avoid incrementing the counter for nick
index 7e13094573a75841ade64502bc4a9d03b44db029..755ae6da4114a4f0a349389ad1830b6c16cbc628 100644 (file)
@@ -151,8 +151,8 @@ class ModuleNickLock : public Module
        CommandNicklock cmd1;
        CommandNickunlock cmd2;
  public:
-       ModuleNickLock(InspIRCd* Me)
-               : Module(Me), locked("nick_locked", this), cmd1(this, locked), cmd2(this, locked)
+       ModuleNickLock()
+               : locked("nick_locked", this), cmd1(this, locked), cmd2(this, locked)
        {
                ServerInstance->AddCommand(&cmd1);
                ServerInstance->AddCommand(&cmd2);
index eaadb59fea8fe3e7b6ceb86ff0f2d4001848f825..58b9b7dcb513c2645023dfcebd0c85bda72fbb5a 100644 (file)
@@ -18,7 +18,7 @@
 class NoCTCP : public ModeHandler
 {
  public:
-       NoCTCP(InspIRCd* Instance, Module* Creator) : ModeHandler(Creator, 'C', PARAM_NONE, MODETYPE_CHANNEL) { }
+       NoCTCP(Module* Creator) : ModeHandler(Creator, 'C', PARAM_NONE, MODETYPE_CHANNEL) { }
 
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
        {
@@ -50,8 +50,8 @@ class ModuleNoCTCP : public Module
 
  public:
 
-       ModuleNoCTCP(InspIRCd* Me)
-               : Module(Me), nc(Me, this)
+       ModuleNoCTCP()
+               : nc(this)
        {
                if (!ServerInstance->Modes->AddMode(&nc))
                        throw ModuleException("Could not add new modes!");
@@ -80,7 +80,7 @@ class ModuleNoCTCP : public Module
                {
                        Channel* c = (Channel*)dest;
 
-                       if (CHANOPS_EXEMPT(ServerInstance, 'C') && c->GetPrefixValue(user) == OP_VALUE)
+                       if (CHANOPS_EXEMPT('C') && c->GetPrefixValue(user) == OP_VALUE)
                        {
                                return MOD_RES_PASSTHRU;
                        }
index b060d87f83f94538dc58c4607e9260ba8108d83b..db77184d64a458a32d2abeeac1d9161c9e0befce 100644 (file)
@@ -18,7 +18,7 @@
 class NoKicks : public SimpleChannelModeHandler
 {
  public:
-       NoKicks(InspIRCd* Instance, Module* Creator) : SimpleChannelModeHandler(Instance, Creator, 'Q') { }
+       NoKicks(Module* Creator) : SimpleChannelModeHandler(Creator, 'Q') { }
 };
 
 class ModuleNoKicks : public Module
@@ -26,8 +26,8 @@ class ModuleNoKicks : public Module
        NoKicks nk;
 
  public:
-       ModuleNoKicks(InspIRCd* Me)
-               : Module(Me), nk(Me, this)
+       ModuleNoKicks()
+               : nk(this)
        {
                if (!ServerInstance->Modes->AddMode(&nk))
                        throw ModuleException("Could not add new modes!");
index 456d835806ce32d6bec354478e4f58250fa71184..2ed25dfe5a0b83bb0a945b981f6eb175ee801a60 100644 (file)
@@ -18,7 +18,7 @@
 class NoNicks : public ModeHandler
 {
  public:
-       NoNicks(InspIRCd* Instance, Module* Creator) : ModeHandler(Creator, 'N', PARAM_NONE, MODETYPE_CHANNEL) { }
+       NoNicks(Module* Creator) : ModeHandler(Creator, 'N', PARAM_NONE, MODETYPE_CHANNEL) { }
 
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
        {
@@ -47,7 +47,7 @@ class ModuleNoNickChange : public Module
 {
        NoNicks nn;
  public:
-       ModuleNoNickChange(InspIRCd* Me) : Module(Me), nn(Me, this)
+       ModuleNoNickChange() : nn(this)
        {
                ServerInstance->Modes->AddMode(&nn);
                Implementation eventlist[] = { I_OnUserPreNick, I_On005Numeric };
@@ -86,7 +86,7 @@ class ModuleNoNickChange : public Module
                {
                        Channel* curr = *i;
 
-                       if (CHANOPS_EXEMPT(ServerInstance, 'N') && curr->GetPrefixValue(user) == OP_VALUE)
+                       if (CHANOPS_EXEMPT('N') && curr->GetPrefixValue(user) == OP_VALUE)
                                continue;
 
                        if (!curr->GetExtBanStatus(user, 'N').check(!curr->IsModeSet('N')))
index e5a3f9996053d8aa97899b7bf45b53c79fab5494..c3523a7ef88ab138464c4af43ea2f1c3b90c5ba1 100644 (file)
@@ -18,7 +18,7 @@
 class NoNotice : public SimpleChannelModeHandler
 {
  public:
-       NoNotice(InspIRCd* Instance, Module* Creator) : SimpleChannelModeHandler(Instance, Creator, 'T') { }
+       NoNotice(Module* Creator) : SimpleChannelModeHandler(Creator, 'T') { }
 };
 
 class ModuleNoNotice : public Module
@@ -26,8 +26,8 @@ class ModuleNoNotice : public Module
        NoNotice nt;
  public:
 
-       ModuleNoNotice(InspIRCd* Me)
-               : Module(Me), nt(Me, this)
+       ModuleNoNotice()
+               : nt(this)
        {
                if (!ServerInstance->Modes->AddMode(&nt))
                        throw ModuleException("Could not add new modes!");
@@ -52,7 +52,7 @@ class ModuleNoNotice : public Module
                                        // ulines are exempt.
                                        return MOD_RES_PASSTHRU;
                                }
-                               else if (CHANOPS_EXEMPT(ServerInstance, 'T') && c->GetPrefixValue(user) == OP_VALUE)
+                               else if (CHANOPS_EXEMPT('T') && c->GetPrefixValue(user) == OP_VALUE)
                                {
                                        // channel ops are exempt if set in conf.
                                        return MOD_RES_PASSTHRU;
index 32500f06907653ab5c5ebb6261ba211dcce2b01d..27015914733ad44d4a59740500081b6e6120cc55 100644 (file)
@@ -19,8 +19,7 @@ class ModulePartMsgBan : public Module
 {
  private:
  public:
-       ModulePartMsgBan(InspIRCd* Me) : Module(Me)
-       {
+       ModulePartMsgBan()      {
                Implementation eventlist[] = { I_OnUserPart, I_On005Numeric };
                ServerInstance->Modules->Attach(eventlist, this, 2);
        }
index b8c12f00a3b9ae07561d98c1cac5a6954481b245..8b8c1401e3f81334802c8df7204a4462ba884a3f 100644 (file)
@@ -60,7 +60,7 @@ class CommandOjoin : public Command
                }
 
                active = true;
-               Channel* channel = Channel::JoinUser(ServerInstance, user, parameters[0].c_str(), false, "", false);
+               Channel* channel = Channel::JoinUser(user, parameters[0].c_str(), false, "", false);
                active = false;
 
                if (channel)
@@ -133,7 +133,7 @@ class NetworkPrefix : public ModeHandler
                const UserMembList* cl = channel->GetUsers();
                std::vector<std::string> mode_junk;
                mode_junk.push_back(channel->name);
-               irc::modestacker modestack(ServerInstance, false);
+               irc::modestacker modestack(false);
                std::deque<std::string> stackresult;
 
                for (UserMembCIter i = cl->begin(); i != cl->end(); i++)
@@ -235,8 +235,8 @@ class ModuleOjoin : public Module
 
  public:
 
-       ModuleOjoin(InspIRCd* Me)
-               : Module(Me), np(NULL), mycommand(this)
+       ModuleOjoin()
+               : np(NULL), mycommand(this)
        {
                /* Load config stuff */
                OnRehash(NULL);
@@ -271,7 +271,7 @@ class ModuleOjoin : public Module
 
        void OnRehash(User* user)
        {
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
 
                if (!np)
                {
index 1dbc61f902e556f0858c4daa399f339f4a806a9e..edafcd0712e982f83c4f7526772870dd0969dc59 100644 (file)
@@ -19,7 +19,7 @@ class OperChans : public ModeHandler
 {
  public:
        /* This is an oper-only mode */
-       OperChans(InspIRCd* Instance, Module* Creator) : ModeHandler(Creator, 'O', PARAM_NONE, MODETYPE_CHANNEL) { oper = true; }
+       OperChans(Module* Creator) : ModeHandler(Creator, 'O', PARAM_NONE, MODETYPE_CHANNEL) { oper = true; }
 
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
        {
@@ -48,8 +48,8 @@ class ModuleOperChans : public Module
 {
        OperChans oc;
  public:
-       ModuleOperChans(InspIRCd* Me)
-               : Module(Me), oc(Me, this)
+       ModuleOperChans()
+               : oc(this)
        {
                if (!ServerInstance->Modes->AddMode(&oc))
                        throw ModuleException("Could not add new modes!");
index a32f39176b4d846df4c14c958cc33e4029c895bb..e8e9215b4eaab87a2a478dd9a34d3f9b437ae6e2 100644 (file)
@@ -22,8 +22,7 @@ class ModuleOperInvex : public Module
 {
  private:
  public:
-       ModuleOperInvex(InspIRCd* Me) : Module(Me)
-       {
+       ModuleOperInvex()       {
                Implementation eventlist[] = { I_OnCheckBan, I_On005Numeric };
                ServerInstance->Modules->Attach(eventlist, this, 2);
        }
index 6b94a4ef9054dd787c6732cd76b9d35af7df07ee..ac4aab54851a3551f2438422843d8658058fa61a 100644 (file)
@@ -43,8 +43,7 @@ class ModuleOperjoin : public Module
                }
 
        public:
-               ModuleOperjoin(InspIRCd* Me) : Module(Me)
-               {
+               ModuleOperjoin()                {
                        OnRehash(NULL);
                Implementation eventlist[] = { I_OnPostOper, I_OnRehash };
                ServerInstance->Modules->Attach(eventlist, this, 2);
@@ -53,7 +52,7 @@ class ModuleOperjoin : public Module
 
                virtual void OnRehash(User* user)
                {
-                       ConfigReader* conf = new ConfigReader(ServerInstance);
+                       ConfigReader* conf = new ConfigReader;
 
                        operChan = conf->ReadValue("operjoin", "channel", 0);
                        override = conf->ReadFlag("operjoin", "override", "0", 0);
@@ -92,7 +91,7 @@ class ModuleOperjoin : public Module
 
                        for(std::vector<std::string>::iterator it = operChans.begin(); it != operChans.end(); it++)
                                if (ServerInstance->IsChannel(it->c_str(), ServerInstance->Config->Limits.ChanMax))
-                                       Channel::JoinUser(ServerInstance, user, it->c_str(), override, "", false, ServerInstance->Time());
+                                       Channel::JoinUser(user, it->c_str(), override, "", false, ServerInstance->Time());
 
                        std::map<std::string, std::vector<std::string> >::iterator i = operTypeChans.find(user->oper);
 
@@ -103,7 +102,7 @@ class ModuleOperjoin : public Module
                                {
                                        if (ServerInstance->IsChannel(it->c_str(), ServerInstance->Config->Limits.ChanMax))
                                        {
-                                               Channel::JoinUser(ServerInstance, user, it->c_str(), override, "", false, ServerInstance->Time());
+                                               Channel::JoinUser(user, it->c_str(), override, "", false, ServerInstance->Time());
                                        }
                                }
                        }
index 979ce8654be9384ae3fe8ea58660be528b821c3b..b992b33b61bea8ac9173e06be5f5caf6418759e6 100644 (file)
@@ -19,10 +19,9 @@ class ModuleOperLevels : public Module
        private:
                ConfigReader* conf;
        public:
-               ModuleOperLevels(InspIRCd* Me)
-                       : Module(Me)
-               {
-                       conf = new ConfigReader(ServerInstance);
+               ModuleOperLevels()
+                                       {
+                       conf = new ConfigReader;
                        Implementation eventlist[] = { I_OnRehash, I_OnKill };
                        ServerInstance->Modules->Attach(eventlist, this, 2);
                }
@@ -36,7 +35,7 @@ class ModuleOperLevels : public Module
                virtual void OnRehash(User* user)
                {
                        delete conf;
-                       conf = new ConfigReader(ServerInstance);
+                       conf = new ConfigReader;
                }
 
                virtual Version GetVersion()
index fb89b162f74db3976c4362e94ede86b02cc0eb03..e0ef99a22ed210aa6b2c927bc992dd0865754b9c 100644 (file)
@@ -20,8 +20,7 @@ class ModuleOperLog : public Module
  private:
 
  public:
-       ModuleOperLog(InspIRCd* Me) : Module(Me)
-       {
+       ModuleOperLog()         {
 
                Implementation eventlist[] = { I_OnPreCommand, I_On005Numeric };
                ServerInstance->Modules->Attach(eventlist, this, 2);
index 5b78e431b5866a09e8fd6a5c79544ce0b7e28496..3890f82e6626c947e6aabe00a9370580c43c1576 100644 (file)
@@ -23,11 +23,10 @@ class ModuleModesOnOper : public Module
        ConfigReader *Conf;
 
  public:
-       ModuleModesOnOper(InspIRCd* Me)
-               : Module(Me)
-       {
+       ModuleModesOnOper()
+                       {
 
-               Conf = new ConfigReader(ServerInstance);
+               Conf = new ConfigReader;
                Implementation eventlist[] = { I_OnPostOper, I_OnRehash };
                ServerInstance->Modules->Attach(eventlist, this, 2);
        }
@@ -36,7 +35,7 @@ class ModuleModesOnOper : public Module
        virtual void OnRehash(User* user)
        {
                delete Conf;
-               Conf = new ConfigReader(ServerInstance);
+               Conf = new ConfigReader;
        }
 
        virtual ~ModuleModesOnOper()
index 418c36b0c9f244592ab8d35e9740683042f6690c..411cd42c86cd23ceb9a65eb809f7f98e3bebaa7e 100644 (file)
@@ -63,7 +63,7 @@ class ModuleOpermotd : public Module
 
        void LoadOperMOTD()
        {
-               ConfigReader* conf = new ConfigReader(ServerInstance);
+               ConfigReader* conf = new ConfigReader;
                std::string filename;
                filename = conf->ReadValue("opermotd","file",0);
                if (opermotd)
@@ -71,17 +71,17 @@ class ModuleOpermotd : public Module
                        delete opermotd;
                        opermotd = NULL;
                }
-               opermotd = new FileReader(ServerInstance, filename);
+               opermotd = new FileReader(filename);
                onoper = conf->ReadFlag("opermotd","onoper","yes",0);
                delete conf;
        }
 
-       ModuleOpermotd(InspIRCd* Me)
-               : Module(Me), cmd(this)
+       ModuleOpermotd()
+               : cmd(this)
        {
                opermotd = NULL;
                ServerInstance->AddCommand(&cmd);
-               opermotd = new FileReader(ServerInstance);
+               opermotd = new FileReader;
                LoadOperMOTD();
                Implementation eventlist[] = { I_OnRehash, I_OnOper };
                ServerInstance->Modules->Attach(eventlist, this, 2);
index 732d588570df7b147563fb7ce58a9d9f603167be..10dcdb37d295178b5705508dfa6957d3a898da17 100644 (file)
@@ -24,7 +24,7 @@
 class OperPrefixMode : public ModeHandler
 {
        public:
-               OperPrefixMode(InspIRCd* Instance, Module* Creator, char pfx) : ModeHandler(Creator, 'y', PARAM_ALWAYS, MODETYPE_CHANNEL)
+               OperPrefixMode(Module* Creator, char pfx) : ModeHandler(Creator, 'y', PARAM_ALWAYS, MODETYPE_CHANNEL)
                {
                        list = true;
                        prefix = pfx;
@@ -78,12 +78,11 @@ class ModuleOperPrefixMode : public Module
  private:
        OperPrefixMode* opm;
  public:
-       ModuleOperPrefixMode(InspIRCd* Me) : Module(Me)
-       {
-               ConfigReader Conf(ServerInstance);
+       ModuleOperPrefixMode()  {
+               ConfigReader Conf;
                std::string pfx = Conf.ReadValue("operprefix", "prefix", "!", 0, false);
 
-               opm = new OperPrefixMode(ServerInstance, this, pfx[0]);
+               opm = new OperPrefixMode(this, pfx[0]);
                if ((!ServerInstance->Modes->AddMode(opm)))
                        throw ModuleException("Could not add a new mode!");
 
index 92f0f8efcbb3a83a4ec70b19de7621e36681be58..3c45bb37db64cb35e1ce566277c2eafffea10504 100644 (file)
@@ -26,9 +26,8 @@ class ModuleOverride : public Module
 
  public:
 
-       ModuleOverride(InspIRCd* Me)
-               : Module(Me)
-       {
+       ModuleOverride()
+                       {
                // read our config options (main config file)
                OnRehash(NULL);
                ServerInstance->SNO->EnableSnomask('G', "GODMODE");
@@ -43,7 +42,7 @@ class ModuleOverride : public Module
        void OnRehash(User* user)
        {
                // on a rehash we delete our classes for good measure and create them again.
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
 
                // re-read our config options on a rehash
                NoisyOverride = Conf.ReadFlag("override", "noisy", 0);
index 1617110d1b22739f35e0a2aed76e6dad87acd1bd..011a592e7bab1cde54a8619b8180620f74ad83b1 100644 (file)
@@ -75,8 +75,8 @@ class ModuleOperHash : public Module
        bool diduseiface; /* If we've called UseInterface yet. */
  public:
 
-       ModuleOperHash(InspIRCd* Me)
-               : Module(Me), cmd(this, hashers, names)
+       ModuleOperHash()
+               : cmd(this, hashers, names)
        {
                diduseiface = false;
 
index 60d2ec248671780eb3a1b3eba597b769ee8e6372..3e2e18a8e73abf6f9b14d4bf2e0960cc1afead01 100644 (file)
@@ -110,7 +110,7 @@ static bool WriteDatabase()
 class PermChannel : public ModeHandler
 {
  public:
-       PermChannel(InspIRCd* Instance, Module* Creator) : ModeHandler(Creator, 'P', PARAM_NONE, MODETYPE_CHANNEL) { }
+       PermChannel(Module* Creator) : ModeHandler(Creator, 'P', PARAM_NONE, MODETYPE_CHANNEL) { }
 
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
        {
@@ -175,7 +175,7 @@ class ModulePermanentChannels : public Module
        PermChannel p;
 public:
 
-       ModulePermanentChannels(InspIRCd* Me) : Module(Me), p(Me, this)
+       ModulePermanentChannels() : p(this)
        {
                if (!ServerInstance->Modes->AddMode(&p))
                        throw ModuleException("Could not add new modes!");
@@ -215,7 +215,7 @@ public:
                 * Process config-defined list of permanent channels.
                 * -- w00t
                 */
-               ConfigReader MyConf(ServerInstance);
+               ConfigReader MyConf;
 
                permchannelsconf = MyConf.ReadValue("permchanneldb", "filename", "", 0, false);
 
@@ -235,7 +235,7 @@ public:
 
                        if (!c)
                        {
-                               c = new Channel(ServerInstance, channel, ServerInstance->Time());
+                               c = new Channel(channel, ServerInstance->Time());
                                if (!topic.empty())
                                {
                                        c->SetTopic(NULL, topic, true);
index c3a9c514f3e21411164097979527cfc291d0973c..e2910e7cd96e003dc3f3f33479dde98a629a912a 100644 (file)
@@ -57,11 +57,11 @@ class ModuleRandQuote : public Module
        CommandRandquote cmd;
        ConfigReader *conf;
  public:
-       ModuleRandQuote(InspIRCd* Me)
-               : Module(Me), cmd(this)
+       ModuleRandQuote()
+               : cmd(this)
        {
 
-               conf = new ConfigReader(ServerInstance);
+               conf = new ConfigReader;
                // Sort the Randomizer thingie..
                srand(ServerInstance->Time());
 
@@ -74,7 +74,7 @@ class ModuleRandQuote : public Module
                        throw ModuleException("m_randquote: Quotefile not specified - Please check your config.");
                }
 
-               quotes = new FileReader(ServerInstance, q_file);
+               quotes = new FileReader(q_file);
                if(!quotes->Exists())
                {
                        throw ModuleException("m_randquote: QuoteFile not Found!! Please check your config - module will not function.");
index 13468823e63ccd748095c78d58749e1a9c7f8c60..6bd375f88e96fd12dad3a5b80714c15958b62541 100644 (file)
@@ -20,7 +20,7 @@
 class Redirect : public ModeHandler
 {
  public:
-       Redirect(InspIRCd* Instance, Module* Creator) : ModeHandler(Creator, 'L', PARAM_SETONLY, MODETYPE_CHANNEL) { }
+       Redirect(Module* Creator) : ModeHandler(Creator, 'L', PARAM_SETONLY, MODETYPE_CHANNEL) { }
 
        ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string &parameter)
        {
@@ -89,8 +89,8 @@ class ModuleRedirect : public Module
 
  public:
 
-       ModuleRedirect(InspIRCd* Me)
-               : Module(Me), re(Me, this)
+       ModuleRedirect()
+               : re(this)
        {
 
                if (!ServerInstance->Modes->AddMode(&re))
@@ -120,7 +120,7 @@ class ModuleRedirect : public Module
                                        }
 
                                        user->WriteNumeric(470, "%s %s %s :You may not join this channel, so you are automatically being transferred to the redirect channel.", user->nick.c_str(), cname, channel.c_str());
-                                       Channel::JoinUser(ServerInstance, user, channel.c_str(), false, "", false, ServerInstance->Time());
+                                       Channel::JoinUser(user, channel.c_str(), false, "", false, ServerInstance->Time());
                                        return MOD_RES_DENY;
                                }
                        }
index b10a5115b8cab3b6f7ee14a541b09167239b4b3a..c8cbc10b69c6c3db1a36df45a8dc186200a881ec 100644 (file)
@@ -20,10 +20,9 @@ class Regex : public classbase
 {
 protected:
        std::string regex_string; // The raw uncompiled regex string.
-       InspIRCd* ServerInstance;
 
        // Constructor may as well be protected, as this class is abstract.
-       Regex(const std::string& rx, InspIRCd* Me) : regex_string(rx), ServerInstance(Me)
+       Regex(const std::string& rx) : regex_string(rx)
        {
        }
 
index 8d7eaafc3b2cda9ab2c05f5401efe9d015891dfa..ef843cc767e07e0ff30150b2fda9c56d852196be 100644 (file)
@@ -20,7 +20,7 @@
 class GlobRegex : public Regex
 {
 public:
-       GlobRegex(const std::string& rx, InspIRCd* Me) : Regex(rx, Me)
+       GlobRegex(const std::string& rx) : Regex(rx)
        {
        }
 
@@ -37,11 +37,10 @@ public:
 class ModuleRegexGlob : public Module
 {
 public:
-       ModuleRegexGlob(InspIRCd* Me) : Module(Me)
-       {
-               Me->Modules->PublishInterface("RegularExpression", this);
+       ModuleRegexGlob()       {
+               ServerInstance->Modules->PublishInterface("RegularExpression", this);
                Implementation eventlist[] = { I_OnRequest };
-               Me->Modules->Attach(eventlist, this, 1);
+               ServerInstance->Modules->Attach(eventlist, this, 1);
        }
 
        virtual Version GetVersion()
@@ -64,7 +63,7 @@ public:
                {
                        RegexFactoryRequest* rfr = (RegexFactoryRequest*)request;
                        std::string rx = rfr->GetRegex();
-                       rfr->result = (Regex*)new GlobRegex(rx, ServerInstance);
+                       rfr->result = new GlobRegex(rx);
                        return "OK";
                }
                return NULL;
index 546d8235a28ce207d0f232c3a6101942c667b643..3354c11323f06f68b653a14a6f9ca77cc8c8d377 100644 (file)
@@ -18,9 +18,8 @@
 class ModuleRegOnlyCreate : public Module
 {
  public:
-       ModuleRegOnlyCreate(InspIRCd* Me)
-               : Module(Me)
-       {
+       ModuleRegOnlyCreate()
+                       {
                Implementation eventlist[] = { I_OnUserPreJoin };
                ServerInstance->Modules->Attach(eventlist, this, 1);
        }
index 09f60ad19835b66ac68a8ff878477ef0ed963712..ef60639f44a6f649749c10ec7c0068d9b1a32eea 100644 (file)
@@ -187,7 +187,7 @@ class ModuleRemove : public Module
 
 
  public:
-       ModuleRemove(InspIRCd*) : cmd1(this, supportnokicks), cmd2(this, supportnokicks)
+       ModuleRemove() : cmd1(this, supportnokicks), cmd2(this, supportnokicks)
        {
                ServerInstance->AddCommand(&cmd1);
                ServerInstance->AddCommand(&cmd2);
@@ -204,7 +204,7 @@ class ModuleRemove : public Module
 
        virtual void OnRehash(User* user)
        {
-               ConfigReader conf(ServerInstance);
+               ConfigReader conf;
                supportnokicks = conf.ReadFlag("remove", "supportnokicks", 0);
        }
 
index 8e60359f6860a1a7e4341fc8b24fc55d8bb5c50d..bc66afce5577bd14bb714662ada1484f0aa05849 100644 (file)
@@ -23,7 +23,7 @@ class ModuleRestrictChans : public Module
 
        void ReadConfig()
        {
-               ConfigReader* MyConf = new ConfigReader(ServerInstance);
+               ConfigReader* MyConf = new ConfigReader;
                allowchans.clear();
                for (int i = 0; i < MyConf->Enumerate("allowchannel"); i++)
                {
@@ -36,9 +36,8 @@ class ModuleRestrictChans : public Module
        }
 
  public:
-       ModuleRestrictChans(InspIRCd* Me)
-               : Module(Me)
-       {
+       ModuleRestrictChans()
+                       {
 
                ReadConfig();
                Implementation eventlist[] = { I_OnUserPreJoin, I_OnRehash };
index affcd5a24a2353889ec59644f2098aa02da4d626..de7737e66993a4dbd8c9145c21900669d5a02b7f 100644 (file)
@@ -21,9 +21,8 @@ class ModuleRestrictMsg : public Module
 
  public:
 
-       ModuleRestrictMsg(InspIRCd* Me)
-               : Module(Me)
-       {
+       ModuleRestrictMsg()
+                       {
 
                Implementation eventlist[] = { I_OnUserPreMessage, I_OnUserPreNotice };
                ServerInstance->Modules->Attach(eventlist, this, 2);
index 87ca21ada432de785abe17a3413db684f94ad061..1d3b1eb3406820252cf50adcd6bc11625c78ba21 100644 (file)
@@ -407,7 +407,7 @@ class ModuleRIPEMD160 : public Module
        byte *RMD(byte *message, dword length, unsigned int* key)
        {
                ServerInstance->Logs->Log("m_ripemd160", DEBUG, "RMD: '%s' length=%u", (const char*)message, length);
-               dword         MDbuf[RMDsize/32];   /* contains (A, B, C, D(E))   */
+               dword         MDbuf[RMDsize/32];   /* contains (A, B, C, D(E))   */
                static byte   hashcode[RMDsize/8]; /* for final hash-value         */
                dword         X[16];               /* current 16-word chunk        */
                unsigned int  i;                   /* counter                      */
@@ -442,7 +442,7 @@ class ModuleRIPEMD160 : public Module
 
  public:
 
-       ModuleRIPEMD160(InspIRCd* Me) : Module(Me), currkey(NULL), chars("0123456789abcdef")
+       ModuleRIPEMD160() : currkey(NULL), chars("0123456789abcdef")
        {
                ServerInstance->Modules->PublishInterface("HashRequest", this);
                Implementation eventlist[] = { I_OnRequest };
index 94f17ab8ca0ee8736e800ab92b566d69ea8bbf31..8bad04f292352142781111969e85b3b2abff5b16 100644 (file)
@@ -34,8 +34,8 @@ class RLine : public XLine
         * @param regex Pattern to match with
         * @
         */
-       RLine(InspIRCd* Instance, time_t s_time, long d, std::string src, std::string re, std::string regexs)
-               : XLine(Instance, s_time, d, src, re, "R")
+       RLine(time_t s_time, long d, std::string src, std::string re, std::string regexs)
+               : XLine(s_time, d, src, re, "R")
        {
                matchtext = regexs;
 
@@ -75,7 +75,7 @@ class RLine : public XLine
        void Apply(User* u)
        {
                if (ZlineOnMatch) {
-                       background_zlines.push_back(new ZLine(ServerInstance, ServerInstance->Time(), duration ? expiry - ServerInstance->Time() : 0, ServerInstance->Config->ServerName, reason.c_str(), u->GetIPString()));
+                       background_zlines.push_back(new ZLine(ServerInstance->Time(), duration ? expiry - ServerInstance->Time() : 0, ServerInstance->Config->ServerName, reason.c_str(), u->GetIPString()));
                }
                DefaultApply(u, "R", false);
        }
@@ -102,7 +102,7 @@ class RLine : public XLine
 class RLineFactory : public XLineFactory
 {
  public:
-       RLineFactory(InspIRCd* Instance) : XLineFactory(Instance, "R")
+       RLineFactory() : XLineFactory("R")
        {
        }
 
@@ -110,7 +110,7 @@ class RLineFactory : public XLineFactory
         */
        XLine* Generate(time_t set_time, long duration, std::string source, std::string reason, std::string xline_specific_mask)
        {
-               return new RLine(ServerInstance, set_time, duration, source, reason, xline_specific_mask);
+               return new RLine(set_time, duration, source, reason, xline_specific_mask);
        }
 
        ~RLineFactory()
@@ -143,7 +143,7 @@ class CommandRLine : public Command
 
                        try
                        {
-                               r = new RLine(ServerInstance, ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), parameters[0].c_str());
+                               r = new RLine(ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), parameters[0].c_str());
                        }
                        catch (ModuleException &e)
                        {
@@ -203,12 +203,12 @@ class ModuleRLine : public Module
        std::string RegexEngine;
 
  public:
-       ModuleRLine(InspIRCd* Me) : Module(Me), r(this), f(Me)
+       ModuleRLine() : r(this)
        {
                mymodule = this;
                OnRehash(NULL);
 
-               Me->Modules->UseInterface("RegularExpression");
+               ServerInstance->Modules->UseInterface("RegularExpression");
 
                ServerInstance->AddCommand(&r);
                ServerInstance->XLines->RegisterFactory(&f);
@@ -244,7 +244,7 @@ class ModuleRLine : public Module
 
        virtual void OnRehash(User *user)
        {
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
 
                if (!Conf.ReadFlag("rline", "zlineonmatch", 0) && ZlineOnMatch)
                        background_zlines.clear();
index 76b5f0e2eb77cf2acf1a290d434487e5856803ed..e57bb77b5be0c4a550699fec07d586768804e317 100644 (file)
@@ -42,7 +42,7 @@ class ModuleRpcJson : public Module
  private:
 
  public:
-       ModuleRpcJson(InspIRCd *Me) : Module(Me)
+       ModuleRpcJson()
        {
                ServerInstance->Modules->PublishInterface("RPC", this);
                Implementation eventlist[] = { I_OnEvent };
@@ -89,7 +89,7 @@ class ModuleRpcJson : public Module
 
                                        RPCRequest modreq("json", method->GetString(), params);
                                        Event mev((char*) &modreq, this, "RPCMethod");
-                                       mev.Send(ServerInstance);
+                                       mev.Send();
 
                                        if (!modreq.claimed)
                                                throw JsonException("Unrecognized method");
index 146eabacf54a073b573a2392b04a5947298cb6cb..a3397651087faf591867e43bfa4db4807fd43dd2 100644 (file)
@@ -22,8 +22,7 @@ class ModuleRPCTest : public Module
  private:
 
  public:
-       ModuleRPCTest(InspIRCd *Me) : Module(Me)
-       {
+       ModuleRPCTest()         {
                Implementation eventlist[] = { I_OnEvent };
                ServerInstance->Modules->Attach(eventlist, this, 1);
        }
index 325972d767aab44a539ddd08bf9d4f3a5d32b8a2..0160de7c2458a18e3c384495cb198dda39a57b85 100644 (file)
@@ -40,7 +40,7 @@ class ModuleSafeList : public Module
        SimpleExtItem<ListData> listData;
        LocalIntExt listTime;
  public:
-       ModuleSafeList(InspIRCd* Me) : Module(Me), listData("safelist_data", this), listTime("safelist_last", this)
+       ModuleSafeList() : listData("safelist_data", this), listTime("safelist_last", this)
        {
                OnRehash(NULL);
                Extensible::Register(&listData);
@@ -55,7 +55,7 @@ class ModuleSafeList : public Module
 
        void OnRehash(User* user)
        {
-               ConfigReader MyConf(ServerInstance);
+               ConfigReader MyConf;
                ThrottleSecs = MyConf.ReadInteger("safelist", "throttle", "60", 0, true);
                LimitList = MyConf.ReadInteger("safelist", "maxlisters", "50", 0, true);
                ServerNameSize = strlen(ServerInstance->Config->ServerName) + 4;
index 207415d9e346b87930df544de6a960c28136f996..28634e4f9e2c5bf42e75cb52cbee402ac27ae780 100644 (file)
@@ -49,7 +49,7 @@ class CommandSajoin : public Command
                         */
                        if (IS_LOCAL(dest))
                        {
-                               Channel::JoinUser(ServerInstance, dest, parameters[1].c_str(), true, "", false, ServerInstance->Time());
+                               Channel::JoinUser(dest, parameters[1].c_str(), true, "", false, ServerInstance->Time());
                                /* Fix for dotslasher and w00t - if the join didnt succeed, return CMD_FAILURE so that it doesnt propagate */
                                Channel* n = ServerInstance->FindChan(parameters[1]);
                                if (n)
@@ -97,8 +97,8 @@ class ModuleSajoin : public Module
 {
        CommandSajoin cmd;
  public:
-       ModuleSajoin(InspIRCd* Me)
-               : Module(Me), cmd(this)
+       ModuleSajoin()
+               : cmd(this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index cd0b07477bc990ad503c0c0c10b1a60c5c488b4d..fa4d95c969582cf9330ee1ac495c54a431c01c4d 100644 (file)
@@ -97,8 +97,8 @@ class ModuleSakick : public Module
 {
        CommandSakick cmd;
  public:
-       ModuleSakick(InspIRCd* Me)
-               : Module(Me), cmd(this)
+       ModuleSakick()
+               : cmd(this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index 1053f74d2281cbdcac9ff5efca0126393af8abfd..ba02c5e1645a0ab51d906c0bed1cae5266175fd3 100644 (file)
@@ -42,8 +42,8 @@ class ModuleSaMode : public Module
 {
        CommandSamode cmd;
  public:
-       ModuleSaMode(InspIRCd* Me)
-               : Module(Me), cmd(this)
+       ModuleSaMode()
+               : cmd(this)
        {
                ServerInstance->AddCommand(&cmd);
                ServerInstance->Modules->Attach(I_OnPreMode, this);
index cd3c0aff84620a315b24c6ba9a4d3201541268b1..c164de3a2b7ac541d97b0584c0fb3f56ec931508 100644 (file)
@@ -86,8 +86,8 @@ class ModuleSanick : public Module
 {
        CommandSanick cmd;
  public:
-       ModuleSanick(InspIRCd* Me)
-               : Module(Me), cmd(this)
+       ModuleSanick()
+               : cmd(this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index d4d4c58eccde7d1fb6a78bc0d0d8579e80310096..255648f850c0860428a10b28ac033d186c1b67d2 100644 (file)
@@ -97,8 +97,8 @@ class ModuleSapart : public Module
 {
        CommandSapart cmd;
  public:
-       ModuleSapart(InspIRCd* Me)
-               : Module(Me), cmd(this)
+       ModuleSapart()
+               : cmd(this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index 4d67a2cd1efcfd7ef8a562ab8d485e562dfe1c72..0d181aa65c68c2f43a4675aca8e94b3d750bb888 100644 (file)
@@ -66,8 +66,8 @@ class ModuleSaquit : public Module
 {
        CommandSaquit cmd;
  public:
-       ModuleSaquit(InspIRCd* Me)
-               : Module(Me), cmd(this)
+       ModuleSaquit()
+               : cmd(this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index 696b3d80949df38f3ee3d02b71477b80b6a88656..48e07ef6d58b2aa278c1f5277a96f7a24e2ef08d 100644 (file)
@@ -34,8 +34,8 @@ class SaslAuthenticator : public classbase
        bool state_announced;
 
  public:
-       SaslAuthenticator(User *user_, std::string method, InspIRCd *instance, Module *ctor)
-               : ServerInstance(instance), user(user_), state(SASL_INIT), state_announced(false)
+       SaslAuthenticator(User *user_, std::string method, Module *ctor)
+               : user(user_), state(SASL_INIT), state_announced(false)
        {
                parameterlist params;
                params.push_back("*");
@@ -168,7 +168,7 @@ class CommandAuthenticate : public Command
 
                        SaslAuthenticator *sasl = authExt.get(user);
                        if (!sasl)
-                               authExt.set(user, new SaslAuthenticator(user, parameters[0], ServerInstance, creator));
+                               authExt.set(user, new SaslAuthenticator(user, parameters[0], creator));
                        else if (sasl->SendClientMessage(parameters) == false)  // IAL abort extension --nenolod
                        {
                                sasl->AnnounceState();
@@ -223,8 +223,8 @@ class ModuleSASL : public Module
        CommandAuthenticate auth;
        CommandSASL sasl;
  public:
-       ModuleSASL(InspIRCd* Me)
-               : Module(Me), authExt("sasl_auth", this), cap(this, "sasl"), auth(this, authExt, cap), sasl(this, authExt)
+       ModuleSASL()
+               : authExt("sasl_auth", this), cap(this, "sasl"), auth(this, authExt, cap), sasl(this, authExt)
        {
                Implementation eventlist[] = { I_OnEvent, I_OnUserRegister, I_OnPostConnect, I_OnUserDisconnect, I_OnCleanup };
                ServerInstance->Modules->Attach(eventlist, this, 5);
index 58d9cac942388988ff71c1587fc1d925151140a6..7b2c3e5ebc07cd8db625e12cff61e1f66edee54a 100644 (file)
@@ -55,8 +55,8 @@ class ModuleSATopic : public Module
 {
        CommandSATopic cmd;
  public:
-       ModuleSATopic(InspIRCd* Me)
-       : Module(Me), cmd(this)
+       ModuleSATopic()
+       : cmd(this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index b2d1f80148f051ca9fd9d62f76079a07e4afaae0..5e2d704bb6c404ac8ffb58643daa42ff6a41ec0b 100644 (file)
@@ -21,8 +21,7 @@ class ModuleSecureList : public Module
        std::vector<std::string> allowlist;
        time_t WaitTime;
  public:
-       ModuleSecureList(InspIRCd* Me) : Module(Me)
-       {
+       ModuleSecureList()      {
                OnRehash(NULL);
                Implementation eventlist[] = { I_OnRehash, I_OnPreCommand, I_On005Numeric };
                ServerInstance->Modules->Attach(eventlist, this, 3);
@@ -39,7 +38,7 @@ class ModuleSecureList : public Module
 
        void OnRehash(User* user)
        {
-               ConfigReader* MyConf = new ConfigReader(ServerInstance);
+               ConfigReader* MyConf = new ConfigReader;
                allowlist.clear();
 
                for (int i = 0; i < MyConf->Enumerate("securehost"); i++)
index 630a7e58e5b84d0d3a63f985b227bb65d97ee164..ca30cfef6b7aedc4ee4d107057511394588833aa 100644 (file)
@@ -18,9 +18,8 @@
 class ModuleSeeNicks : public Module
 {
  public:
-       ModuleSeeNicks(InspIRCd* Me)
-               : Module(Me)
-       {
+       ModuleSeeNicks()
+                       {
                ServerInstance->SNO->EnableSnomask('n',"NICK");
                ServerInstance->SNO->EnableSnomask('N',"REMOTENICK");
                Implementation eventlist[] = { I_OnUserPostNick };
index 6f35de862ffda13b663237e1604dcfec495c451f..8103662495c6ad430f5b95815046f7c6441b2c05 100644 (file)
@@ -19,8 +19,7 @@ class ModuleServerBan : public Module
 {
  private:
  public:
-       ModuleServerBan(InspIRCd* Me) : Module(Me)
-       {
+       ModuleServerBan()       {
                Implementation eventlist[] = { I_OnCheckBan, I_On005Numeric };
                ServerInstance->Modules->Attach(eventlist, this, 2);
        }
index 7480daf0739de92462977c6863798d1f85c50204..6e950f4386ec16b3a0a288724f0c778013d42aa5 100644 (file)
@@ -22,7 +22,7 @@ class Channel_r : public ModeHandler
 {
 
  public:
-       Channel_r(InspIRCd* Instance, Module* Creator) : ModeHandler(Creator, 'r', PARAM_NONE, MODETYPE_CHANNEL) { }
+       Channel_r(Module* Creator) : ModeHandler(Creator, 'r', PARAM_NONE, MODETYPE_CHANNEL) { }
 
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
        {
@@ -52,7 +52,7 @@ class User_r : public ModeHandler
 {
 
  public:
-       User_r(InspIRCd* Instance, Module* Creator) : ModeHandler(Creator, 'r', PARAM_NONE, MODETYPE_USER) { }
+       User_r(Module* Creator) : ModeHandler(Creator, 'r', PARAM_NONE, MODETYPE_USER) { }
 
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
        {
@@ -78,7 +78,7 @@ class User_r : public ModeHandler
 class AChannel_R : public SimpleChannelModeHandler
 {
  public:
-       AChannel_R(InspIRCd* Instance, Module* Creator) : SimpleChannelModeHandler(Instance, Creator, 'R') { }
+       AChannel_R(Module* Creator) : SimpleChannelModeHandler(Creator, 'R') { }
 };
 
 /** User mode +R - unidentified users cannot message
@@ -86,7 +86,7 @@ class AChannel_R : public SimpleChannelModeHandler
 class AUser_R : public SimpleUserModeHandler
 {
  public:
-       AUser_R(InspIRCd* Instance, Module* Creator) : SimpleUserModeHandler(Creator, 'R') { }
+       AUser_R(Module* Creator) : SimpleUserModeHandler(Creator, 'R') { }
 };
 
 /** Channel mode +M - unidentified users cannot message channel
@@ -94,7 +94,7 @@ class AUser_R : public SimpleUserModeHandler
 class AChannel_M : public SimpleChannelModeHandler
 {
  public:
-       AChannel_M(InspIRCd* Instance, Module* Creator) : SimpleChannelModeHandler(Instance, Creator, 'M') { }
+       AChannel_M(Module* Creator) : SimpleChannelModeHandler(Creator, 'M') { }
 };
 
 class ModuleServicesAccount : public Module
@@ -106,8 +106,7 @@ class ModuleServicesAccount : public Module
        User_r m5;
        StringExtItem accountname;
  public:
-       ModuleServicesAccount(InspIRCd* Me) : Module(Me),
-               m1(Me, this), m2(Me, this), m3(Me, this), m4(Me, this), m5(Me, this),
+       ModuleServicesAccount() : m1(this), m2(this), m3(this), m4(this), m5(this),
                accountname("accountname", this)
        {
 
@@ -267,7 +266,7 @@ class ModuleServicesAccount : public Module
                                ac.user = dest;
                                ac.account = *account;
                                Event n((char*)&ac, this, "account_login");
-                               n.Send(ServerInstance);
+                               n.Send();
                        }
                }
        }
index ee6f2ad232fc7f831f6a37ef629393dbd467f427..96e54f8e7e4434a0bc0a4476fa10c3a1ebf01e5f 100644 (file)
@@ -20,7 +20,7 @@
 class ServProtectMode : public ModeHandler
 {
  public:
-       ServProtectMode(InspIRCd* Instance, Module* Creator) : ModeHandler(Creator, 'k', PARAM_NONE, MODETYPE_USER) { oper = true; }
+       ServProtectMode(Module* Creator) : ModeHandler(Creator, 'k', PARAM_NONE, MODETYPE_USER) { oper = true; }
 
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
        {
@@ -40,8 +40,8 @@ class ModuleServProtectMode : public Module
 {
        ServProtectMode bm;
  public:
-       ModuleServProtectMode(InspIRCd* Me)
-               : Module(Me), bm(Me, this)
+       ModuleServProtectMode()
+               : bm(this)
        {
                if (!ServerInstance->Modes->AddMode(&bm))
                        throw ModuleException("Could not add new modes!");
index ffbc66ddcf4bb2a2db53cff629f227ccf7f7a912..cd9368d3c258cdbf1aa8e1cb16a7cebbdc77cda9 100644 (file)
@@ -66,8 +66,8 @@ class ModuleSetHost : public Module
        CommandSethost cmd;
        char hostmap[256];
  public:
-       ModuleSetHost(InspIRCd* Me)
-               : Module(Me), cmd(this, hostmap)
+       ModuleSetHost()
+               : cmd(this, hostmap)
        {
                OnRehash(NULL);
                ServerInstance->AddCommand(&cmd);
@@ -78,7 +78,7 @@ class ModuleSetHost : public Module
 
        void OnRehash(User* user)
        {
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
                std::string hmap = Conf.ReadValue("hostname", "charmap", 0);
 
                if (hmap.empty())
index 3b6f6682b6dec011ab5b41bc6a8d4455aacc03a0..a0a4cfe8d1ec944b50c4b61d4d667ccd1bc1d1a7 100644 (file)
@@ -59,7 +59,7 @@ class ModuleSetIdent : public Module
        CommandSetident cmd;
 
  public:
-       ModuleSetIdent(InspIRCd* Me) : Module(Me), cmd(this)
+       ModuleSetIdent() : cmd(this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index 68df49a335b0e6be8b35ba527290776e8b7713b1..4751d99c121b65fea206279b2dba2912e2d677b1 100644 (file)
@@ -50,8 +50,8 @@ class ModuleSetIdle : public Module
 {
        CommandSetidle cmd;
  public:
-       ModuleSetIdle(InspIRCd* Me)
-               : Module(Me), cmd(this)
+       ModuleSetIdle()
+               : cmd(this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index be5bdb5f9c2fa7ed9c4b30733c2c64e7a0f4138c..c0e32da7329a137c99dd3263f9280e24c4e287c9 100644 (file)
@@ -55,8 +55,8 @@ class ModuleSetName : public Module
 {
        CommandSetname cmd;
  public:
-       ModuleSetName(InspIRCd* Me)
-               : Module(Me), cmd(this)
+       ModuleSetName()
+               : cmd(this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index b6dc215db95f6c36af2c772c9603931c06c7897f..c41bd06997c38f67fe11a498662c6ce6087691e0 100644 (file)
@@ -258,7 +258,7 @@ class ModuleSHA256 : public Module
 
  public:
 
-       ModuleSHA256(InspIRCd* Me) : Module(Me), key(NULL), chars(NULL)
+       ModuleSHA256() : key(NULL), chars(NULL)
        {
                ServerInstance->Modules->PublishInterface("HashRequest", this);
                Implementation eventlist[] = { I_OnRequest };
index 63e02c76d39fcdea6ecd91b04ad8da56d5a1da28..9acc019aadc1cc62eeee8ed86ef6d3e29f8dc965 100644 (file)
@@ -81,9 +81,9 @@ class ModuleShowwhois : public Module
 
  public:
 
-       ModuleShowwhois(InspIRCd* Me) : cmd(this)
+       ModuleShowwhois() : cmd(this)
        {
-               ConfigReader conf(ServerInstance);
+               ConfigReader conf;
                bool OpersOnly = conf.ReadFlag("showwhois", "opersonly", "yes", 0);
                ShowWhoisFromOpers = conf.ReadFlag("showwhois", "showfromopers", "yes", 0);
 
index 746dcb918b580f7901411f64ca06214c59f7ea54..599d665a114eff445b31f0d97a14b63d7f5fe874 100644 (file)
@@ -21,8 +21,8 @@ class Shun : public XLine
 public:
        std::string matchtext;
 
-       Shun(InspIRCd* Instance, time_t s_time, long d, std::string src, std::string re, std::string shunmask)
-               : XLine(Instance, s_time, d, src, re, "SHUN")
+       Shun(time_t s_time, long d, std::string src, std::string re, std::string shunmask)
+               : XLine(s_time, d, src, re, "SHUN")
        {
                this->matchtext = shunmask;
        }
@@ -72,13 +72,13 @@ public:
 class ShunFactory : public XLineFactory
 {
  public:
-       ShunFactory(InspIRCd* Instance) : XLineFactory(Instance, "SHUN") { }
+       ShunFactory() : XLineFactory("SHUN") { }
 
        /** Generate a shun
        */
        XLine* Generate(time_t set_time, long duration, std::string source, std::string reason, std::string xline_specific_mask)
        {
-               return new Shun(ServerInstance, set_time, duration, source, reason, xline_specific_mask);
+               return new Shun(set_time, duration, source, reason, xline_specific_mask);
        }
 };
 
@@ -136,7 +136,7 @@ class CommandShun : public Command
 
                        try
                        {
-                               r = new Shun(ServerInstance, ServerInstance->Time(), duration, user->nick.c_str(), expr.c_str(), target.c_str());
+                               r = new Shun(ServerInstance->Time(), duration, user->nick.c_str(), expr.c_str(), target.c_str());
                        }
                        catch (...)
                        {
@@ -187,7 +187,7 @@ class ModuleShun : public Module
        bool affectopers;
 
  public:
-       ModuleShun(InspIRCd* Me) : Module(Me), cmd(this), f(Me)
+       ModuleShun() : cmd(this)
        {
                ServerInstance->XLines->RegisterFactory(&f);
                ServerInstance->AddCommand(&cmd);
@@ -214,7 +214,7 @@ class ModuleShun : public Module
 
        virtual void OnRehash(User* user)
        {
-               ConfigReader MyConf(ServerInstance);
+               ConfigReader MyConf;
                std::string cmds = MyConf.ReadValue("shun", "enabledcommands", 0);
 
                if (cmds.empty())
index 57f3416e78ff95f71d5b1ac70c53188b00834795..eae6bf35c383849b4df9075f2db352a724433360 100644 (file)
@@ -270,8 +270,8 @@ class ModuleSilence : public Module
        CommandSVSSilence cmdsvssilence;
  public:
 
-       ModuleSilence(InspIRCd* Me)
-               : Module(Me), maxsilence(32), cmdsilence(this, maxsilence), cmdsvssilence(this)
+       ModuleSilence()
+               : maxsilence(32), cmdsilence(this, maxsilence), cmdsvssilence(this)
        {
                OnRehash(NULL);
                ServerInstance->AddCommand(&cmdsilence);
@@ -283,7 +283,7 @@ class ModuleSilence : public Module
 
        void OnRehash(User* user)
        {
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
                maxsilence = Conf.ReadInteger("silence", "maxentries", 0, true);
                if (!maxsilence)
                        maxsilence = 32;
index ae26f3600d91f217e6c41da82c7c8569689e24a5..989ed565f8061e0dcfd25ab339aa5df085aed1ff 100644 (file)
@@ -25,7 +25,7 @@
 
 /* $ModDep: m_spanningtree/cachetimer.h m_spanningtree/resolvers.h m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h */
 
-CacheRefreshTimer::CacheRefreshTimer(InspIRCd *Inst, SpanningTreeUtilities *Util) : Timer(3600, Inst->Time(), true), Instance(Inst), Utils(Util)
+CacheRefreshTimer::CacheRefreshTimer(SpanningTreeUtilities *Util) : Timer(3600, ServerInstance->Time(), true), Utils(Util)
 {
 }
 
index aec53933200bc9393d5da2fa4440b0cd25e0e640..dcfba8ef3e836502d1dd518f4fdbc30721033536 100644 (file)
@@ -18,7 +18,6 @@
 
 class ModuleSpanningTree;
 class SpanningTreeUtilities;
-class InspIRCd;
 
 /** Create a timer which recurs every second, we inherit from Timer.
  * Timer is only one-shot however, so at the end of each Tick() we simply
@@ -27,10 +26,9 @@ class InspIRCd;
 class CacheRefreshTimer : public Timer
 {
  private:
-       InspIRCd *Instance;
        SpanningTreeUtilities *Utils;
  public:
-       CacheRefreshTimer(InspIRCd *Instance, SpanningTreeUtilities* Util);
+       CacheRefreshTimer(SpanningTreeUtilities* Util);
        virtual void Tick(time_t TIME);
 };
 
index 7f11f40dd1dd7f5194b4a2a0188b6d9b93880734..810cf23a54fe6f7f63f38e74554441e2bbf928ec 100644 (file)
@@ -53,7 +53,7 @@ bool TreeSocket::ForceJoin(const std::string &source, parameterlist &params)
        if (params.size() < 3)
                return true;
 
-       irc::modestacker modestack(ServerInstance, true);                       /* Modes to apply from the users in the user list */
+       irc::modestacker modestack(true);                       /* Modes to apply from the users in the user list */
        User* who = NULL;                                               /* User we are currently checking */
        std::string channel = params[0];                                /* Channel name, as a string */
        time_t TS = atoi(params[1].c_str());                            /* Timestamp given to us for remote side */
@@ -77,7 +77,7 @@ bool TreeSocket::ForceJoin(const std::string &source, parameterlist &params)
 
        if (created)
        {
-               chan = new Channel(ServerInstance, channel, TS);
+               chan = new Channel(channel, TS);
                ServerInstance->SNO->WriteToSnoMask('d', "Creation FJOIN recieved for %s, timestamp: %lu", chan->name.c_str(), (unsigned long)TS);
        }
        else
@@ -168,7 +168,7 @@ bool TreeSocket::ForceJoin(const std::string &source, parameterlist &params)
                                for (std::string::iterator x = modes.begin(); x != modes.end(); ++x)
                                        modestack.Push(*x, who->nick);
 
-                               Channel::JoinUser(ServerInstance, who, channel.c_str(), true, "", route_back_again->bursting, TS);
+                               Channel::JoinUser(who, channel.c_str(), true, "", route_back_again->bursting, TS);
                        }
                        else
                        {
@@ -203,7 +203,7 @@ bool TreeSocket::RemoveStatus(const std::string &prefix, parameterlist &params)
 
        if (c)
        {
-               irc::modestacker stack(ServerInstance, false);
+               irc::modestacker stack(false);
                parameterlist stackresult;
                stackresult.push_back(c->name);
 
index 814aa122c7ab8a38d95bfe426ce44a98e73733b4..b264a4c2fb242333ddc424f1404c23e54d39f4ec 100644 (file)
@@ -25,7 +25,8 @@
 
 /* $ModDep: m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h */
 
-HandshakeTimer::HandshakeTimer(InspIRCd* Inst, TreeSocket* s, Link* l, SpanningTreeUtilities* u, int delay) : Timer(delay, Inst->Time(), true), Instance(Inst), sock(s), lnk(l), Utils(u)
+HandshakeTimer::HandshakeTimer(TreeSocket* s, Link* l, SpanningTreeUtilities* u, int delay)
+       : Timer(delay, ServerInstance->Time(), true), sock(s), lnk(l), Utils(u)
 {
        thefd = sock->GetFd();
 }
index 0a60c78fc6c3551cc5c05176a2d983c8a21bc049..3f01a8b5bbeda9e68cb774a0a2fbd1fa8621112a 100644 (file)
@@ -24,13 +24,12 @@ class Link;
 class HandshakeTimer : public Timer
 {
  private:
-       InspIRCd* Instance;
        TreeSocket* sock;
        Link* lnk;
        SpanningTreeUtilities* Utils;
        int thefd;
  public:
-       HandshakeTimer(InspIRCd* Inst, TreeSocket* s, Link* l, SpanningTreeUtilities* u, int delay);
+       HandshakeTimer(TreeSocket* s, Link* l, SpanningTreeUtilities* u, int delay);
        ~HandshakeTimer();
        virtual void Tick(time_t TIME);
 };
index 230c3109b8b9ad29cc7211a6bade76e6a897af1d..23945d09518a1b272adcf7489e5be7e99b8871a5 100644 (file)
 
 /* $ModDep: m_spanningtree/cachetimer.h m_spanningtree/resolvers.h m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h m_spanningtree/rconnect.h m_spanningtree/rsquit.h m_spanningtree/protocolinterface.h */
 
-ModuleSpanningTree::ModuleSpanningTree(InspIRCd* Me)
-       : Module(Me), max_local(0), max_global(0)
+ModuleSpanningTree::ModuleSpanningTree()
+       : max_local(0), max_global(0)
 {
        ServerInstance->Modules->UseInterface("BufferedSocketHook");
-       Utils = new SpanningTreeUtilities(ServerInstance, this);
+       Utils = new SpanningTreeUtilities(this);
        command_rconnect = new CommandRConnect(this, Utils);
        ServerInstance->AddCommand(command_rconnect);
        command_rsquit = new CommandRSQuit(this, Utils);
        ServerInstance->AddCommand(command_rsquit);
-       RefreshTimer = new CacheRefreshTimer(ServerInstance, Utils);
+       RefreshTimer = new CacheRefreshTimer(Utils);
        ServerInstance->Timers->AddTimer(RefreshTimer);
 
        Implementation eventlist[] =
@@ -55,7 +55,7 @@ ModuleSpanningTree::ModuleSpanningTree(InspIRCd* Me)
        ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
 
        delete ServerInstance->PI;
-       ServerInstance->PI = new SpanningTreeProtocolInterface(this, Utils, ServerInstance);
+       ServerInstance->PI = new SpanningTreeProtocolInterface(this, Utils);
        loopCall = false;
 
        // update our local user count
@@ -292,7 +292,7 @@ void ModuleSpanningTree::ConnectServer(Link* x, Autoconnect* y)
                try
                {
                        bool cached;
-                       ServernameResolver* snr = new ServernameResolver((Module*)this, Utils, ServerInstance,x->IPAddr, *x, cached, start_type, y);
+                       ServernameResolver* snr = new ServernameResolver((Module*)this, Utils, x->IPAddr, *x, cached, start_type, y);
                        ServerInstance->AddResolver(snr, cached);
                }
                catch (ModuleException& e)
@@ -942,7 +942,7 @@ void ModuleSpanningTree::OnEvent(Event* event)
 ModuleSpanningTree::~ModuleSpanningTree()
 {
        delete ServerInstance->PI;
-       ServerInstance->PI = new ProtocolInterface(ServerInstance);
+       ServerInstance->PI = new ProtocolInterface;
 
        /* This will also free the listeners */
        delete Utils;
index 0d44169c7108a7f9631d65c53864cc3c62ad5c2f..810b8ec921d04c57e6cbc23cfe19ec4a0ee26818 100644 (file)
@@ -60,7 +60,7 @@ class ModuleSpanningTree : public Module
 
        /** Constructor
         */
-       ModuleSpanningTree(InspIRCd* Me);
+       ModuleSpanningTree();
 
        /** Shows /LINKS
         */
index 135970a4a2509036ef9fdd727bb1c941a9e2d0a5..ee26f0c73109f73315c4387b2d807df24570398a 100644 (file)
@@ -33,7 +33,7 @@ bool TreeSocket::MetaData(const std::string &prefix, parameterlist &params)
        {
                if (params[0] == "*")
                {
-                       FOREACH_MOD_I(ServerInstance,I_OnDecodeMetaData,OnDecodeMetaData(NULL,params[1],params[2]));
+                       FOREACH_MOD(I_OnDecodeMetaData,OnDecodeMetaData(NULL,params[1],params[2]));
                }
                else if (*(params[0].c_str()) == '#')
                {
@@ -42,7 +42,7 @@ bool TreeSocket::MetaData(const std::string &prefix, parameterlist &params)
                        {
                                if (item)
                                        item->unserialize(FORMAT_NETWORK, c, params[2]);
-                               FOREACH_MOD_I(ServerInstance,I_OnDecodeMetaData,OnDecodeMetaData(c,params[1],params[2]));
+                               FOREACH_MOD(I_OnDecodeMetaData,OnDecodeMetaData(c,params[1],params[2]));
                        }
                }
                else if (*(params[0].c_str()) != '#')
@@ -52,7 +52,7 @@ bool TreeSocket::MetaData(const std::string &prefix, parameterlist &params)
                        {
                                if (item)
                                        item->unserialize(FORMAT_NETWORK, u, params[2]);
-                               FOREACH_MOD_I(ServerInstance,I_OnDecodeMetaData,OnDecodeMetaData(u,params[1],params[2]));
+                               FOREACH_MOD(I_OnDecodeMetaData,OnDecodeMetaData(u,params[1],params[2]));
                        }
                }
        }
index 3cfad9b63fa051cd1774cd388716601eb9a8681d..b8d8c93ee9076b1352febaad3db3aa0e0d9cfff0 100644 (file)
@@ -47,7 +47,7 @@ void TreeSocket::DoBurst(TreeServer* s)
        /* Send everything else (channel modes, xlines etc) */
        this->SendChannelModes(s);
        this->SendXLines(s);
-       FOREACH_MOD_I(ServerInstance,I_OnSyncNetwork,OnSyncNetwork(Utils->Creator,(void*)this));
+       FOREACH_MOD(I_OnSyncNetwork,OnSyncNetwork(Utils->Creator,(void*)this));
        this->WriteLine(endburst);
        ServerInstance->SNO->WriteToSnoMask('l',"Finished bursting to \2"+name+"\2.");
 }
@@ -230,7 +230,7 @@ void TreeSocket::SendChannelModes(TreeServer* Current)
                                Utils->Creator->ProtoSendMetaData(this, c->second, i->first, value);
                }
 
-               FOREACH_MOD_I(ServerInstance,I_OnSyncChannel,OnSyncChannel(c->second,Utils->Creator,this));
+               FOREACH_MOD(I_OnSyncChannel,OnSyncChannel(c->second,Utils->Creator,this));
        }
 }
 
@@ -281,7 +281,7 @@ void TreeSocket::SendUsers(TreeServer* Current)
                                        Utils->Creator->ProtoSendMetaData(this, u->second, i->first, value);
                        }
 
-                       FOREACH_MOD_I(ServerInstance,I_OnSyncUser,OnSyncUser(u->second,Utils->Creator,this));
+                       FOREACH_MOD(I_OnSyncUser,OnSyncUser(u->second,Utils->Creator,this));
                }
        }
 }
index c7acf393c1f784eba74fe006eb7a3f8985e8f53a..042edaba8607c1884c3bd6322ee5ba7151ff8449 100644 (file)
@@ -40,16 +40,16 @@ bool TreeSocket::ServerMessage(const std::string &messagetype, const std::string
                {
                        if (messagetype == "PRIVMSG")
                        {
-                               FOREACH_MOD_I(ServerInstance, I_OnUserMessage, OnUserMessage(Utils->ServerUser, channel, TYPE_CHANNEL, text, status, except_list));
+                               FOREACH_MOD(I_OnUserMessage, OnUserMessage(Utils->ServerUser, channel, TYPE_CHANNEL, text, status, except_list));
                        }
                        else
                        {
-                               FOREACH_MOD_I(ServerInstance, I_OnUserNotice, OnUserNotice(Utils->ServerUser, channel, TYPE_CHANNEL, text, status, except_list));
+                               FOREACH_MOD(I_OnUserNotice, OnUserNotice(Utils->ServerUser, channel, TYPE_CHANNEL, text, status, except_list));
                        }
                        TreeServer* s = Utils->FindServer(prefix);
                        if (s)
                        {
-                               FOREACH_MOD_I(ServerInstance, I_OnText, OnText(Utils->ServerUser, channel, TYPE_CHANNEL, text, status, except_list));
+                               FOREACH_MOD(I_OnText, OnText(Utils->ServerUser, channel, TYPE_CHANNEL, text, status, except_list));
                                channel->WriteChannelWithServ(s->GetName().c_str(), "%s %s :%s", messagetype.c_str(), channel->name.c_str(), text.c_str());
                        }
                }
@@ -61,16 +61,16 @@ bool TreeSocket::ServerMessage(const std::string &messagetype, const std::string
                        {
                                if (messagetype == "PRIVMSG")
                                {
-                                       FOREACH_MOD_I(ServerInstance, I_OnUserMessage, OnUserMessage(Utils->ServerUser, user, TYPE_USER, text, 0, except_list));
+                                       FOREACH_MOD(I_OnUserMessage, OnUserMessage(Utils->ServerUser, user, TYPE_USER, text, 0, except_list));
                                }
                                else
                                {
-                                       FOREACH_MOD_I(ServerInstance, I_OnUserNotice, OnUserNotice(Utils->ServerUser, user, TYPE_USER, text, 0, except_list));
+                                       FOREACH_MOD(I_OnUserNotice, OnUserNotice(Utils->ServerUser, user, TYPE_USER, text, 0, except_list));
                                }
                                TreeServer* s = Utils->FindServer(prefix);
                                if (s)
                                {
-                                       FOREACH_MOD_I(ServerInstance, I_OnText, OnText(Utils->ServerUser, user, TYPE_USER, text, status, except_list));
+                                       FOREACH_MOD(I_OnText, OnText(Utils->ServerUser, user, TYPE_USER, text, status, except_list));
                                        user->Write(":%s %s %s :%s", s->GetName().c_str(), messagetype.c_str(), user->nick.c_str(), text.c_str());
                                }
 
index 047d490b6260761fc34e91f1a863d6e8dccc6194..74120ad47fee050d48acf4aa5dfe82567c80a679 100644 (file)
@@ -10,7 +10,7 @@ class SpanningTreeProtocolInterface : public ProtocolInterface
        ModuleSpanningTree* Module;
        void SendChannel(Channel* target, char status, const std::string &text);
  public:
-       SpanningTreeProtocolInterface(ModuleSpanningTree* mod, SpanningTreeUtilities* util, InspIRCd* Instance) : ProtocolInterface(Instance), Utils(util), Module(mod) { }
+       SpanningTreeProtocolInterface(ModuleSpanningTree* mod, SpanningTreeUtilities* util) : Utils(util), Module(mod) { }
        virtual ~SpanningTreeProtocolInterface() { }
 
        virtual void SendEncapsulatedData(parameterlist &encap);
index c7c49b348872879f673879508d583346f4d9ec0d..782c7795d620a9628fcdbadbbbcc01866b896317 100644 (file)
@@ -31,7 +31,7 @@
  * callback to OnLookupComplete or OnError when completed. Once it has completed we
  * will have an IP address which we can then use to continue our connection.
  */
-ServernameResolver::ServernameResolver(Module* me, SpanningTreeUtilities* Util, InspIRCd* Instance, const std::string &hostname, Link x, bool &cached, QueryType qt, Autoconnect* myac) : Resolver(Instance, hostname, qt, cached, me), MyLink(x), Utils(Util), query(qt), host(hostname), mine(me), myautoconnect(myac)
+ServernameResolver::ServernameResolver(Module* me, SpanningTreeUtilities* Util, const std::string &hostname, Link x, bool &cached, QueryType qt, Autoconnect* myac) : Resolver(hostname, qt, cached, me), MyLink(x), Utils(Util), query(qt), host(hostname), mine(me), myautoconnect(myac)
 {
        /* Nothing in here, folks */
 }
@@ -71,7 +71,7 @@ void ServernameResolver::OnError(ResolverError e, const std::string &errormessag
        if (query == DNS_QUERY_AAAA)
        {
                bool cached;
-               ServernameResolver* snr = new ServernameResolver(mine, Utils, ServerInstance, host, MyLink, cached, DNS_QUERY_A, myautoconnect);
+               ServernameResolver* snr = new ServernameResolver(mine, Utils, host, MyLink, cached, DNS_QUERY_A, myautoconnect);
                ServerInstance->AddResolver(snr, cached);
                return;
        }
index e4404d6a5ac9cd8afcef18c9e697ff28142c33c3..5b5bf88ccf1c51346a61c226dbec9bcefc2c2f06 100644 (file)
@@ -33,8 +33,8 @@ class SecurityIPResolver : public Resolver
        std::string host;
        QueryType query;
  public:
-       SecurityIPResolver(Module* me, SpanningTreeUtilities* U, InspIRCd* Instance, const std::string &hostname, Link x, bool &cached, QueryType qt)
-               : Resolver(Instance, hostname, qt, cached, me), MyLink(x), Utils(U), mine(me), host(hostname), query(qt)
+       SecurityIPResolver(Module* me, SpanningTreeUtilities* U, const std::string &hostname, Link x, bool &cached, QueryType qt)
+               : Resolver(hostname, qt, cached, me), MyLink(x), Utils(U), mine(me), host(hostname), query(qt)
        {
        }
 
@@ -48,7 +48,7 @@ class SecurityIPResolver : public Resolver
                if (query == DNS_QUERY_AAAA)
                {
                        bool cached;
-                       SecurityIPResolver* res = new SecurityIPResolver(mine, Utils, ServerInstance, host, MyLink, cached, DNS_QUERY_A);
+                       SecurityIPResolver* res = new SecurityIPResolver(mine, Utils, host, MyLink, cached, DNS_QUERY_A);
                        ServerInstance->AddResolver(res, cached);
                        return;
                }
@@ -76,7 +76,7 @@ class ServernameResolver : public Resolver
        Module* mine;
        Autoconnect* myautoconnect;
  public:
-        ServernameResolver(Module* me, SpanningTreeUtilities* Util, InspIRCd* Instance, const std::string &hostname, Link x, bool &cached, QueryType qt, Autoconnect* myac);
+        ServernameResolver(Module* me, SpanningTreeUtilities* Util, const std::string &hostname, Link x, bool &cached, QueryType qt, Autoconnect* myac);
         void OnLookupComplete(const std::string &result, unsigned int ttl, bool cached);
         void OnError(ResolverError e, const std::string &errormessage);
 };
index 0256756425f4b815152d34d4ff53bd6c272c90af..b1c6c2cb45f3c30b7fdc6b46fdf7ac96bafb82d5 100644 (file)
@@ -72,7 +72,7 @@ bool TreeSocket::RemoteServer(const std::string &prefix, parameterlist &params)
 
        Link* lnk = Utils->FindLink(servername);
 
-       TreeServer *Node = new TreeServer(this->Utils, ServerInstance, servername, description, sid, ParentOfThis,NULL, lnk ? lnk->Hidden : false);
+       TreeServer *Node = new TreeServer(Utils, servername, description, sid, ParentOfThis,NULL, lnk ? lnk->Hidden : false);
 
        ParentOfThis->AddChild(Node);
        params[4] = ":" + params[4];
@@ -158,7 +158,7 @@ bool TreeSocket::Outbound_Reply_Server(parameterlist &params)
 
                Utils->timeoutlist.erase(this);
 
-               TreeServer *Node = new TreeServer(this->Utils, ServerInstance, sname, description, sid, Utils->TreeRoot, this, x->Hidden);
+               TreeServer *Node = new TreeServer(Utils, sname, description, sid, Utils->TreeRoot, this, x->Hidden);
 
                Utils->TreeRoot->AddChild(Node);
                params[4] = ":" + params[4];
index 1664190f8ba468773044163322c8088761b4cf18..dff882f622cc2198c7746ddd8bfc9be62c8a0609 100644 (file)
@@ -35,7 +35,7 @@ bool TreeSocket::ServiceJoin(const std::string &prefix, parameterlist &params)
        {
                /* only join if it's local, otherwise just pass it on! */
                if (IS_LOCAL(u))
-                       Channel::JoinUser(ServerInstance, u, params[1].c_str(), false, "", false, ServerInstance->Time());
+                       Channel::JoinUser(u, params[1].c_str(), false, "", false, ServerInstance->Time());
                Utils->DoOneToAllButSender(prefix,"SVSJOIN",params,prefix);
        }
        return true;
index 567d44858dd7814d1a986b66631d643319cb936b..ffc533daf5867a3ef9f93ab476800bdabd3ece46 100644 (file)
  * represents our own server. Therefore, it has no route, no parent, and
  * no socket associated with it. Its version string is our own local version.
  */
-TreeServer::TreeServer(SpanningTreeUtilities* Util, InspIRCd* Instance, std::string Name, std::string Desc, const std::string &id)
-                                               : ServerInstance(Instance), ServerName(Name.c_str()), ServerDesc(Desc), Utils(Util)
+TreeServer::TreeServer(SpanningTreeUtilities* Util, std::string Name, std::string Desc, const std::string &id)
+                                               : ServerName(Name.c_str()), ServerDesc(Desc), Utils(Util)
 {
-       age = Instance->Time();
+       age = ServerInstance->Time();
        bursting = false;
        Parent = NULL;
        VersionString.clear();
@@ -46,10 +46,10 @@ TreeServer::TreeServer(SpanningTreeUtilities* Util, InspIRCd* Instance, std::str
  * This constructor initializes the server's Route and Parent, and sets up
  * its ping counters so that it will be pinged one minute from now.
  */
-TreeServer::TreeServer(SpanningTreeUtilities* Util, InspIRCd* Instance, std::string Name, std::string Desc, const std::string &id, TreeServer* Above, TreeSocket* Sock, bool Hide)
-       : ServerInstance(Instance), Parent(Above), ServerName(Name.c_str()), ServerDesc(Desc), Socket(Sock), Utils(Util), Hidden(Hide)
+TreeServer::TreeServer(SpanningTreeUtilities* Util, std::string Name, std::string Desc, const std::string &id, TreeServer* Above, TreeSocket* Sock, bool Hide)
+       : Parent(Above), ServerName(Name.c_str()), ServerDesc(Desc), Socket(Sock), Utils(Util), Hidden(Hide)
 {
-       age = Instance->Time();
+       age = ServerInstance->Time();
        bursting = true;
        VersionString.clear();
        ServerUserCount = ServerOperCount = 0;
@@ -62,7 +62,7 @@ TreeServer::TreeServer(SpanningTreeUtilities* Util, InspIRCd* Instance, std::str
        gettimeofday(&t, NULL);
        long ts = (t.tv_sec * 1000) + (t.tv_usec / 1000);
        this->StartBurst = ts;
-       Instance->Logs->Log("m_spanningtree",DEBUG, "Started bursting at time %lu", ts);
+       ServerInstance->Logs->Log("m_spanningtree",DEBUG, "Started bursting at time %lu", ts);
 
        /* find the 'route' for this server (e.g. the one directly connected
         * to the local server, which we can use to reach it)
@@ -148,7 +148,7 @@ void TreeServer::FinishBurst()
        ServerInstance->SNO->WriteToSnoMask(Parent == Utils->TreeRoot ? 'l' : 'L', "Received end of netburst from \2%s\2 (burst time: %lu %s)",
                ServerName.c_str(), (bursttime > 10000 ? bursttime / 1000 : bursttime), (bursttime > 10000 ? "secs" : "msecs"));
        Event rmode((char*)ServerName.c_str(),  (Module*)Utils->Creator, "new_server");
-       rmode.Send(ServerInstance);
+       rmode.Send();
 }
 
 void TreeServer::SetID(const std::string &id)
index e8db09cdf1946e433bf3bba02161c55e46788e01..24f9c0499131e873d3e1dd5f1bcdf8d2c3389b77 100644 (file)
@@ -30,7 +30,6 @@
  */
 class TreeServer : public classbase
 {
-       InspIRCd* ServerInstance;               /* Creator */
        TreeServer* Parent;                     /* Parent entry */
        TreeServer* Route;                      /* Route entry */
        std::vector<TreeServer*> Children;      /* List of child objects */
@@ -61,13 +60,13 @@ class TreeServer : public classbase
         * represents our own server. Therefore, it has no route, no parent, and
         * no socket associated with it. Its version string is our own local version.
         */
-       TreeServer(SpanningTreeUtilities* Util, InspIRCd* Instance, std::string Name, std::string Desc, const std::string &id);
+       TreeServer(SpanningTreeUtilities* Util, std::string Name, std::string Desc, const std::string &id);
 
        /** When we create a new server, we call this constructor to initialize it.
         * This constructor initializes the server's Route and Parent, and sets up
         * its ping counters so that it will be pinged one minute from now.
         */
-       TreeServer(SpanningTreeUtilities* Util, InspIRCd* Instance, std::string Name, std::string Desc, const std::string &id, TreeServer* Above, TreeSocket* Sock, bool Hide);
+       TreeServer(SpanningTreeUtilities* Util, std::string Name, std::string Desc, const std::string &id, TreeServer* Above, TreeSocket* Sock, bool Hide);
 
        int QuitUsers(const std::string &reason);
 
index 729c273ec7d292a3ff0c373eb19c95066f89c63a..6bb736a853acd4fc2767edf47e4b5be1791211cd 100644 (file)
@@ -66,7 +66,7 @@ TreeSocket::TreeSocket(SpanningTreeUtilities* Util, int newfd, char* ip, Autocon
        if (HookMod)
                BufferedSocketHookRequest(this, Utils->Creator, HookMod).Send();
 
-       hstimer = new HandshakeTimer(ServerInstance, this, &(Utils->LinkBlocks[0]), this->Utils, 1);
+       hstimer = new HandshakeTimer(this, &(Utils->LinkBlocks[0]), this->Utils, 1);
        ServerInstance->Timers->AddTimer(hstimer);
 
        /* Fix by Brain - inbound sockets need a timeout, too. 30 secs should be pleanty */
@@ -117,7 +117,7 @@ void TreeSocket::OnConnected()
                                if (GetIOHook())
                                {
                                        ServerInstance->SNO->WriteToSnoMask('l', "Connection to \2%s\2[%s] using transport \2%s\2", myhost.c_str(), (x->HiddenFromStats ? "<hidden>" : this->IP.c_str()), x->Hook.c_str());
-                                       hstimer = new HandshakeTimer(ServerInstance, this, &(*x), this->Utils, 1);
+                                       hstimer = new HandshakeTimer(this, &(*x), this->Utils, 1);
                                        ServerInstance->Timers->AddTimer(hstimer);
                                }
                                else
@@ -203,7 +203,7 @@ void TreeSocket::Squit(TreeServer* Current, const std::string &reason)
        if ((Current) && (Current != Utils->TreeRoot))
        {
                Event rmode((char*)Current->GetName().c_str(), (Module*)Utils->Creator, "lost_server");
-               rmode.Send(ServerInstance);
+               rmode.Send();
 
                parameterlist params;
                params.push_back(Current->GetName());
index cf537f05b02384ec451f7d28833ca98a9b62918d..1b617804e459f65ddd3ea9aa101b81bb4a3bacbe 100644 (file)
@@ -169,7 +169,7 @@ bool TreeSocket::ProcessLine(std::string &line)
 
                                Link* lnk = Utils->FindLink(InboundServerName);
 
-                               Node = new TreeServer(this->Utils, ServerInstance, InboundServerName, InboundDescription, InboundSID, Utils->TreeRoot, this, lnk ? lnk->Hidden : false);
+                               Node = new TreeServer(this->Utils, InboundServerName, InboundDescription, InboundSID, Utils->TreeRoot, this, lnk ? lnk->Hidden : false);
 
                                Utils->TreeRoot->AddChild(Node);
                                parameterlist sparams;
index 0f0e75a1d8e06d3f0bb5d386fe8ea4f83f7fc9b8..f1a4e625666237859a6f4a995a0c676be9fac43d 100644 (file)
@@ -87,7 +87,7 @@ bool TreeSocket::ParseUID(const std::string &source, parameterlist &params)
        User* _new = NULL;
        try
        {
-               _new = new User(ServerInstance, params[0]);
+               _new = new User(params[0]);
        }
        catch (...)
        {
@@ -173,7 +173,7 @@ bool TreeSocket::ParseUID(const std::string &source, parameterlist &params)
        params[params.size() - 1] = ":" + params[params.size() - 1];
        Utils->DoOneToAllButSender(source, "UID", params, source);
 
-       FOREACH_MOD_I(ServerInstance,I_OnPostConnect,OnPostConnect(_new));
+       FOREACH_MOD(I_OnPostConnect,OnPostConnect(_new));
 
        return true;
 }
index 8d3c55758f91ac237f2e897aeab18e0fd06bcb5a..729f6d4ee5617bada8bc97bcc41ded37fe3eba78 100644 (file)
@@ -147,12 +147,12 @@ bool SpanningTreeUtilities::IsServer(const std::string &ServerName)
        return (FindServer(ServerName) != NULL);
 }
 
-SpanningTreeUtilities::SpanningTreeUtilities(InspIRCd* Instance, ModuleSpanningTree* C) : ServerInstance(Instance), Creator(C)
+SpanningTreeUtilities::SpanningTreeUtilities(ModuleSpanningTree* C) : Creator(C)
 {
        ServerInstance->Logs->Log("m_spanningtree",DEBUG,"***** Using SID for hash: %s *****", ServerInstance->Config->GetSID().c_str());
 
-       this->TreeRoot = new TreeServer(this, ServerInstance, ServerInstance->Config->ServerName, ServerInstance->Config->ServerDesc, ServerInstance->Config->GetSID());
-       ServerUser = new FakeUser(ServerInstance, TreeRoot->GetID());
+       this->TreeRoot = new TreeServer(this, ServerInstance->Config->ServerName, ServerInstance->Config->ServerDesc, ServerInstance->Config->GetSID());
+       ServerUser = new FakeUser(TreeRoot->GetID());
 
        this->ReadConfiguration(true);
 }
@@ -418,7 +418,7 @@ void SpanningTreeUtilities::RefreshIPCache()
                        try
                        {
                                bool cached;
-                               SecurityIPResolver* sr = new SecurityIPResolver((Module*)this->Creator, this, ServerInstance, L->IPAddr, *L, cached, start_type);
+                               SecurityIPResolver* sr = new SecurityIPResolver(Creator, this, L->IPAddr, *L, cached, start_type);
                                ServerInstance->AddResolver(sr, cached);
                        }
                        catch (...)
@@ -430,7 +430,7 @@ void SpanningTreeUtilities::RefreshIPCache()
 
 void SpanningTreeUtilities::ReadConfiguration(bool rebind)
 {
-       ConfigReader* Conf = new ConfigReader(ServerInstance);
+       ConfigReader* Conf = new ConfigReader;
 
        /* We don't need to worry about these being *unloaded* on the fly, only loaded,
         * because we 'use' the interface locking the module in memory.
@@ -485,7 +485,7 @@ void SpanningTreeUtilities::ReadConfiguration(bool rebind)
                                                break;
                                        }
 
-                                       ServerSocketListener *listener = new ServerSocketListener(ServerInstance, this, portno, (char *)IP.c_str());
+                                       ServerSocketListener *listener = new ServerSocketListener(this, portno, (char *)IP.c_str());
                                        if (listener->GetFd() == -1)
                                        {
                                                delete listener;
@@ -577,7 +577,7 @@ void SpanningTreeUtilities::ReadConfiguration(bool rebind)
                                try
                                {
                                        bool cached;
-                                       SecurityIPResolver* sr = new SecurityIPResolver((Module*)this->Creator, this, ServerInstance, L.IPAddr, L, cached, start_type);
+                                       SecurityIPResolver* sr = new SecurityIPResolver(Creator, this, L.IPAddr, L, cached, start_type);
                                        ServerInstance->AddResolver(sr, cached);
                                }
                                catch (...)
index 1bdf127d840d73a42f7ebfb177fc0ca3cc7b05a0..2f8fc75dbd14a123cfacfb6aa243f8d4d1816607 100644 (file)
@@ -44,7 +44,7 @@ class ServerSocketListener : public ListenSocketBase
        SpanningTreeUtilities *Utils;
 
  public:
-       ServerSocketListener(InspIRCd* Instance, SpanningTreeUtilities *u, int port, char* addr) : ListenSocketBase(Instance, port, addr)
+       ServerSocketListener(SpanningTreeUtilities *u, int port, char* addr) : ListenSocketBase(port, addr)
        {
                this->Utils = u;
                Hook = NULL;
@@ -82,10 +82,6 @@ class Autoconnect : public classbase
  */
 class SpanningTreeUtilities : public classbase
 {
- private:
-       /** Creator server
-        */
-       InspIRCd* ServerInstance;
  public:
        /** Creator module
         */
@@ -166,7 +162,7 @@ class SpanningTreeUtilities : public classbase
 
        /** Initialise utility class
         */
-       SpanningTreeUtilities(InspIRCd* Instance, ModuleSpanningTree* Creator);
+       SpanningTreeUtilities(ModuleSpanningTree* Creator);
 
        /** Destroy class and free listeners etc
         */
index 0cc6605370849118250835862b29d1e000cdc0be..12aa0d347d841c21be6bd9ba5da05190816e97c5 100644 (file)
@@ -18,8 +18,7 @@
 class ModuleSpy : public Module
 {
  public:
-       ModuleSpy(InspIRCd* Me) : Module(Me)
-       {
+       ModuleSpy()     {
                ServerInstance->Modules->Attach(I_OnUserList, this);
        }
 
index cd636c633f0fb02d6b2493a7e3356914d68fc7e6..1b5a39ba47286616240115b62b55d24312c62780 100644 (file)
@@ -116,8 +116,8 @@ class ModuleSSLInfo : public Module
        CommandSSLInfo cmd;
 
  public:
-       ModuleSSLInfo(InspIRCd* Me)
-               : Module(Me), cmd(this)
+       ModuleSSLInfo()
+               : cmd(this)
        {
                ServerInstance->AddCommand(&cmd);
 
@@ -164,7 +164,7 @@ class ModuleSSLInfo : public Module
 
                if ((pcmd == "OPER") && (validated))
                {
-                       ConfigReader cf(ServerInstance);
+                       ConfigReader cf;
                        char TheHost[MAXBUF];
                        char TheIP[MAXBUF];
                        std::string LoginName;
index 52e506f077efb32639891acbd7a7081d918d68f6..0538f9f626cc450914dfeec81a1d30d3294e0b77 100644 (file)
@@ -21,7 +21,7 @@
 class SSLMode : public ModeHandler
 {
  public:
-       SSLMode(InspIRCd* Instance, Module* Creator) : ModeHandler(Creator, 'z', PARAM_NONE, MODETYPE_CHANNEL) { }
+       SSLMode(Module* Creator) : ModeHandler(Creator, 'z', PARAM_NONE, MODETYPE_CHANNEL) { }
 
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
        {
@@ -70,8 +70,8 @@ class ModuleSSLModes : public Module
        SSLMode sslm;
 
  public:
-       ModuleSSLModes(InspIRCd* Me)
-               : Module(Me), sslm(Me, this)
+       ModuleSSLModes()
+               : sslm(this)
        {
                if (!ServerInstance->Modes->AddMode(&sslm))
                        throw ModuleException("Could not add new modes!");
index 34db0c9e58ccd04d5fd928a887aa80d10cba1cbf..34662c45b1e1761d868a9396365d525b26d786f7 100644 (file)
@@ -20,7 +20,7 @@
 class ChannelStripColor : public SimpleChannelModeHandler
 {
  public:
-       ChannelStripColor(InspIRCd* Instance, Module* Creator) : SimpleChannelModeHandler(Instance, Creator, 'S') { }
+       ChannelStripColor(Module* Creator) : SimpleChannelModeHandler(Creator, 'S') { }
 };
 
 /** Handles user mode +S
@@ -28,7 +28,7 @@ class ChannelStripColor : public SimpleChannelModeHandler
 class UserStripColor : public SimpleUserModeHandler
 {
  public:
-       UserStripColor(InspIRCd* Instance, Module* Creator) : SimpleUserModeHandler(Creator, 'S') { }
+       UserStripColor(Module* Creator) : SimpleUserModeHandler(Creator, 'S') { }
 };
 
 
@@ -39,7 +39,7 @@ class ModuleStripColor : public Module
        UserStripColor usc;
 
  public:
-       ModuleStripColor(InspIRCd* Me) : Module(Me), csc(Me, this), usc(Me, this)
+       ModuleStripColor() : csc(this), usc(this)
        {
                if (!ServerInstance->Modes->AddMode(&usc) || !ServerInstance->Modes->AddMode(&csc))
                        throw ModuleException("Could not add new modes!");
@@ -115,7 +115,7 @@ class ModuleStripColor : public Module
 
                        // check if we allow ops to bypass filtering, if we do, check if they're opped accordingly.
                        // note: short circut logic here, don't wreck it. -- w00t
-                       if (CHANOPS_EXEMPT(ServerInstance, 'S') && t->GetPrefixValue(user) == OP_VALUE)
+                       if (CHANOPS_EXEMPT('S') && t->GetPrefixValue(user) == OP_VALUE)
                        {
                                return MOD_RES_PASSTHRU;
                        }
index e99adcaece54ce9d53583abeebb986224860fb4e..26f9cac1a61a7be26b76e5148d09054451ea9ace 100644 (file)
@@ -23,8 +23,8 @@ class SVSHold : public XLine
 public:
        irc::string nickname;
 
-       SVSHold(InspIRCd* Instance, time_t s_time, long d, std::string src, std::string re, std::string nick)
-               : XLine(Instance, s_time, d, src, re, "SVSHOLD")
+       SVSHold(time_t s_time, long d, std::string src, std::string re, std::string nick)
+               : XLine(s_time, d, src, re, "SVSHOLD")
        {
                this->nickname = nick.c_str();
        }
@@ -64,13 +64,13 @@ public:
 class SVSHoldFactory : public XLineFactory
 {
  public:
-       SVSHoldFactory(InspIRCd* Instance) : XLineFactory(Instance, "SVSHOLD") { }
+       SVSHoldFactory() : XLineFactory("SVSHOLD") { }
 
        /** Generate a shun
        */
        XLine* Generate(time_t set_time, long duration, std::string source, std::string reason, std::string xline_specific_mask)
        {
-               return new SVSHold(ServerInstance, set_time, duration, source, reason, xline_specific_mask);
+               return new SVSHold(set_time, duration, source, reason, xline_specific_mask);
        }
 };
 
@@ -117,7 +117,7 @@ class CommandSvshold : public Command
 
                        try
                        {
-                               r = new SVSHold(ServerInstance, ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), parameters[0].c_str());
+                               r = new SVSHold(ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), parameters[0].c_str());
                        }
                        catch (...)
                        {
@@ -163,7 +163,7 @@ class ModuleSVSHold : public Module
 
 
  public:
-       ModuleSVSHold(InspIRCd* Me) : Module(Me), cmd(this), s(Me)
+       ModuleSVSHold() : cmd(this)
        {
                ServerInstance->XLines->RegisterFactory(&s);
                ServerInstance->AddCommand(&cmd);
index 0c84764a26f13175cd80e3887f007a99a9722f02..4465b0c89c61fc27619ec7f2834a185c6bf5c9c9 100644 (file)
@@ -75,7 +75,7 @@ class ModuleSWhois : public Module
        CommandSwhois cmd;
 
  public:
-       ModuleSWhois(InspIRCd* Me) : Module(Me), cmd(this)
+       ModuleSWhois() : cmd(this)
        {
                ServerInstance->AddCommand(&cmd);
                Implementation eventlist[] = { I_OnWhoisLine, I_OnPostCommand };
@@ -104,7 +104,7 @@ class ModuleSWhois : public Module
        {
                if ((command != "OPER") || (result != CMD_SUCCESS))
                        return;
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
 
                std::string swhois;
 
index 7bbeb13a65e883402c6807e9b9251c05f2a1f8b1..c0816419f1f1880a9c5a3f6dad7ee2fcf5232c64 100644 (file)
@@ -118,8 +118,8 @@ class ModuleTimedBans : public Module
 {
        CommandTban cmd;
  public:
-       ModuleTimedBans(InspIRCd* Me)
-               : Module(Me), cmd(this)
+       ModuleTimedBans()
+               : cmd(this)
        {
                ServerInstance->AddCommand(&cmd);
                TimedBanList.clear();
index d3c8641d16115c831efa444739547f05fd9bcc45..e39064ca7e2c7db9894fe6648ed6eb59870a8067 100644 (file)
@@ -63,8 +63,8 @@ class ModuleTLine : public Module
 {
        CommandTline cmd;
  public:
-       ModuleTLine(InspIRCd* Me)
-               : Module(Me), cmd(this)
+       ModuleTLine()
+               : cmd(this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index f9cd4c596580e8c578ee1b28466eb265c6a96eac..be199208dbd21c4672b91272bedf669163808d3d 100644 (file)
@@ -21,7 +21,7 @@ class ModuleUHNames : public Module
  public:
        GenericCap cap;
 
-       ModuleUHNames(InspIRCd* Me) : Module(Me), cap(this, "userhost-in-names")
+       ModuleUHNames() : cap(this, "userhost-in-names")
        {
                Implementation eventlist[] = { I_OnEvent, I_OnPreCommand, I_OnNamesListItem, I_On005Numeric };
                ServerInstance->Modules->Attach(eventlist, this, 4);
index 38b344f5a15069aabd952c5ef351b21e411fdb8a..c44e15511d61e698547eadb0fa30eacf5c16fcf6 100644 (file)
@@ -87,7 +87,7 @@ class ModuleUninvite : public Module
 
  public:
 
-       ModuleUninvite(InspIRCd* Me) : Module(Me), cmd(this)
+       ModuleUninvite() : cmd(this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index 14a92e068da8177e12f83cf2b136d637d74ba102..b229aa39b053bbefab620d9f41b3482513776a1b 100644 (file)
@@ -57,8 +57,8 @@ class ModuleUserIP : public Module
 {
        CommandUserip cmd;
  public:
-       ModuleUserIP(InspIRCd* Me)
-               : Module(Me), cmd(this)
+       ModuleUserIP()
+               : cmd(this)
        {
                ServerInstance->AddCommand(&cmd);
                Implementation eventlist[] = { I_On005Numeric };
index 72b5d669c27ee24d418597cdffb7ae7591479144..f1a074aec8aeb79f569c65c916658ba8547e3d57 100644 (file)
@@ -27,7 +27,7 @@ class CommandVhost : public Command
 
        CmdResult Handle (const std::vector<std::string> &parameters, User *user)
        {
-               ConfigReader *Conf = new ConfigReader(ServerInstance);
+               ConfigReader *Conf = new ConfigReader;
 
                for (int index = 0; index < Conf->Enumerate("vhost"); index++)
                {
@@ -60,7 +60,7 @@ class ModuleVHost : public Module
        CommandVhost cmd;
 
  public:
-       ModuleVHost(InspIRCd* Me) : Module(Me), cmd(this)
+       ModuleVHost() : cmd(this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index 8c237a8eb22edbefa4ad636e699e5debe8086b51..24b4edc093994e10afa619e70e0746232000bde5 100644 (file)
@@ -367,8 +367,8 @@ class Modulewatch : public Module
        CommandSVSWatch sw;
 
  public:
-       Modulewatch(InspIRCd* Me)
-               : Module(Me), maxwatch(32), cmdw(this, maxwatch), sw(this) 
+       Modulewatch()
+               : maxwatch(32), cmdw(this, maxwatch), sw(this) 
        {
                OnRehash(NULL);
                whos_watching_me = new watchentries();
@@ -381,7 +381,7 @@ class Modulewatch : public Module
 
        virtual void OnRehash(User* user)
        {
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
                maxwatch = Conf.ReadInteger("watch", "maxentries", 0, true);
                if (!maxwatch)
                        maxwatch = 32;
index efd6a9c1d2942c40d90a2784df781504c9f922aa..991d803d6210876f95444a25b49bcb066b980e40 100644 (file)
@@ -22,8 +22,7 @@ class ModuleXLineDB : public Module
        bool reading_db;                        // If this is true, addlines are as a result of db reading, so don't bother flushing the db to disk.
                                                // DO REMEMBER TO SET IT, otherwise it's annoying :P
  public:
-       ModuleXLineDB(InspIRCd* Me) : Module(Me)
-       {
+       ModuleXLineDB()         {
                Implementation eventlist[] = { I_OnAddLine, I_OnDelLine, I_OnExpireLine };
                ServerInstance->Modules->Attach(eventlist, this, 3);
 
index 0c0eda6acf9092466c344744970e8b7a7832ee19..cea92ac51b8f646d2c7b3821d895674aca012132 100644 (file)
@@ -50,13 +50,13 @@ void InspIRCd::Exit(int status)
 
 void RehashHandler::Call(const std::string &reason)
 {
-       Server->SNO->WriteToSnoMask('a', "Rehashing config file %s %s",ServerConfig::CleanFilename(Server->ConfigFileName.c_str()), reason.c_str());
-       Server->RehashUsersAndChans();
-       FOREACH_MOD_I(Server, I_OnGarbageCollect, OnGarbageCollect());
-       if (!Server->ConfigThread)
+       ServerInstance->SNO->WriteToSnoMask('a', "Rehashing config file %s %s",ServerConfig::CleanFilename(ServerInstance->ConfigFileName.c_str()), reason.c_str());
+       ServerInstance->RehashUsersAndChans();
+       FOREACH_MOD(I_OnGarbageCollect, OnGarbageCollect());
+       if (!ServerInstance->ConfigThread)
        {
-               Server->ConfigThread = new ConfigReaderThread(Server, "");
-               Server->Threads->Start(Server->ConfigThread);
+               ServerInstance->ConfigThread = new ConfigReaderThread("");
+               ServerInstance->Threads->Start(ServerInstance->ConfigThread);
        }
 }
 
@@ -87,7 +87,7 @@ void InspIRCd::BuildISupport()
        v << " CASEMAPPING=rfc1459 STATUSMSG=@" << (this->Config->AllowHalfop ? "%" : "") << "+ CHARSET=ascii TOPICLEN=" << Config->Limits.MaxTopic - 1 << " KICKLEN=" << Config->Limits.MaxKick - 1 << " MAXTARGETS=" << Config->MaxTargets - 1;
        v << " AWAYLEN=" << Config->Limits.MaxAway - 1 << " CHANMODES=" << this->Modes->GiveModeList(MASK_CHANNEL) << " FNC NETWORK=" << Config->Network << " MAXPARA=32 ELIST=MU";
        Config->data005 = v.str();
-       FOREACH_MOD_I(this,I_On005Numeric,On005Numeric(Config->data005));
+       FOREACH_MOD(I_On005Numeric,On005Numeric(Config->data005));
        Config->Update005();
 }
 
index 863b9f2db53eaf0e57a647cff9f59303d664cd73..742214a6d60888c24646689105bcaa580e21b6e7 100644 (file)
@@ -17,7 +17,7 @@
 #include <stdarg.h>
 #include "snomasks.h"
 
-SnomaskManager::SnomaskManager(InspIRCd* Instance) : ServerInstance(Instance)
+SnomaskManager::SnomaskManager()
 {
        SnoMasks.clear();
        this->SetupDefaults();
@@ -44,7 +44,7 @@ bool SnomaskManager::EnableSnomask(char letter, const std::string &type)
 {
        if (SnoMasks.find(letter) == SnoMasks.end())
        {
-               Snomask *s = new Snomask(ServerInstance, letter, type);
+               Snomask *s = new Snomask(letter, type);
                SnoMasks[letter] = s;
                return true;
        }
@@ -144,7 +144,7 @@ void Snomask::SendMessage(const std::string &message)
                char mysnomask = MySnomask;
                ServerInstance->Logs->Log("snomask", DEFAULT, "%s: %s", desc.c_str(), message.c_str());
 
-               FIRST_MOD_RESULT(ServerInstance, OnSendSnotice, MOD_RESULT, (mysnomask, desc, message));
+               FIRST_MOD_RESULT(OnSendSnotice, MOD_RESULT, (mysnomask, desc, message));
 
                LastBlocked = (MOD_RESULT == MOD_RES_DENY);
 
index cc9cb79b9e6fa1920aafc2d32d4647f22738165a..b719ebe821c05dcbf7782a2786906323c14e1f50 100644 (file)
@@ -148,7 +148,7 @@ int InspIRCd::BindPorts(FailedPortList &failed_ports)
                                }
                                if (!skip)
                                {
-                                       ClientListenSocket *ll = new ClientListenSocket(this, portno, Addr);
+                                       ClientListenSocket *ll = new ClientListenSocket(portno, Addr);
                                        if (ll->GetFd() > -1)
                                        {
                                                bound++;
index 02cfeaa7c8e87bbbaae776f90043d6fba0ba3efa..ba1b19e9a8260378dc1280cfef66b6aa2f53dd00 100644 (file)
@@ -30,7 +30,7 @@ void InspIRCd::DoStats(char statschar, User* user, string_list &results)
        }
 
        ModResult MOD_RESULT;
-       FIRST_MOD_RESULT(this, OnStats, MOD_RESULT, (statschar, user, results));
+       FIRST_MOD_RESULT(OnStats, MOD_RESULT, (statschar, user, results));
        if (MOD_RESULT == MOD_RES_DENY)
        {
                results.push_back(sn+" 219 "+user->nick+" "+statschar+" :End of /STATS report");
index d9921a7b826b4527d1e3bd7a003cd40f840ba8bc..bc68cb5f108c360ee95eb025bddcf076547e6d67 100644 (file)
@@ -41,7 +41,7 @@ class TestSuiteThread : public Thread
        }
 };
 
-TestSuite::TestSuite(InspIRCd* Instance) : ServerInstance(Instance)
+TestSuite::TestSuite()
 {
        cout << "\n\n*** STARTING TESTSUITE ***\n";
 
@@ -74,12 +74,12 @@ TestSuite::TestSuite(InspIRCd* Instance) : ServerInstance(Instance)
                        case '2':
                                cout << "Enter module filename to load: ";
                                cin >> modname;
-                               cout << (Instance->Modules->Load(modname.c_str()) ? "\nSUCCESS!\n" : "\nFAILURE\n");
+                               cout << (ServerInstance->Modules->Load(modname.c_str()) ? "\nSUCCESS!\n" : "\nFAILURE\n");
                                break;
                        case '3':
                                cout << "Enter module filename to unload: ";
                                cin >> modname;
-                               cout << (Instance->Modules->Unload(modname.c_str()) ? "\nSUCCESS!\n" : "\nFAILURE\n");
+                               cout << (ServerInstance->Modules->Unload(modname.c_str()) ? "\nSUCCESS!\n" : "\nFAILURE\n");
                                break;
                        case '4':
                                cout << (DoThreadTests() ? "\nSUCCESS!\n" : "\nFAILURE\n");
@@ -271,7 +271,7 @@ bool TestSuite::DoThreadTests()
        cout << "Creating new ThreadEngine class...\n";
        try
        {
-               te = new ThreadEngine(ServerInstance);
+               te = new ThreadEngine;
        }
        catch (...)
        {
index a4a47f8fa37784b10d0c3ef7dc158cd6e753bb84..59ab8f4021b804280d1b0a3e05886ef800d38921 100644 (file)
@@ -17,7 +17,7 @@
 #include <signal.h>
 #include <fcntl.h>
 
-ThreadEngine::ThreadEngine(InspIRCd* Instance)
+ThreadEngine::ThreadEngine()
 {
 }
 
@@ -87,7 +87,7 @@ class ThreadSignalSocket : public BufferedSocket
        }
 };
 
-SocketThread::SocketThread(InspIRCd* SI)
+SocketThread::SocketThread()
 {
        int fd = eventfd(0, O_NONBLOCK);
        if (fd < 0)
@@ -126,7 +126,7 @@ class ThreadSignalSocket : public BufferedSocket
        }
 };
 
-SocketThread::SocketThread(InspIRCd* SI)
+SocketThread::SocketThread()
 {
        int fds[2];
        if (pipe(fds))
index fab75699e4730707751bc8388d21d662d2a98638..e880d597f71b367f16cf8ed4548923c8bdf5363a 100644 (file)
@@ -14,7 +14,7 @@
 #include "inspircd.h"
 #include "threadengines/threadengine_win32.h"
 
-ThreadEngine::ThreadEngine(InspIRCd* Instance)
+ThreadEngine::ThreadEngine()
 {
 }
 
@@ -67,7 +67,7 @@ class ThreadSignalSocket : public BufferedSocket
        }
 };
 
-SocketThread::SocketThread(InspIRCd* SI)
+SocketThread::SocketThread()
 {
        int listenFD = socket(AF_INET, SOCK_STREAM, 0);
        if (listenFD == -1)
index 8dab38392aea1a080eea7acf2d0ba060fc2f8529..31de8ab1cd472d993946379d7f1dc5687f5c05e7 100644 (file)
@@ -16,7 +16,7 @@
 #include "inspircd.h"
 #include "timer.h"
 
-TimerManager::TimerManager(InspIRCd* Instance) : ServerInstance(Instance)
+TimerManager::TimerManager()
 {
 }
 
index b37d112feef60824326a8c6fb31070836a218ec4..db8d065f110da0285366aa6441ce6263c0779cd5 100644 (file)
@@ -14,8 +14,8 @@
 /* $Core */
 
 #include "inspircd.h"
-UserResolver::UserResolver(InspIRCd* Instance, User* user, std::string to_resolve, QueryType qt, bool &cache) :
-       Resolver(Instance, to_resolve, qt, cache), bound_user(user)
+UserResolver::UserResolver(User* user, std::string to_resolve, QueryType qt, bool &cache) :
+       Resolver(to_resolve, qt, cache), bound_user(user)
 {
        this->fwd = (qt == DNS_QUERY_A || qt == DNS_QUERY_AAAA);
        this->bound_fd = user->GetFd();
@@ -37,14 +37,14 @@ void UserResolver::OnLookupComplete(const std::string &result, unsigned int ttl,
                                if (this->bound_user->client_sa.sa.sa_family == AF_INET6)
                                {
                                        /* IPV6 forward lookup */
-                                       res_forward = new UserResolver(this->ServerInstance, this->bound_user, result, DNS_QUERY_AAAA, lcached);
+                                       res_forward = new UserResolver(bound_user, result, DNS_QUERY_AAAA, lcached);
                                }
                                else
                                {
                                        /* IPV4 lookup */
-                                       res_forward = new UserResolver(this->ServerInstance, this->bound_user, result, DNS_QUERY_A, lcached);
+                                       res_forward = new UserResolver(bound_user, result, DNS_QUERY_A, lcached);
                                }
-                               this->ServerInstance->AddResolver(res_forward, lcached);
+                               ServerInstance->AddResolver(res_forward, lcached);
                        }
                }
                catch (CoreException& e)
index fe6d280c027af06471fe2048d9c94077f083e8e6..db2d3b08e6a55899950fe513d486711b38b243af 100644 (file)
@@ -18,7 +18,7 @@
 #include "bancache.h"
 
 /* add a client connection to the sockets list */
-void UserManager::AddUser(InspIRCd* Instance, int socket, ClientListenSocket* via, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* server)
+void UserManager::AddUser(int socket, ClientListenSocket* via, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* server)
 {
        /* NOTE: Calling this one parameter constructor for User automatically
         * allocates a new UUID and places it in the hash_map.
@@ -26,12 +26,12 @@ void UserManager::AddUser(InspIRCd* Instance, int socket, ClientListenSocket* vi
        User* New = NULL;
        try
        {
-               New = new User(Instance);
+               New = new User();
        }
        catch (...)
        {
-               Instance->Logs->Log("USERS", DEFAULT,"*** WTF *** Duplicated UUID! -- Crack smoking monkies have been unleashed.");
-               Instance->SNO->WriteToSnoMask('a', "WARNING *** Duplicate UUID allocated!");
+               ServerInstance->Logs->Log("USERS", DEFAULT,"*** WTF *** Duplicated UUID! -- Crack smoking monkies have been unleashed.");
+               ServerInstance->SNO->WriteToSnoMask('a', "WARNING *** Duplicate UUID allocated!");
                return;
        }
 
@@ -40,7 +40,7 @@ void UserManager::AddUser(InspIRCd* Instance, int socket, ClientListenSocket* vi
        memcpy(&New->server_sa, server, sizeof(irc::sockets::sockaddrs));
 
        /* Give each of the modules an attempt to hook the user for I/O */
-       FOREACH_MOD_I(Instance, I_OnHookIO, OnHookIO(New, via));
+       FOREACH_MOD(I_OnHookIO, OnHookIO(New, via));
 
        if (New->GetIOHook())
        {
@@ -54,7 +54,7 @@ void UserManager::AddUser(InspIRCd* Instance, int socket, ClientListenSocket* vi
                }
        }
 
-       Instance->Logs->Log("USERS", DEBUG,"New user fd: %d", socket);
+       ServerInstance->Logs->Log("USERS", DEBUG,"New user fd: %d", socket);
 
        this->unregistered_count++;
 
@@ -63,19 +63,19 @@ void UserManager::AddUser(InspIRCd* Instance, int socket, ClientListenSocket* vi
        /* The users default nick is their UUID */
        New->nick.assign(New->uuid, 0, ServerInstance->Config->Limits.NickMax);
 
-       New->server = Instance->FindServerNamePtr(Instance->Config->ServerName);
+       New->server = ServerInstance->FindServerNamePtr(ServerInstance->Config->ServerName);
        New->ident.assign("unknown");
 
        New->registered = REG_NONE;
-       New->signon = Instance->Time() + Instance->Config->dns_timeout;
+       New->signon = ServerInstance->Time() + ServerInstance->Config->dns_timeout;
        New->lastping = 1;
 
        /* Smarter than your average bear^H^H^H^Hset of strlcpys. */
        New->dhost.assign(New->GetIPString(), 0, 64);
        New->host.assign(New->GetIPString(), 0, 64);
 
-       Instance->Users->AddLocalClone(New);
-       Instance->Users->AddGlobalClone(New);
+       ServerInstance->Users->AddLocalClone(New);
+       ServerInstance->Users->AddGlobalClone(New);
 
        /*
         * First class check. We do this again in FullConnect after DNS is done, and NICK/USER is recieved.
@@ -97,9 +97,9 @@ void UserManager::AddUser(InspIRCd* Instance, int socket, ClientListenSocket* vi
 
        this->local_users.push_back(New);
 
-       if ((this->local_users.size() > Instance->Config->SoftLimit) || (this->local_users.size() >= (unsigned int)Instance->SE->GetMaxFds()))
+       if ((this->local_users.size() > ServerInstance->Config->SoftLimit) || (this->local_users.size() >= (unsigned int)ServerInstance->SE->GetMaxFds()))
        {
-               Instance->SNO->WriteToSnoMask('a', "Warning: softlimit value has been reached: %d clients", Instance->Config->SoftLimit);
+               ServerInstance->SNO->WriteToSnoMask('a', "Warning: softlimit value has been reached: %d clients", ServerInstance->Config->SoftLimit);
                this->QuitUser(New,"No more connections allowed");
                return;
        }
@@ -109,29 +109,29 @@ void UserManager::AddUser(InspIRCd* Instance, int socket, ClientListenSocket* vi
         * besides that, if we get a positive bancache hit, we still won't fuck
         * them over if they are exempt. -- w00t
         */
-       New->exempt = (Instance->XLines->MatchesLine("E",New) != NULL);
+       New->exempt = (ServerInstance->XLines->MatchesLine("E",New) != NULL);
 
-       if (BanCacheHit *b = Instance->BanCache->GetHit(New->GetIPString()))
+       if (BanCacheHit *b = ServerInstance->BanCache->GetHit(New->GetIPString()))
        {
                if (!b->Type.empty() && !New->exempt)
                {
                        /* user banned */
-                       Instance->Logs->Log("BANCACHE", DEBUG, std::string("BanCache: Positive hit for ") + New->GetIPString());
-                       if (*Instance->Config->MoronBanner)
-                               New->WriteServ("NOTICE %s :*** %s", New->nick.c_str(), Instance->Config->MoronBanner);
+                       ServerInstance->Logs->Log("BANCACHE", DEBUG, std::string("BanCache: Positive hit for ") + New->GetIPString());
+                       if (*ServerInstance->Config->MoronBanner)
+                               New->WriteServ("NOTICE %s :*** %s", New->nick.c_str(), ServerInstance->Config->MoronBanner);
                        this->QuitUser(New, b->Reason);
                        return;
                }
                else
                {
-                       Instance->Logs->Log("BANCACHE", DEBUG, std::string("BanCache: Negative hit for ") + New->GetIPString());
+                       ServerInstance->Logs->Log("BANCACHE", DEBUG, std::string("BanCache: Negative hit for ") + New->GetIPString());
                }
        }
        else
        {
                if (!New->exempt)
                {
-                       XLine* r = Instance->XLines->MatchesLine("Z",New);
+                       XLine* r = ServerInstance->XLines->MatchesLine("Z",New);
 
                        if (r)
                        {
@@ -141,9 +141,9 @@ void UserManager::AddUser(InspIRCd* Instance, int socket, ClientListenSocket* vi
                }
        }
 
-       if (!Instance->SE->AddFd(New, FD_WANT_FAST_READ | FD_WANT_EDGE_WRITE))
+       if (!ServerInstance->SE->AddFd(New, FD_WANT_FAST_READ | FD_WANT_EDGE_WRITE))
        {
-               Instance->Logs->Log("USERS", DEBUG,"Internal error on new connection");
+               ServerInstance->Logs->Log("USERS", DEBUG,"Internal error on new connection");
                this->QuitUser(New, "Internal error handling connection");
        }
 
@@ -152,7 +152,7 @@ void UserManager::AddUser(InspIRCd* Instance, int socket, ClientListenSocket* vi
         */
        New->WriteServ("NOTICE Auth :*** Looking up your hostname...");
 
-       if (Instance->Config->NoUserDns)
+       if (ServerInstance->Config->NoUserDns)
        {
                New->WriteServ("NOTICE %s :*** Skipping host resolution (disabled by server administrator)", New->nick.c_str());
                New->dns_done = true;
@@ -194,12 +194,12 @@ void UserManager::QuitUser(User *user, const std::string &quitreason, const char
 
        if (user->registered == REG_ALL)
        {
-               FOREACH_MOD_I(ServerInstance,I_OnUserQuit,OnUserQuit(user, reason, oper_reason));
+               FOREACH_MOD(I_OnUserQuit,OnUserQuit(user, reason, oper_reason));
                user->PurgeEmptyChannels();
                user->WriteCommonQuit(reason, oper_reason);
        }
 
-       FOREACH_MOD_I(ServerInstance,I_OnUserDisconnect,OnUserDisconnect(user));
+       FOREACH_MOD(I_OnUserDisconnect,OnUserDisconnect(user));
 
        if (user->registered != REG_ALL)
                if (ServerInstance->Users->unregistered_count)
@@ -517,7 +517,7 @@ void UserManager::WriteMode(const char* modes, int flags, const char* text, ...)
 /* return how many users have a given mode e.g. 'a' */
 int UserManager::ModeCount(const char mode)
 {
-       ModeHandler* mh = this->ServerInstance->Modes->FindMode(mode, MODETYPE_USER);
+       ModeHandler* mh = ServerInstance->Modes->FindMode(mode, MODETYPE_USER);
 
        if (mh)
                return mh->GetCount();
index b150f2828ebb4951b809ee0189a84bb572831ba7..bc354fa6d955ab0d11341dc6e6305cf4f1c1a1f8 100644 (file)
 
 void FloodQuitUserHandler::Call(User* current)
 {
-       Server->Logs->Log("USERS",DEFAULT,"Excess flood from: %s@%s", current->ident.c_str(), current->host.c_str());
-       Server->SNO->WriteToSnoMask('f',"Excess flood from: %s%s%s@%s",
+       ServerInstance->Logs->Log("USERS",DEFAULT,"Excess flood from: %s@%s", current->ident.c_str(), current->host.c_str());
+       ServerInstance->SNO->WriteToSnoMask('f',"Excess flood from: %s%s%s@%s",
                        current->registered == REG_ALL ? current->nick.c_str() : "",
                        current->registered == REG_ALL ? "!" : "", current->ident.c_str(), current->host.c_str());
-       Server->Users->QuitUser(current, "Excess flood");
+       ServerInstance->Users->QuitUser(current, "Excess flood");
 
        if (current->registered != REG_ALL)
        {
-               ZLine* zl = new ZLine(Server, Server->Time(), 0, Server->Config->ServerName, "Flood from unregistered connection", current->GetIPString());
-               if (Server->XLines->AddLine(zl,NULL))
-                       Server->XLines->ApplyLines();
+               ZLine* zl = new ZLine(ServerInstance->Time(), 0, ServerInstance->Config->ServerName, "Flood from unregistered connection", current->GetIPString());
+               if (ServerInstance->XLines->AddLine(zl,NULL))
+                       ServerInstance->XLines->ApplyLines();
                else
                        delete zl;
        }
index b6335038620bf865328413b2a06164ff3ddc2bc3..f5165edfa402639490b282a55064a913e0a81647 100644 (file)
@@ -109,7 +109,7 @@ void User::StartDNSLookup()
                UserResolver *res_reverse;
 
                QueryType resolvtype = this->client_sa.sa.sa_family == AF_INET6 ? DNS_QUERY_PTR6 : DNS_QUERY_PTR4;
-               res_reverse = new UserResolver(ServerInstance, this, sip, resolvtype, cached);
+               res_reverse = new UserResolver(this, sip, resolvtype, cached);
 
                ServerInstance->AddResolver(res_reverse, cached);
        }
@@ -205,9 +205,9 @@ void User::DecrementModes()
        }
 }
 
-User::User(InspIRCd* Instance, const std::string &uid)
+User::User(const std::string &uid)
 {
-       server = Instance->FindServerNamePtr(Instance->Config->ServerName);
+       server = ServerInstance->FindServerNamePtr(ServerInstance->Config->ServerName);
        age = ServerInstance->Time();
        Penalty = 0;
        lastping = signon = idle_lastmsg = nping = registered = 0;
@@ -220,15 +220,15 @@ User::User(InspIRCd* Instance, const std::string &uid)
        AllowedPrivs = AllowedOperCommands = NULL;
 
        if (uid.empty())
-               uuid.assign(Instance->GetUID(), 0, UUID_LENGTH - 1);
+               uuid.assign(ServerInstance->GetUID(), 0, UUID_LENGTH - 1);
        else
                uuid.assign(uid, 0, UUID_LENGTH - 1);
 
        ServerInstance->Logs->Log("USERS", DEBUG,"New UUID for user: %s (%s)", uuid.c_str(), uid.empty() ? "allocated new" : "used remote");
 
-       user_hash::iterator finduuid = Instance->Users->uuidlist->find(uuid);
-       if (finduuid == Instance->Users->uuidlist->end())
-               (*Instance->Users->uuidlist)[uuid] = this;
+       user_hash::iterator finduuid = ServerInstance->Users->uuidlist->find(uuid);
+       if (finduuid == ServerInstance->Users->uuidlist->end())
+               (*ServerInstance->Users->uuidlist)[uuid] = this;
        else
                throw CoreException("Duplicate UUID "+std::string(uuid)+" in User constructor");
 }
@@ -853,7 +853,7 @@ void User::FullConnect()
        ModResult MOD_RESULT;
        std::string command("LUSERS");
        std::vector<std::string> parameters;
-       FIRST_MOD_RESULT(ServerInstance, OnPreCommand, MOD_RESULT, (command, parameters, this, true, "LUSERS"));
+       FIRST_MOD_RESULT(OnPreCommand, MOD_RESULT, (command, parameters, this, true, "LUSERS"));
        if (!MOD_RESULT)
                ServerInstance->CallCommandHandler(command, parameters, this);
 
@@ -910,7 +910,7 @@ bool User::ForceNickChange(const char* newnick)
        this->InvalidateCache();
 
        NICKForced.set(this, 1);
-       FIRST_MOD_RESULT(ServerInstance, OnUserPreNick, MOD_RESULT, (this, newnick));
+       FIRST_MOD_RESULT(OnUserPreNick, MOD_RESULT, (this, newnick));
        NICKForced.set(this, 0);
 
        if (MOD_RESULT == MOD_RES_DENY)
@@ -1148,7 +1148,7 @@ void User::WriteNumeric(unsigned int numeric, const std::string &text)
        char textbuffer[MAXBUF];
        ModResult MOD_RESULT;
 
-       FIRST_MOD_RESULT(ServerInstance, OnNumeric, MOD_RESULT, (this, numeric, text));
+       FIRST_MOD_RESULT(OnNumeric, MOD_RESULT, (this, numeric, text));
 
        if (MOD_RESULT == MOD_RES_DENY)
                return;
@@ -1409,7 +1409,7 @@ bool User::ChangeName(const char* gecos)
        if (IS_LOCAL(this))
        {
                ModResult MOD_RESULT;
-               FIRST_MOD_RESULT(ServerInstance, OnChangeLocalUserGECOS, MOD_RESULT, (this,gecos));
+               FIRST_MOD_RESULT(OnChangeLocalUserGECOS, MOD_RESULT, (this,gecos));
                if (MOD_RESULT == MOD_RES_DENY)
                        return false;
                FOREACH_MOD(I_OnChangeName,OnChangeName(this,gecos));
@@ -1424,7 +1424,7 @@ void User::DoHostCycle(const std::string &quitline)
        char buffer[MAXBUF];
 
        ModResult result = MOD_RES_PASSTHRU;
-       FIRST_MOD_RESULT(ServerInstance, OnHostCycle, result, (this));
+       FIRST_MOD_RESULT(OnHostCycle, result, (this));
 
        if (result == MOD_RES_DENY)
                return;
@@ -1475,7 +1475,7 @@ bool User::ChangeDisplayedHost(const char* shost)
        if (IS_LOCAL(this))
        {
                ModResult MOD_RESULT;
-               FIRST_MOD_RESULT(ServerInstance, OnChangeLocalUserHost, MOD_RESULT, (this,shost));
+               FIRST_MOD_RESULT(OnChangeLocalUserHost, MOD_RESULT, (this,shost));
                if (MOD_RESULT == MOD_RES_DENY)
                        return false;
        }
@@ -1734,7 +1734,7 @@ void User::PurgeEmptyChannels()
                if (i2 != ServerInstance->chanlist->end())
                {
                        ModResult MOD_RESULT;
-                       FIRST_MOD_RESULT(ServerInstance, OnChannelPreDelete, MOD_RESULT, (i2->second));
+                       FIRST_MOD_RESULT(OnChannelPreDelete, MOD_RESULT, (i2->second));
                        if (MOD_RESULT == MOD_RES_DENY)
                                continue; // delete halted by module
                        FOREACH_MOD(I_OnChannelDelete,OnChannelDelete(i2->second));
index fc24d0c8231463f2d3485492ccf960a93dbbe3b8..83bfd31daae0cb64410568df0c83fe80d9610d6e 100644 (file)
@@ -68,7 +68,7 @@ void InspIRCd::DoWhois(User* user, User* dest,unsigned long signon, unsigned lon
                }
        }
 
-       FOREACH_MOD_I(this, I_OnWhois,OnWhois(user,dest));
+       FOREACH_MOD(I_OnWhois,OnWhois(user,dest));
 
        /*
         * We only send these if we've been provided them. That is, if hidewhois is turned off, and user is local, or
index b15a7ce2b22c0b447185972ccf9e625b269eb0f4..2fa6dda0039c9d8e9e742813d58fd54e883a2964 100644 (file)
@@ -181,7 +181,7 @@ bool XLineManager::AddLine(XLine* line, User* user)
                }
        }
 
-       /*ELine* item = new ELine(ServerInstance, ServerInstance->Time(), duration, source, reason, ih.first.c_str(), ih.second.c_str());*/
+       /*ELine* item = new ELine(ServerInstance->Time(), duration, source, reason, ih.first.c_str(), ih.second.c_str());*/
        XLineFactory* xlf = GetFactory(line->type);
        if (!xlf)
                return false;
@@ -389,13 +389,13 @@ void XLineManager::InvokeStats(const std::string &type, int numeric, User* user,
 }
 
 
-XLineManager::XLineManager(InspIRCd* Instance) : ServerInstance(Instance)
+XLineManager::XLineManager()
 {
-       GFact = new GLineFactory(Instance);
-       EFact = new ELineFactory(Instance);
-       KFact = new KLineFactory(Instance);
-       QFact = new QLineFactory(Instance);
-       ZFact = new ZLineFactory(Instance);
+       GFact = new GLineFactory;
+       EFact = new ELineFactory;
+       KFact = new KLineFactory;
+       QFact = new QLineFactory;
+       ZFact = new ZLineFactory;
 
        RegisterFactory(GFact);
        RegisterFactory(EFact);
index 93d7c423a1cbeb7690bebbf8674b7e9d23e72fd4..95c0ae5783fc204a41b234d4ad9b6f174906186a 100644 (file)
@@ -6,7 +6,7 @@
 #include <psapi.h>\r
 \r
 \r
-IPCThread::IPCThread(InspIRCd* Instance) : Thread(), ServerInstance(Instance)\r
+IPCThread::IPCThread()\r
 {\r
        if (!initwmi())\r
                ServerInstance->Logs->Log("IPC", DEBUG, "Could not initialise WMI. CPU percantage reports will not be available.");\r
@@ -127,7 +127,7 @@ void IPCThread::SetResult(int newresult)
 }\r
 \r
 \r
-IPC::IPC(InspIRCd* Srv) : ServerInstance(Srv)\r
+IPC::IPC()\r
 {\r
        /* The IPC pipe is threaded */\r
        thread = new IPCThread(Srv);\r
index 98647d1b8e56296ad7dddbb06da9e6e783ed57e4..eef2c9df05d60bb325ac795c3848844f2cffdeb3 100644 (file)
@@ -4,19 +4,16 @@
 #include "threadengine.h"
 #include <windows.h>
 
-class InspIRCd;
-
 class IPCThread : public Thread
 {
        BOOL Connected;
        DWORD BytesRead;
        BOOL Success;
        HANDLE Pipe;
-       InspIRCd* ServerInstance;
        char status[MAXBUF];
        int result;
  public:
-       IPCThread(InspIRCd* Instance);
+       IPCThread();
        virtual ~IPCThread();
        virtual void Run();
        const char GetStatus();
@@ -28,12 +25,11 @@ class IPCThread : public Thread
 class IPC
 {
  private:
-       InspIRCd* ServerInstance;
        IPCThread* thread;
  public:
-       IPC(InspIRCd* Srv);
+       IPC();
        void Check();
        ~IPC();
 };
 
-#endif
\ No newline at end of file
+#endif
index 1008cb83874b2ead07b7b66beb13b2c9fabce635..223fb648ebba170bf7c91a2891c7d32f15ed095e 100644 (file)
@@ -413,12 +413,12 @@ void ClearConsole()
 /* Many inspircd classes contain function pointers/functors which can be changed to point at platform specific implementations
  * of code. This function repoints these pointers and functors so that calls are windows specific.
  */
-void ChangeWindowsSpecificPointers(InspIRCd* Instance)
+void ChangeWindowsSpecificPointers()
 {
        Instance->Logs->Log("win32",DEBUG,"Changing to windows specific pointer and functor set");
 }
 
-DWORD WindowsForkStart(InspIRCd* Instance)
+DWORD WindowsForkStart()
 {
         /* Windows implementation of fork() :P */
        if (owner_processid)
@@ -498,7 +498,7 @@ DWORD WindowsForkStart(InspIRCd* Instance)
         return ExitCode;
 }
 
-void WindowsForkKillOwner(InspIRCd * Instance)
+void WindowsForkKillOwner()
 {
         HANDLE hProcess = OpenProcess(PROCESS_TERMINATE, FALSE, owner_processid);
         if(!hProcess || !owner_processid)
index 8120e193f1d25a2d6c459576341164bcafbdd74d..a1eba11e9714b0cf2b5449f9a727199f8543eaef 100644 (file)
@@ -220,7 +220,6 @@ void * ::operator new(size_t iSize);
 void ::operator delete(void * ptr);
 
 /* IPC Handlers */
-class InspIRCd;
 class ValueItem;
 class ServerConfig;
 
@@ -230,11 +229,11 @@ CoreExport std::string FindNameServerWin();
 /* Clear a windows console */
 CoreExport void ClearConsole();
 
-CoreExport DWORD WindowsForkStart(InspIRCd* Instance);
+CoreExport DWORD WindowsForkStart();
 
-CoreExport void WindowsForkKillOwner(InspIRCd* Instance);
+CoreExport void WindowsForkKillOwner();
 
-CoreExport void ChangeWindowsSpecificPointers(InspIRCd* Instance);
+CoreExport void ChangeWindowsSpecificPointers();
 
 CoreExport bool ValidateWindowsDnsServer(ServerConfig* conf, const char* tag, const char* value, ValueItem &data);