]>
jfr.im git - irc/quakenet/newserv.git/blob - control/control.h
caf521009ec5920951a65474094ddded2081fa11
5 #include "../parser/parser.h"
6 #include "../nick/nick.h"
7 #include "../channel/channel.h"
9 void registercontrolhelpcmd(const char *name
, int level
, int maxparams
, CommandHandler handler
, char *help
);
10 int deregistercontrolcmd(const char *name
, CommandHandler handler
);
11 void controlmessage(nick
*target
, char *message
, ... );
12 void controlchanmsg(channel
*cp
, char *message
, ...);
13 void controlnotice(nick
*target
, char *message
, ...);
14 int controlshowcommands(void *sender
, int cargc
, char **cargv
);
15 int controlrmmod(void *sender
, int cargc
, char **cargv
);
16 void controlspecialrmmod(void *arg
);
17 void controlspecialreloadmod(void *arg
);
18 void controlhelp(nick
*np
, Command
*cmd
);
20 #define registercontrolcmd(a, b, c, d) registercontrolhelpcmd(a, b, c, d, NULL)
22 typedef void (*ControlMsg
)(nick
*, char *, ... );
23 typedef void (*ControlWall
)(flag_t
, flag_t
, char *, ...);
25 extern ControlMsg controlreply
;
26 extern ControlWall controlwall
;
30 extern CommandTree
*controlcmds
;
37 /* NEVER USE THE FOLLOWING IN COMMANDS, you'll end up missing bits off and users'll end up being able to gline people */
38 #define __NO_ANYONE 0x000
39 #define __NO_AUTHED 0x001 /* must be authed with the network, don't know what use this is really */
40 #define __NO_OPERED 0x002 /* just means that they MUST be /oper'ed, for hello -- part of LEGACY */
41 #define __NO_ACCOUNT 0x004 /* for hello, must have a user account */
42 #define __NO_LEGACY 0x008 /* reserved for old newserv commands, their level is 10 */
43 #define __NO_STAFF 0x010 /* +s */
44 #define __NO_TRUST 0x020 /* +t */
45 #define __NO_OPER 0x040 /* +O */
46 #define __NO_SEC 0x080 /* +w */
47 #define __NO_DEVELOPER 0x100 /* +d */
49 /* These are dangerous, they don't include requiring /OPER or STAFF status, be careful */
50 #define NOD_ACCOUNT __NO_ACCOUNT | NO_AUTHED /* must contain authed else account won't be checked */
51 #define NOD_STAFF __NO_STAFF | NOD_ACCOUNT
52 #define NOD_TRUST __NO_TRUST | NOD_ACCOUNT
53 #define NOD_OPER __NO_OPER | NOD_ACCOUNT
54 #define NOD_SEC __NO_SEC | NOD_ACCOUNT
55 #define NOD_DEVELOPER __NO_DEVELOPER | NOD_ACCOUNT
57 /* These ones are safe to use */
58 #define NO_ANYONE __NO_ANYONE /* don't have to be authed to Q, or us, or opered or anything */
59 #define NO_AUTHED __NO_AUTHED /* must be authed to Q */
60 #define NO_ACCOUNT NOD_ACCOUNT /* must have an account on the bot */
61 #define NO_OPERED __NO_OPERED /* must be /opered */
62 #define NO_STAFF NOD_STAFF /* must be authed to Q and have staff level on bot */
63 #define NO_OPER NO_OPERED | NOD_OPER /* must be authed to Q, /opered, and have oper level on bot */
64 #define NO_DEVELOPER NO_OPERED | NOD_DEVELOPER /* must be authed to Q, /opered, and have dev level on bot */
65 #define NO_TRUST_STAFF NO_STAFF | NOD_TRUST /* must be authed to Q, and have staff and trust level on bot */
66 #define NO_TRUST_OPER NO_OPER | NOD_TRUST /* must be authed to Q, /opered, and have trust and oper levels on bot */
67 #define NO_SEC_STAFF NO_STAFF | NOD_SEC /* must be authed to Q, and have staff and sec level on bot */
68 #define NO_SEC_OPER NO_OPER | NOD_SEC /* must be authed to Q, /opered, and have sec and oper levels on bot */
70 #define NO_ALL_FLAGS __NO_STAFF | __NO_TRUST | __NO_OPER | __NO_SEC | __NO_DEVELOPER
71 #define NO_OPER_FLAGS __NO_STAFF
72 #define NO_DEV_FLAGS NO_ALL_FLAGS
74 #define NL_MANAGEMENT 0x0001 /* hello, password, userflags, noticeflags */
75 #define NL_TRUSTS 0x0002 /* trust stuff... */
76 #define NL_KICKS 0x0004 /* KICK command */
77 #define NL_KILLS 0x0008 /* KILL command */
78 #define NL_GLINES 0x0010 /* GLINE commands */
79 #define NL_HITS 0x0020 /* Where a gline or kill is set automatically by the bot */
80 #define NL_CLONING 0x0040 /* Clone detection */
81 #define NL_CLEARCHAN 0x0080 /* When someone clearchans */
82 #define NL_FAKEUSERS 0x0100 /* Fakeuser addition */
83 #define NL_BROADCASTS 0x0200 /* Broadcast/mbroadcast/sbroadcast */
84 #define NL_OPERATIONS 0x0400 /* insmod/rmmod/etc */
85 #define NL_OPERING 0x0800 /* when someone opers */
86 #define NL_NOTICES 0x1000 /* turn off to receive privmsgs instead of notices */
87 #define NL_ALL_COMMANDS 0x2000 /* every single command sent */
88 #define NL_MISC 0x4000 /* misc commands */