diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-10 22:40:57 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-10 22:40:57 +0000 |
commit | f9636a2eff46f6829bf9e01c711ab1ba45a7d50a (patch) | |
tree | 4fd9dc8529e9e0adbd5acb47b5fa0f960aef195c /include | |
parent | 24b1fbeec8e61e9636daaf606778c324d3ae3042 (diff) |
So much stuff changed in this one, i forgot most of it.
Oh yeah, main thing is ModeHandler and ModeWatcher classes now take an InspIRCd* to their constructor
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4858 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
-rw-r--r-- | include/command_parse.h | 8 | ||||
-rw-r--r-- | include/cull_list.h | 8 | ||||
-rw-r--r-- | include/dynamic.h | 8 | ||||
-rw-r--r-- | include/inspircd.h | 4 | ||||
-rw-r--r-- | include/mode.h | 17 | ||||
-rw-r--r-- | include/modes/cmode_b.h | 4 | ||||
-rw-r--r-- | include/modes/cmode_h.h | 4 | ||||
-rw-r--r-- | include/modes/cmode_i.h | 4 | ||||
-rw-r--r-- | include/modes/cmode_k.h | 4 | ||||
-rw-r--r-- | include/modes/cmode_l.h | 4 | ||||
-rw-r--r-- | include/modes/cmode_m.h | 4 | ||||
-rw-r--r-- | include/modes/cmode_n.h | 4 | ||||
-rw-r--r-- | include/modes/cmode_o.h | 4 | ||||
-rw-r--r-- | include/modes/cmode_p.h | 4 | ||||
-rw-r--r-- | include/modes/cmode_s.h | 4 | ||||
-rw-r--r-- | include/modes/cmode_t.h | 4 | ||||
-rw-r--r-- | include/modes/cmode_v.h | 4 | ||||
-rw-r--r-- | include/modes/umode_i.h | 4 | ||||
-rw-r--r-- | include/modes/umode_n.h | 4 | ||||
-rw-r--r-- | include/modes/umode_o.h | 4 | ||||
-rw-r--r-- | include/modes/umode_s.h | 4 | ||||
-rw-r--r-- | include/modes/umode_w.h | 4 | ||||
-rw-r--r-- | include/socket.h | 2 | ||||
-rw-r--r-- | include/u_listmode.h | 4 |
24 files changed, 86 insertions, 33 deletions
diff --git a/include/command_parse.h b/include/command_parse.h index 800f2beeb..d00cdd058 100644 --- a/include/command_parse.h +++ b/include/command_parse.h @@ -23,17 +23,21 @@ #include "users.h" #include "ctables.h" #include "typedefs.h" - + +class InspIRCd; + class CommandParser : public classbase { private: + InspIRCd* ServerInstance; + int ProcessParameters(char **command_p,char *parameters); void ProcessCommand(userrec *user, std::string &cmd); void SetupCommandTable(); public: command_table cmdlist; - CommandParser(); + CommandParser(InspIRCd* Instance); bool CallHandler(const std::string &commandname,const char** parameters, int pcnt, userrec *user); bool IsValidCommand(const std::string &commandname, int pcnt, userrec * user); int LoopCall(userrec* user, command_t* CommandObj, const char** parameters, int pcnt, unsigned int splithere, unsigned int extra); diff --git a/include/cull_list.h b/include/cull_list.h index adc9fe8d5..96d5a83c5 100644 --- a/include/cull_list.h +++ b/include/cull_list.h @@ -28,6 +28,8 @@ #include "users.h" #include "channels.h" +class InspIRCd; + /** The CullItem class holds a user and their quitmessage, * and is used internally by the CullList class to compile * a list of users which are to be culled when a long @@ -79,6 +81,9 @@ class CullItem : public classbase class CullList : public classbase { private: + /** Creator of this CullList + */ + InspIRCd* ServerInstance; /** Holds a list of users being quit. * See the information for CullItem for * more information. @@ -101,8 +106,9 @@ class CullList : public classbase /** Constructor. * Clears the CullList::list and CullList::exempt * items. + * @param Instance Creator of this CullList object */ - CullList(); + CullList(InspIRCd* Instance); /** Adds a user to the cull list for later * removal via QUIT. * @param user The user to add diff --git a/include/dynamic.h b/include/dynamic.h index 386ebb376..4440c476d 100644 --- a/include/dynamic.h +++ b/include/dynamic.h @@ -22,10 +22,12 @@ typedef void * (initfunc) (void); #include "inspircd_config.h" +class InspIRCd; + class DLLManager { public: - DLLManager(const char *fname); + DLLManager(InspIRCd* ServerInstance, const char *fname); virtual ~DLLManager(); @@ -52,7 +54,7 @@ class DLLManager class DLLFactoryBase : public DLLManager { public: - DLLFactoryBase(const char *fname, const char *func_name = 0); + DLLFactoryBase(InspIRCd* Instance, const char *fname, const char *func_name = 0); virtual ~DLLFactoryBase(); #ifdef STATIC_LINK initfunc *factory_func; @@ -64,7 +66,7 @@ class DLLFactoryBase : public DLLManager template <class T> class DLLFactory : public DLLFactoryBase { public: - DLLFactory(const char *fname, const char *func_name=0) : DLLFactoryBase(fname,func_name) + DLLFactory(InspIRCd* Instance, const char *fname, const char *func_name=0) : DLLFactoryBase(Instance, fname, func_name) { if (factory_func) factory = reinterpret_cast<T*>(factory_func()); diff --git a/include/inspircd.h b/include/inspircd.h index 42072919e..b1f6431ab 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -133,6 +133,10 @@ class InspIRCd : public classbase Module* FindModule(const std::string &name); + int BindPorts(bool bail); + bool HasPort(int port, char* addr); + bool BindSocket(int sockfd, insp_sockaddr client, insp_sockaddr server, int port, char* addr); + void AddServerName(const std::string &servername); const char* FindServerNamePtr(const std::string &servername); bool FindServerName(const std::string &servername); diff --git a/include/mode.h b/include/mode.h index 63a64363a..2e51946d0 100644 --- a/include/mode.h +++ b/include/mode.h @@ -28,6 +28,8 @@ #include "channels.h" #include "ctables.h" +class InspIRCd; + /** * Holds the values for different type of modes * that can exist, USER or CHANNEL type. @@ -79,6 +81,7 @@ typedef std::pair<bool,std::string> ModePair; class ModeHandler : public Extensible { protected: + InspIRCd* ServerInstance; /** * The mode letter you're implementing. */ @@ -125,7 +128,7 @@ class ModeHandler : public Extensible * @param ModeType Set this to MODETYPE_USER for a usermode, or MODETYPE_CHANNEL for a channelmode. * @param operonly Set this to true if only opers should be allowed to set or unset the mode. */ - ModeHandler(char modeletter, int parameters_on, int parameters_off, bool listmode, ModeType type, bool operonly); + ModeHandler(InspIRCd* Instance, char modeletter, int parameters_on, int parameters_off, bool listmode, ModeType type, bool operonly); /** * The default destructor does nothing */ @@ -215,6 +218,7 @@ class ModeHandler : public Extensible class ModeWatcher : public Extensible { protected: + InspIRCd* ServerInstance; /** * The mode letter this class is watching */ @@ -228,7 +232,7 @@ class ModeWatcher : public Extensible /** * The constructor initializes the mode and the mode type */ - ModeWatcher(char modeletter, ModeType type); + ModeWatcher(InspIRCd* Instance, char modeletter, ModeType type); /** * The default destructor does nothing. */ @@ -277,6 +281,7 @@ typedef std::vector<ModeWatcher*>::iterator ModeWatchIter; class ModeParser : public classbase { private: + InspIRCd* ServerInstance; /** * Mode handlers for each mode, to access a handler subtract * 65 from the ascii value of the mode letter. @@ -301,21 +306,21 @@ class ModeParser : public classbase /** * The constructor initializes all the RFC basic modes by using ModeParserAddMode(). */ - ModeParser(); + ModeParser(InspIRCd* Instance); /** * Used to check if user 'd' should be allowed to do operation 'MASK' on channel 'chan'. * for example, should 'user A' be able to 'op' on 'channel B'. */ - static userrec* SanityChecks(userrec *user,const char *dest,chanrec *chan,int status); + userrec* SanityChecks(userrec *user,const char *dest,chanrec *chan,int status); /** * Grant a built in privilage (e.g. ops, halfops, voice) to a user on a channel */ - static const char* Grant(userrec *d,chanrec *chan,int MASK); + const char* Grant(userrec *d,chanrec *chan,int MASK); /** * Revoke a built in privilage (e.g. ops, halfops, voice) to a user on a channel */ - static const char* Revoke(userrec *d,chanrec *chan,int MASK); + const char* Revoke(userrec *d,chanrec *chan,int MASK); /** * Tidy a banmask. This makes a banmask 'acceptable' if fields are left out. * E.g. diff --git a/include/modes/cmode_b.h b/include/modes/cmode_b.h index 34b90c9b9..e17a6909a 100644 --- a/include/modes/cmode_b.h +++ b/include/modes/cmode_b.h @@ -1,12 +1,14 @@ #include "mode.h" #include "channels.h" +class InspIRCd; + class ModeChannelBan : public ModeHandler { private: BanItem b; public: - ModeChannelBan(); + ModeChannelBan(InspIRCd* Instance); ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); std::string& AddBan(userrec *user,std::string& dest,chanrec *chan,int status); std::string& DelBan(userrec *user,std::string& dest,chanrec *chan,int status); diff --git a/include/modes/cmode_h.h b/include/modes/cmode_h.h index eaf2149af..e1253d03c 100644 --- a/include/modes/cmode_h.h +++ b/include/modes/cmode_h.h @@ -1,11 +1,13 @@ #include "mode.h" #include "channels.h" +class InspIRCd; + class ModeChannelHalfOp : public ModeHandler { private: public: - ModeChannelHalfOp(); + ModeChannelHalfOp(InspIRCd* Instance); ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); std::string AddHalfOp(userrec *user,const char *dest,chanrec *chan,int status); std::string DelHalfOp(userrec *user,const char *dest,chanrec *chan,int status); diff --git a/include/modes/cmode_i.h b/include/modes/cmode_i.h index 7320cb169..b8bea88a8 100644 --- a/include/modes/cmode_i.h +++ b/include/modes/cmode_i.h @@ -1,8 +1,10 @@ #include "mode.h" +class InspIRCd; + class ModeChannelInviteOnly : public ModeHandler { public: - ModeChannelInviteOnly(); + ModeChannelInviteOnly(InspIRCd* Instance); ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); }; diff --git a/include/modes/cmode_k.h b/include/modes/cmode_k.h index 8434fc5c4..16769b572 100644 --- a/include/modes/cmode_k.h +++ b/include/modes/cmode_k.h @@ -1,9 +1,11 @@ #include "mode.h" +class InspIRCd; + class ModeChannelKey : public ModeHandler { public: - ModeChannelKey(); + ModeChannelKey(InspIRCd* Instance); ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); ModePair ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter); bool CheckTimeStamp(time_t theirs, time_t ours, const std::string &their_param, const std::string &our_param, chanrec* channel); diff --git a/include/modes/cmode_l.h b/include/modes/cmode_l.h index 69c132e56..dbedb610a 100644 --- a/include/modes/cmode_l.h +++ b/include/modes/cmode_l.h @@ -1,9 +1,11 @@ #include "mode.h" +class InspIRCd; + class ModeChannelLimit : public ModeHandler { public: - ModeChannelLimit(); + ModeChannelLimit(InspIRCd* Instance); ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); ModePair ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter); bool CheckTimeStamp(time_t theirs, time_t ours, const std::string &their_param, const std::string &our_param, chanrec* channel); diff --git a/include/modes/cmode_m.h b/include/modes/cmode_m.h index d8cff2aa4..7f8380540 100644 --- a/include/modes/cmode_m.h +++ b/include/modes/cmode_m.h @@ -1,8 +1,10 @@ #include "mode.h" +class InspIRCd; + class ModeChannelModerated : public ModeHandler { public: - ModeChannelModerated(); + ModeChannelModerated(InspIRCd* Instance); ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); }; diff --git a/include/modes/cmode_n.h b/include/modes/cmode_n.h index ebed70103..96559b81d 100644 --- a/include/modes/cmode_n.h +++ b/include/modes/cmode_n.h @@ -1,8 +1,10 @@ #include "mode.h" +class InspIRCd; + class ModeChannelNoExternal : public ModeHandler { public: - ModeChannelNoExternal(); + ModeChannelNoExternal(InspIRCd* Instance); ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); }; diff --git a/include/modes/cmode_o.h b/include/modes/cmode_o.h index ff166b5e2..25b03a786 100644 --- a/include/modes/cmode_o.h +++ b/include/modes/cmode_o.h @@ -1,11 +1,13 @@ #include "mode.h" #include "channels.h" +class InspIRCd; + class ModeChannelOp : public ModeHandler { private: public: - ModeChannelOp(); + ModeChannelOp(InspIRCd* Instance); ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); std::string AddOp(userrec *user,const char *dest,chanrec *chan,int status); std::string DelOp(userrec *user,const char *dest,chanrec *chan,int status); diff --git a/include/modes/cmode_p.h b/include/modes/cmode_p.h index 87ffca4cb..38a043da8 100644 --- a/include/modes/cmode_p.h +++ b/include/modes/cmode_p.h @@ -1,8 +1,10 @@ #include "mode.h" +class InspIRCd; + class ModeChannelPrivate : public ModeHandler { public: - ModeChannelPrivate(); + ModeChannelPrivate(InspIRCd* Instance); ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); }; diff --git a/include/modes/cmode_s.h b/include/modes/cmode_s.h index 981bddfaf..b72038f26 100644 --- a/include/modes/cmode_s.h +++ b/include/modes/cmode_s.h @@ -1,8 +1,10 @@ #include "mode.h" +class InspIRCd; + class ModeChannelSecret : public ModeHandler { public: - ModeChannelSecret(); + ModeChannelSecret(InspIRCd* Instance); ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); }; diff --git a/include/modes/cmode_t.h b/include/modes/cmode_t.h index 7e852400b..8c4a27a4d 100644 --- a/include/modes/cmode_t.h +++ b/include/modes/cmode_t.h @@ -1,8 +1,10 @@ #include "mode.h" +class InspIRCd; + class ModeChannelTopicOps : public ModeHandler { public: - ModeChannelTopicOps(); + ModeChannelTopicOps(InspIRCd* Instance); ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); }; diff --git a/include/modes/cmode_v.h b/include/modes/cmode_v.h index 3e747ca9d..a2d94938d 100644 --- a/include/modes/cmode_v.h +++ b/include/modes/cmode_v.h @@ -1,11 +1,13 @@ #include "mode.h" #include "channels.h" +class InspIRCd; + class ModeChannelVoice : public ModeHandler { private: public: - ModeChannelVoice(); + ModeChannelVoice(InspIRCd* Instance); ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); std::string AddVoice(userrec *user,const char *dest,chanrec *chan,int status); std::string DelVoice(userrec *user,const char *dest,chanrec *chan,int status); diff --git a/include/modes/umode_i.h b/include/modes/umode_i.h index 61626f3ce..dad12473e 100644 --- a/include/modes/umode_i.h +++ b/include/modes/umode_i.h @@ -1,8 +1,10 @@ #include "mode.h" +class InspIRCd; + class ModeUserInvisible : public ModeHandler { public: - ModeUserInvisible(); + ModeUserInvisible(InspIRCd* Instance); ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); }; diff --git a/include/modes/umode_n.h b/include/modes/umode_n.h index cf449f324..bb4cb2717 100644 --- a/include/modes/umode_n.h +++ b/include/modes/umode_n.h @@ -1,8 +1,10 @@ #include "mode.h" +class InspIRCd; + class ModeUserServerNoticeMask : public ModeHandler { public: - ModeUserServerNoticeMask(); + ModeUserServerNoticeMask(InspIRCd* Instance); ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); }; diff --git a/include/modes/umode_o.h b/include/modes/umode_o.h index fd389b4b0..736909fdf 100644 --- a/include/modes/umode_o.h +++ b/include/modes/umode_o.h @@ -1,8 +1,10 @@ #include "mode.h" +class InspIRCd; + class ModeUserOperator : public ModeHandler { public: - ModeUserOperator(); + ModeUserOperator(InspIRCd* Instance); ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); }; diff --git a/include/modes/umode_s.h b/include/modes/umode_s.h index c108cb44d..f982d32b9 100644 --- a/include/modes/umode_s.h +++ b/include/modes/umode_s.h @@ -1,8 +1,10 @@ #include "mode.h" +class InspIRCd; + class ModeUserServerNotice : public ModeHandler { public: - ModeUserServerNotice(); + ModeUserServerNotice(InspIRCd* Instance); ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); }; diff --git a/include/modes/umode_w.h b/include/modes/umode_w.h index e92d1ece2..ce3db0a52 100644 --- a/include/modes/umode_w.h +++ b/include/modes/umode_w.h @@ -1,8 +1,10 @@ #include "mode.h" +class InspIRCd; + class ModeUserWallops : public ModeHandler { public: - ModeUserWallops(); + ModeUserWallops(InspIRCd* Instance); ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding); }; diff --git a/include/socket.h b/include/socket.h index 8219ff5dd..92cd57130 100644 --- a/include/socket.h +++ b/include/socket.h @@ -65,8 +65,6 @@ namespace irc void NonBlocking(int s); int OpenTCPSocket(); - bool BindSocket(int sockfd, insp_sockaddr client, insp_sockaddr server, int port, char* addr); - int BindPorts(bool bail); }; }; diff --git a/include/u_listmode.h b/include/u_listmode.h index 45b04c158..8e1b9e335 100644 --- a/include/u_listmode.h +++ b/include/u_listmode.h @@ -58,8 +58,8 @@ class ListModeBase : public ModeHandler limitlist chanlimits; public: - ListModeBase(Server* serv, char modechar, const std::string &eolstr, const std::string &lnum, const std::string &eolnum, bool autotidy, const std::string &ctag = "banlist") - : ModeHandler(modechar, 1, 1, true, MODETYPE_CHANNEL, false), Srv(serv), listnumeric(lnum), endoflistnumeric(eolnum), endofliststring(eolstr), tidy(autotidy), configtag(ctag) + ListModeBase(InspIRCd* Instance, Server* serv, char modechar, const std::string &eolstr, const std::string &lnum, const std::string &eolnum, bool autotidy, const std::string &ctag = "banlist") + : ModeHandler(Instance, modechar, 1, 1, true, MODETYPE_CHANNEL, false), Srv(serv), listnumeric(lnum), endoflistnumeric(eolnum), endofliststring(eolstr), tidy(autotidy), configtag(ctag) { this->DoRehash(); infokey = "exceptionbase_mode_" + std::string(1, mode) + "_list"; |