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 /src/mode.cpp | |
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 'src/mode.cpp')
-rw-r--r-- | src/mode.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/mode.cpp b/src/mode.cpp index 29b935475..0d86a5c4c 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -65,12 +65,12 @@ using namespace std; /* +n (notice mask - our implementation of snomasks) */ #include "modes/umode_n.h" -extern InspIRCd* ServerInstance; - extern time_t TIME; -ModeHandler::ModeHandler(char modeletter, int parameters_on, int parameters_off, bool listmode, ModeType type, bool operonly) - : mode(modeletter), n_params_on(parameters_on), n_params_off(parameters_off), list(listmode), m_type(type), oper(operonly) +extern InspIRCd* ServerInstance; + +ModeHandler::ModeHandler(InspIRCd* Instance, char modeletter, int parameters_on, int parameters_off, bool listmode, ModeType type, bool operonly) + : ServerInstance(Instance), mode(modeletter), n_params_on(parameters_on), n_params_off(parameters_off), list(listmode), m_type(type), oper(operonly) { } @@ -129,7 +129,7 @@ bool ModeHandler::CheckTimeStamp(time_t theirs, time_t ours, const std::string & return (ours < theirs); } -ModeWatcher::ModeWatcher(char modeletter, ModeType type) : mode(modeletter), m_type(type) +ModeWatcher::ModeWatcher(InspIRCd* Instance, char modeletter, ModeType type) : ServerInstance(Instance), mode(modeletter), m_type(type) { } @@ -661,7 +661,7 @@ bool ModeParser::DelModeWatcher(ModeWatcher* mw) return true; } -ModeParser::ModeParser() +ModeParser::ModeParser(InspIRCd* Instance) : ServerInstance(Instance) { /* Clear mode list */ memset(modehandlers, 0, sizeof(modehandlers)); @@ -670,29 +670,29 @@ ModeParser::ModeParser() /* Initialise the RFC mode letters */ /* Start with channel simple modes, no params */ - this->AddMode(new ModeChannelSecret, 's'); - this->AddMode(new ModeChannelPrivate, 'p'); - this->AddMode(new ModeChannelModerated, 'm'); - this->AddMode(new ModeChannelTopicOps, 't'); - this->AddMode(new ModeChannelNoExternal, 'n'); - this->AddMode(new ModeChannelInviteOnly, 'i'); + this->AddMode(new ModeChannelSecret(Instance), 's'); + this->AddMode(new ModeChannelPrivate(Instance), 'p'); + this->AddMode(new ModeChannelModerated(Instance), 'm'); + this->AddMode(new ModeChannelTopicOps(Instance), 't'); + this->AddMode(new ModeChannelNoExternal(Instance), 'n'); + this->AddMode(new ModeChannelInviteOnly(Instance), 'i'); /* Cannel modes with params */ - this->AddMode(new ModeChannelKey, 'k'); - this->AddMode(new ModeChannelLimit, 'l'); + this->AddMode(new ModeChannelKey(Instance), 'k'); + this->AddMode(new ModeChannelLimit(Instance), 'l'); /* Channel listmodes */ - this->AddMode(new ModeChannelBan, 'b'); - this->AddMode(new ModeChannelOp, 'o'); - this->AddMode(new ModeChannelHalfOp, 'h'); - this->AddMode(new ModeChannelVoice, 'v'); + this->AddMode(new ModeChannelBan(Instance), 'b'); + this->AddMode(new ModeChannelOp(Instance), 'o'); + this->AddMode(new ModeChannelHalfOp(Instance), 'h'); + this->AddMode(new ModeChannelVoice(Instance), 'v'); /* Now for usermodes */ - this->AddMode(new ModeUserServerNotice, 's'); - this->AddMode(new ModeUserWallops, 'w'); - this->AddMode(new ModeUserInvisible, 'i'); - this->AddMode(new ModeUserOperator, 'o'); - this->AddMode(new ModeUserServerNoticeMask, 'n'); + this->AddMode(new ModeUserServerNotice(Instance), 's'); + this->AddMode(new ModeUserWallops(Instance), 'w'); + this->AddMode(new ModeUserInvisible(Instance), 'i'); + this->AddMode(new ModeUserOperator(Instance), 'o'); + this->AddMode(new ModeUserServerNoticeMask(Instance), 'n'); } bool ModeParser::InsertMode(std::string &output, const char* mode, unsigned short section) |