diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-26 14:13:13 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-26 14:13:13 +0000 |
commit | 6d03943426dcce76ba66567a9b18425a5ebb4c0c (patch) | |
tree | bedffa6d2a65a9ef556405224a6d7a181c8a1ba5 /include | |
parent | 810c662c9b55908101ca085293c52c3239ef22d1 (diff) |
Remove InspIRCd* parameters and fields
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11763 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
44 files changed, 118 insertions, 232 deletions
diff --git a/include/bancache.h b/include/bancache.h index 1d56decc1..c9c469e4f 100644 --- a/include/bancache.h +++ b/include/bancache.h @@ -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() diff --git a/include/caller.h b/include/caller.h index 5a27dc707..666035752 100644 --- a/include/caller.h +++ b/include/caller.h @@ -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 diff --git a/include/channelmanager.h b/include/channelmanager.h index a4a56b632..94f119e63 100644 --- a/include/channelmanager.h +++ b/include/channelmanager.h @@ -20,12 +20,10 @@ */ class CoreExport ChannelManager { - private: - InspIRCd *ServerInstance; public: /** Constructor */ - ChannelManager(InspIRCd *Instance) : ServerInstance(Instance) + ChannelManager() { } }; diff --git a/include/channels.h b/include/channels.h index 416a34a50..ec09cbbca 100644 --- a/include/channels.h +++ b/include/channels.h @@ -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 diff --git a/include/command_parse.h b/include/command_parse.h index 7ee0e8a07..10dbef58d 100644 --- a/include/command_parse.h +++ b/include/command_parse.h @@ -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. diff --git a/include/commands/cmd_whowas.h b/include/commands/cmd_whowas.h index 5109ab54a..99d12cca4 100644 --- a/include/commands/cmd_whowas.h +++ b/include/commands/cmd_whowas.h @@ -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); diff --git a/include/configreader.h b/include/configreader.h index 783af0942..28138edd6 100644 --- a/include/configreader.h +++ b/include/configreader.h @@ -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 */ diff --git a/include/dns.h b/include/dns.h index a780505d0..1bce4f11a 100644 --- a/include/dns.h +++ b/include/dns.h @@ -185,10 +185,6 @@ class CoreExport Resolver : public Extensible { protected: /** - * Pointer to creator - */ - InspIRCd* ServerInstance; - /** * Pointer to creator module (if any, or NULL) */ Module* Creator; @@ -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. @@ -313,11 +309,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. diff --git a/include/dynamic.h b/include/dynamic.h index 4b8c7a456..19ff7bdaf 100644 --- a/include/dynamic.h +++ b/include/dynamic.h @@ -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 { diff --git a/include/fakeuser.h b/include/fakeuser.h index 60e645d65..a46971091 100644 --- a/include/fakeuser.h +++ b/include/fakeuser.h @@ -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); } diff --git a/include/filelogger.h b/include/filelogger.h index 85005940d..fba103dd6 100644 --- a/include/filelogger.h +++ b/include/filelogger.h @@ -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(); diff --git a/include/hashcomp.h b/include/hashcomp.h index c5d849529..6cbc14850 100644 --- a/include/hashcomp.h +++ b/include/hashcomp.h @@ -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 diff --git a/include/inspircd.h b/include/inspircd.h index 4c3aba95b..a5e40102a 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -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); } diff --git a/include/logger.h b/include/logger.h index d6bd07498..37020a4ff 100644 --- a/include/logger.h +++ b/include/logger.h @@ -29,10 +29,6 @@ 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; } diff --git a/include/mode.h b/include/mode.h index c0cb5b0fc..e118a161b 100644 --- a/include/mode.h +++ b/include/mode.h @@ -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 ¶meter, bool adding); @@ -364,10 +364,6 @@ class CoreExport ModeWatcher : public classbase { protected: /** - * Creator/owner pointer - */ - InspIRCd* ServerInstance; - /** * The mode letter this class is watching */ char mode; @@ -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'. diff --git a/include/modes/cmode_b.h b/include/modes/cmode_b.h index 3e4683840..0fdbaee3b 100644 --- a/include/modes/cmode_b.h +++ b/include/modes/cmode_b.h @@ -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 ¶meter, 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); diff --git a/include/modes/cmode_h.h b/include/modes/cmode_h.h index dd188626c..aea56ba32 100644 --- a/include/modes/cmode_h.h +++ b/include/modes/cmode_h.h @@ -22,7 +22,7 @@ class ModeChannelHalfOp : public ModeHandler { private: public: - ModeChannelHalfOp(InspIRCd* Instance); + ModeChannelHalfOp(); ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string ¶meter); unsigned int GetPrefixRank(); diff --git a/include/modes/cmode_i.h b/include/modes/cmode_i.h index 486ee0e1a..74495869a 100644 --- a/include/modes/cmode_i.h +++ b/include/modes/cmode_i.h @@ -20,6 +20,6 @@ class InspIRCd; class ModeChannelInviteOnly : public SimpleChannelModeHandler { public: - ModeChannelInviteOnly(InspIRCd* Instance); + ModeChannelInviteOnly(); }; diff --git a/include/modes/cmode_k.h b/include/modes/cmode_k.h index a84adff5f..bb3597923 100644 --- a/include/modes/cmode_k.h +++ b/include/modes/cmode_k.h @@ -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 ¶meter, bool adding); ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string ¶meter); void RemoveMode(Channel* channel, irc::modestacker* stack = NULL); diff --git a/include/modes/cmode_l.h b/include/modes/cmode_l.h index a2f1030a2..94313ec52 100644 --- a/include/modes/cmode_l.h +++ b/include/modes/cmode_l.h @@ -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 ¶meter, bool adding); ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string ¶meter); bool CheckTimeStamp(std::string &their_param, const std::string &our_param, Channel* channel); diff --git a/include/modes/cmode_m.h b/include/modes/cmode_m.h index 6435b833b..c36e28355 100644 --- a/include/modes/cmode_m.h +++ b/include/modes/cmode_m.h @@ -20,5 +20,5 @@ class InspIRCd; class ModeChannelModerated : public SimpleChannelModeHandler { public: - ModeChannelModerated(InspIRCd* Instance); + ModeChannelModerated(); }; diff --git a/include/modes/cmode_n.h b/include/modes/cmode_n.h index 20a0631fc..70ccfdf9a 100644 --- a/include/modes/cmode_n.h +++ b/include/modes/cmode_n.h @@ -20,5 +20,5 @@ class InspIRCd; class ModeChannelNoExternal : public SimpleChannelModeHandler { public: - ModeChannelNoExternal(InspIRCd* Instance); + ModeChannelNoExternal(); }; diff --git a/include/modes/cmode_o.h b/include/modes/cmode_o.h index 60772eb5f..524d254ee 100644 --- a/include/modes/cmode_o.h +++ b/include/modes/cmode_o.h @@ -22,7 +22,7 @@ class ModeChannelOp : public ModeHandler { private: public: - ModeChannelOp(InspIRCd* Instance); + ModeChannelOp(); ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string ¶meter); unsigned int GetPrefixRank(); diff --git a/include/modes/cmode_p.h b/include/modes/cmode_p.h index c00a9f1d3..64a4c0b3f 100644 --- a/include/modes/cmode_p.h +++ b/include/modes/cmode_p.h @@ -20,5 +20,5 @@ class InspIRCd; class ModeChannelPrivate : public SimpleChannelModeHandler { public: - ModeChannelPrivate(InspIRCd* Instance); + ModeChannelPrivate(); }; diff --git a/include/modes/cmode_s.h b/include/modes/cmode_s.h index 7d428c9a9..2f0337127 100644 --- a/include/modes/cmode_s.h +++ b/include/modes/cmode_s.h @@ -20,5 +20,5 @@ class InspIRCd; class ModeChannelSecret : public SimpleChannelModeHandler { public: - ModeChannelSecret(InspIRCd* Instance); + ModeChannelSecret(); }; diff --git a/include/modes/cmode_t.h b/include/modes/cmode_t.h index b7f87e614..6d0ce4777 100644 --- a/include/modes/cmode_t.h +++ b/include/modes/cmode_t.h @@ -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 ¶meter, bool adding); }; diff --git a/include/modes/cmode_v.h b/include/modes/cmode_v.h index 26304d64d..77e8562f2 100644 --- a/include/modes/cmode_v.h +++ b/include/modes/cmode_v.h @@ -22,7 +22,7 @@ class ModeChannelVoice : public ModeHandler { private: public: - ModeChannelVoice(InspIRCd* Instance); + ModeChannelVoice(); ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string ¶meter); unsigned int GetPrefixRank(); diff --git a/include/modes/umode_i.h b/include/modes/umode_i.h index 864547d51..58ec2d4ca 100644 --- a/include/modes/umode_i.h +++ b/include/modes/umode_i.h @@ -20,6 +20,6 @@ class InspIRCd; class ModeUserInvisible : public SimpleUserModeHandler { public: - ModeUserInvisible(InspIRCd* Instance); + ModeUserInvisible(); unsigned int GetCount(); }; diff --git a/include/modes/umode_o.h b/include/modes/umode_o.h index 9a3439ba7..a58c55670 100644 --- a/include/modes/umode_o.h +++ b/include/modes/umode_o.h @@ -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 ¶meter, bool adding); unsigned int GetCount(); }; diff --git a/include/modes/umode_s.h b/include/modes/umode_s.h index ac85050f8..d36c46deb 100644 --- a/include/modes/umode_s.h +++ b/include/modes/umode_s.h @@ -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 ¶meter, bool adding); void OnParameterMissing(User* user, User* dest, Channel* channel); std::string GetUserParameter(User* user); diff --git a/include/modes/umode_w.h b/include/modes/umode_w.h index 566753ba0..ddda3db83 100644 --- a/include/modes/umode_w.h +++ b/include/modes/umode_w.h @@ -20,6 +20,6 @@ class InspIRCd; class ModeUserWallops : public SimpleUserModeHandler { public: - ModeUserWallops(InspIRCd* Instance); + ModeUserWallops(); unsigned int GetCount(); }; diff --git a/include/modules.h b/include/modules.h index 8ae1aa8e1..d4c549730 100644 --- a/include/modules.h +++ b/include/modules.h @@ -158,39 +158,15 @@ 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 diff --git a/include/protocol.h b/include/protocol.h index bd437c76f..a3afe9fb3 100644 --- a/include/protocol.h +++ b/include/protocol.h @@ -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. diff --git a/include/snomasks.h b/include/snomasks.h index c35fc92b7..dddde1ff9 100644 --- a/include/snomasks.h +++ b/include/snomasks.h @@ -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 */ diff --git a/include/socket.h b/include/socket.h index af3eccea2..6e4bf9dbd 100644 --- a/include/socket.h +++ b/include/socket.h @@ -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 diff --git a/include/testsuite.h b/include/testsuite.h index 384f1b438..89318e32f 100644 --- a/include/testsuite.h +++ b/include/testsuite.h @@ -14,14 +14,10 @@ #ifndef __TESTSUITE_H__ #define __TESTSUITE_H__ -class InspIRCd; - class TestSuite : public Extensible { - private: - InspIRCd* ServerInstance; public: - TestSuite(InspIRCd* Instance); + TestSuite(); ~TestSuite(); bool DoThreadTests(); diff --git a/include/threadengine.h b/include/threadengine.h index 10f3fed13..41e3fc686 100644 --- a/include/threadengine.h +++ b/include/threadengine.h @@ -134,7 +134,7 @@ class CoreExport SocketThread : public Thread */ void NotifyParent(); public: - SocketThread(InspIRCd* SI); + SocketThread(); virtual ~SocketThread(); /** Lock queue. */ diff --git a/include/threadengines/threadengine_pthread.h b/include/threadengines/threadengine_pthread.h index 79b00e629..4952ea3e8 100644 --- a/include/threadengines/threadengine_pthread.h +++ b/include/threadengines/threadengine_pthread.h @@ -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 */ diff --git a/include/threadengines/threadengine_win32.h b/include/threadengines/threadengine_win32.h index 64ad87ab8..a88a0c815 100644 --- a/include/threadengines/threadengine_win32.h +++ b/include/threadengines/threadengine_win32.h @@ -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(); diff --git a/include/timer.h b/include/timer.h index 9c46b4f81..cc5364f67 100644 --- a/include/timer.h +++ b/include/timer.h @@ -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 diff --git a/include/u_listmode.h b/include/u_listmode.h index 4b8ffe9e0..cb211c9be 100644 --- a/include/u_listmode.h +++ b/include/u_listmode.h @@ -16,10 +16,10 @@ /** 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); diff --git a/include/usermanager.h b/include/usermanager.h index 72b10b224..93f0476e3 100644 --- a/include/usermanager.h +++ b/include/usermanager.h @@ -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 diff --git a/include/users.h b/include/users.h index 7ec35535f..763d45c57 100644 --- a/include/users.h +++ b/include/users.h @@ -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 diff --git a/include/xline.h b/include/xline.h index e2915e024..7ac4aa7f1 100644 --- a/include/xline.h +++ b/include/xline.h @@ -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); } }; |