summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-04-10 11:50:48 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-04-10 11:50:48 +0000
commitb01e94da8f5b58da0343d04c9d387da0c663083a (patch)
tree005c383a489aecdb3e8a9f8416ec5a7e0526d933 /include
parent87f5ef38db9c47f04e76578d781e067c97e7096c (diff)
Start of new mode parser
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3857 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
-rw-r--r--include/mode.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/include/mode.h b/include/mode.h
index e692c5345..70c02a503 100644
--- a/include/mode.h
+++ b/include/mode.h
@@ -80,13 +80,23 @@ class ModeWatcher
char GetModeChar();
ModeType GetModeType();
- virtual bool BeforeMode(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding); /* Can change the mode parameter */
- virtual void AfterMode(userrec* source, userrec* dest, chanrec* channel, const std::string &parameter, bool adding);
+ virtual bool BeforeMode(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding, ModeType type); /* Can change the mode parameter */
+ virtual void AfterMode(userrec* source, userrec* dest, chanrec* channel, const std::string &parameter, bool adding, ModeType type);
};
class ModeParser
{
private:
+ /**
+ * Mode handlers for each mode, to access a handler subtract
+ * 65 from the ascii value of the mode letter.
+ */
+ ModeHandler* modehandlers[64];
+ /**
+ * Mode watcher classes
+ */
+ std::vector<ModeWatcher*> modewatchers[65];
+
char* GiveOps(userrec *user,char *dest,chanrec *chan,int status);
char* GiveHops(userrec *user,char *dest,chanrec *chan,int status);
char* GiveVoice(userrec *user,char *dest,chanrec *chan,int status);
@@ -99,6 +109,7 @@ class ModeParser
char* Grant(userrec *d,chanrec *chan,int MASK);
char* Revoke(userrec *d,chanrec *chan,int MASK);
public:
+ void Process(char **parameters, int pcnt, userrec *user);
std::string CompressModes(std::string modes,bool channelmodes);
void ProcessModes(char **parameters,userrec* user,chanrec *chan,int status, int pcnt, bool servermode, bool silent, bool local);
bool AllowedUmode(char umode, char* sourcemodes,bool adding,bool serveroverride);