]>
Commit | Line | Data |
---|---|---|
12e82c05 | 1 | make /HELP <command> work - oper only feature? |
2 | need to make small test case to see how hard/easy this would be to add. | |
3 | ||
cddf800b | 4 | diff -r 7fa4708bac45 include/handlers.h |
5 | --- a/include/handlers.h Sun Jan 25 12:48:01 2009 +0100 | |
6 | +++ b/include/handlers.h Sun Jan 25 23:52:18 2009 +0100 | |
7 | @@ -244,5 +244,77 @@ | |
8 | extern int ms_wallvoices(struct Client*, struct Client*, int, char*[]); | |
9 | extern int ms_whois(struct Client*, struct Client*, int, char*[]); | |
10 | ||
11 | +extern int mh_nohelp(struct Client*, struct Client*, int, char*[]); | |
12 | +extern int mh_not_oper(struct Client*, struct Client*, int, char*[]); | |
13 | +extern int mh_not_server(struct Client*, struct Client*, int, char*[]); | |
14 | +extern int mh_admin(struct Client*, struct Client*, int, char*[]); | |
15 | +extern int mh_asll(struct Client*, struct Client*, int, char*[]); | |
16 | +extern int mh_away(struct Client*, struct Client*, int, char*[]); | |
17 | +extern int mh_check(struct Client*, struct Client*, int, char*[]); | |
18 | +extern int mh_clearmode(struct Client*, struct Client*, int, char*[]); | |
19 | +extern int mh_close(struct Client*, struct Client*, int, char*[]); | |
20 | +extern int mh_cnotice(struct Client*, struct Client*, int, char*[]); | |
21 | +extern int mh_connect(struct Client*, struct Client*, int, char*[]); | |
22 | +extern int mh_cprivmsg(struct Client*, struct Client*, int, char*[]); | |
23 | +extern int mh_die(struct Client*, struct Client*, int, char*[]); | |
24 | +extern int mh_get(struct Client*, struct Client*, int, char*[]); | |
25 | +extern int mh_gline(struct Client*, struct Client*, int, char*[]); | |
26 | +extern int mh_hash(struct Client*, struct Client*, int, char*[]); | |
27 | +extern int mh_help(struct Client*, struct Client*, int, char*[]); | |
28 | +extern int mh_info(struct Client*, struct Client*, int, char*[]); | |
29 | +extern int mh_invite(struct Client*, struct Client*, int, char*[]); | |
30 | +extern int mh_ison(struct Client*, struct Client*, int, char*[]); | |
31 | +extern int mh_join(struct Client*, struct Client*, int, char*[]); | |
32 | +extern int mh_jupe(struct Client*, struct Client*, int, char*[]); | |
33 | +extern int mh_kick(struct Client*, struct Client*, int, char*[]); | |
34 | +extern int mh_kill(struct Client*, struct Client*, int, char*[]); | |
35 | +extern int mh_links(struct Client*, struct Client*, int, char*[]); | |
36 | +extern int mh_list(struct Client*, struct Client*, int, char*[]); | |
37 | +extern int mh_lusers(struct Client*, struct Client*, int, char*[]); | |
38 | +extern int mh_map(struct Client*, struct Client*, int, char*[]); | |
39 | +extern int mh_mode(struct Client*, struct Client*, int, char*[]); | |
40 | +extern int mh_motd(struct Client*, struct Client*, int, char*[]); | |
41 | +extern int mh_names(struct Client*, struct Client*, int, char*[]); | |
42 | +extern int mh_nick(struct Client*, struct Client*, int, char*[]); | |
43 | +extern int mh_notice(struct Client*, struct Client*, int, char*[]); | |
44 | +extern int mh_oper(struct Client*, struct Client*, int, char*[]); | |
45 | +extern int mh_opmode(struct Client*, struct Client*, int, char*[]); | |
46 | +extern int mh_part(struct Client*, struct Client*, int, char*[]); | |
47 | +extern int mh_pass(struct Client*, struct Client*, int, char*[]); | |
48 | +extern int mh_ping(struct Client*, struct Client*, int, char*[]); | |
49 | +extern int mh_pong(struct Client*, struct Client*, int, char*[]); | |
50 | +extern int mh_privmsg(struct Client*, struct Client*, int, char*[]); | |
51 | +extern int mh_privs(struct Client*, struct Client*, int, char*[]); | |
52 | +extern int mh_quit(struct Client*, struct Client*, int, char*[]); | |
53 | +extern int mh_rehash(struct Client*, struct Client*, int, char*[]); | |
54 | +extern int mh_reset(struct Client*, struct Client*, int, char*[]); | |
55 | +extern int mh_restart(struct Client*, struct Client*, int, char*[]); | |
56 | +extern int mh_rping(struct Client*, struct Client*, int, char*[]); | |
57 | +extern int mh_set(struct Client*, struct Client*, int, char*[]); | |
58 | +extern int mh_sethost(struct Client*, struct Client*, int, char*[]); | |
59 | +extern int mh_settime(struct Client*, struct Client*, int, char*[]); | |
60 | +extern int mh_silence(struct Client*, struct Client*, int, char*[]); | |
61 | +extern int mh_squit(struct Client*, struct Client*, int, char*[]); | |
62 | +extern int mh_stats(struct Client*, struct Client*, int, char*[]); | |
63 | +extern int mh_time(struct Client*, struct Client*, int, char*[]); | |
64 | +extern int mh_topic(struct Client*, struct Client*, int, char*[]); | |
65 | +extern int mh_trace(struct Client*, struct Client*, int, char*[]); | |
66 | +extern int mh_uping(struct Client*, struct Client*, int, char*[]); | |
67 | +extern int mh_user(struct Client*, struct Client*, int, char*[]); | |
68 | +extern int mh_userhost(struct Client*, struct Client*, int, char*[]); | |
69 | +extern int mh_userip(struct Client*, struct Client*, int, char*[]); | |
70 | +extern int mh_version(struct Client*, struct Client*, int, char*[]); | |
71 | +extern int mh_wallchops(struct Client*, struct Client*, int, char*[]); | |
72 | +extern int mh_wallops(struct Client*, struct Client*, int, char*[]); | |
73 | +extern int mh_wallusers(struct Client*, struct Client*, int, char*[]); | |
74 | +extern int mh_wallvoices(struct Client*, struct Client*, int, char*[]); | |
75 | +extern int mh_who(struct Client*, struct Client*, int, char*[]); | |
76 | +extern int mh_whois(struct Client*, struct Client*, int, char*[]); | |
77 | +extern int mh_whowas(struct Client*, struct Client*, int, char*[]); | |
78 | + | |
79 | + | |
80 | + | |
81 | + | |
82 | + | |
83 | #endif /* INCLUDED_handlers_h */ | |
84 | ||
85 | diff -r 7fa4708bac45 include/ircd_handler.h | |
86 | --- a/include/ircd_handler.h Sun Jan 25 12:48:01 2009 +0100 | |
87 | +++ b/include/ircd_handler.h Sun Jan 25 23:52:18 2009 +0100 | |
88 | @@ -36,6 +36,7 @@ | |
89 | SERVER_HANDLER, /**< Used for server conections. */ | |
90 | OPER_HANDLER, /**< Used for IRC operators. */ | |
91 | SERVICE_HANDLER, /**< Used for services connections. */ | |
92 | + HELP_HANDLER, /**< Used for /HELP <command> */ | |
93 | LAST_HANDLER_TYPE /**< NUmber of handler types. */ | |
94 | } HandlerType; | |
95 | ||
96 | diff -r 7fa4708bac45 include/msg.h | |
97 | --- a/include/msg.h Sun Jan 25 12:48:01 2009 +0100 | |
98 | +++ b/include/msg.h Sun Jan 25 23:52:18 2009 +0100 | |
99 | @@ -410,7 +410,7 @@ | |
100 | * parv = parameter variable array | |
101 | */ | |
102 | /* handlers: | |
103 | - * UNREGISTERED, CLIENT, SERVER, OPER, SERVICE, LAST | |
104 | + * UNREGISTERED, CLIENT, SERVER, OPER, SERVICE, HELP, LAST | |
105 | */ | |
106 | MessageHandler handlers[LAST_HANDLER_TYPE]; | |
107 | }; | |
108 | diff -r 7fa4708bac45 include/numeric.h | |
109 | --- a/include/numeric.h Sun Jan 25 12:48:01 2009 +0100 | |
110 | +++ b/include/numeric.h Sun Jan 25 23:52:18 2009 +0100 | |
111 | @@ -475,7 +475,6 @@ | |
112 | /* ERR_NOMANAGER_LONG 565 no longer used */ | |
113 | #define ERR_NOMANAGER 566 /* Undernet extension */ | |
114 | #define ERR_UPASS_SAME_APASS 567 /* Undernet extension */ | |
115 | -#define ERR_LASTERROR 568 | |
116 | ||
117 | /* RPL_LOGON 600 dalnet,unreal | |
118 | RPL_LOGOFF 601 dalnet,unreal | |
119 | @@ -499,4 +498,10 @@ | |
120 | RPL_DUMPRPL 641 unreal | |
121 | RPL_EODUMP 642 unreal | |
122 | */ | |
123 | +#define RPL_HELP 601 /* QuakeNet extension */ | |
124 | +#define RPL_ENDOFHELP 602 /* QuakeNet extension */ | |
125 | +#define ERR_NOHELP 603 /* QuakeNet extension */ | |
126 | + | |
127 | +#define ERR_LASTERROR 604 | |
128 | + | |
129 | #endif /* INCLUDED_numeric_h */ | |
130 | diff -r 7fa4708bac45 include/parse.h | |
131 | --- a/include/parse.h Sun Jan 25 12:48:01 2009 +0100 | |
132 | +++ b/include/parse.h Sun Jan 25 23:52:18 2009 +0100 | |
133 | @@ -15,6 +15,7 @@ | |
134 | extern int parse_client(struct Client *cptr, char *buffer, char *bufend); | |
135 | extern int parse_server(struct Client *cptr, char *buffer, char *bufend); | |
136 | extern void initmsgtree(void); | |
137 | +extern struct Message *find_message_by_cmd(char *cmd); | |
138 | ||
139 | extern int register_mapping(struct s_map *map); | |
140 | extern int unregister_mapping(struct s_map *map); | |
141 | diff -r 7fa4708bac45 ircd/m_defaults.c | |
142 | --- a/ircd/m_defaults.c Sun Jan 25 12:48:01 2009 +0100 | |
143 | +++ b/ircd/m_defaults.c Sun Jan 25 23:52:18 2009 +0100 | |
144 | @@ -119,3 +119,18 @@ | |
145 | { | |
146 | return 0; | |
147 | } | |
148 | + | |
149 | +int mh_nohelp(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
150 | +{ | |
151 | + return send_reply(sptr, ERR_NOHELP, parv[1]); | |
152 | +} | |
153 | + | |
154 | +int mh_not_oper(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
155 | +{ | |
156 | + return send_reply(sptr, SND_EXPLICIT | RPL_HELP, "%s :This command is for IRC Operators only.", parv[1]); | |
157 | +} | |
158 | + | |
159 | +int mh_not_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
160 | +{ | |
161 | + return send_reply(sptr, SND_EXPLICIT | RPL_HELP, "%s :This command is for servers only.", parv[1]); | |
162 | +} | |
163 | \ No newline at end of file | |
164 | diff -r 7fa4708bac45 ircd/m_help.c | |
165 | --- a/ircd/m_help.c Sun Jan 25 12:48:01 2009 +0100 | |
166 | +++ b/ircd/m_help.c Sun Jan 25 23:52:18 2009 +0100 | |
167 | @@ -90,6 +90,7 @@ | |
168 | #include "msg.h" | |
169 | #include "numeric.h" | |
170 | #include "numnicks.h" | |
171 | +#include "parse.h" | |
172 | #include "send.h" | |
173 | ||
174 | /* #include <assert.h> -- Now using assert in ircd_log.h */ | |
175 | @@ -100,9 +101,1124 @@ | |
12e82c05 | 176 | int m_help(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) |
177 | { | |
178 | int i; | |
cddf800b | 179 | + struct Message* mptr; |
180 | + MessageHandler handler = 0; | |
181 | + char *command; | |
182 | ||
183 | - for (i = 0; msgtab[i].cmd; i++) | |
184 | - sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :%s", sptr, msgtab[i].cmd); | |
185 | + /* list all commands */ | |
186 | + if (parc < 2) { | |
187 | + for (i = 0; msgtab[i].cmd; i++) | |
188 | + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :%s", sptr, msgtab[i].cmd); | |
189 | + return 0; | |
190 | + } | |
191 | + command = parv[1]; | |
192 | + | |
193 | + /* nothing found */ | |
194 | + if ((mptr = find_message_by_cmd(command)) == NULL) | |
195 | + return send_reply(sptr, ERR_NOHELP, command); | |
196 | + | |
197 | + /* found a help handler function */ | |
198 | + handler = mptr->handlers[HELP_HANDLER]; | |
199 | + | |
200 | + assert(0 != handler); | |
201 | + | |
202 | + /* call the help handler function */ | |
203 | + (*handler) (cptr, sptr, parc, parv); | |
204 | + return send_reply(sptr, RPL_ENDOFHELP, command); | |
205 | +} | |
206 | + | |
207 | + | |
208 | +/* | |
209 | + * mh_help - help message handler | |
210 | + */ | |
211 | +int mh_help(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
212 | +{ | |
213 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
214 | + "HELP :HELP [<command>]"); | |
215 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
216 | + "HELP :Lists all server commands or info on the given command."); | |
12e82c05 | 217 | return 0; |
cddf800b | 218 | } |
12e82c05 | 219 | |
cddf800b | 220 | + |
221 | +/* | |
222 | + * TODO: move all the mh_ functions into the files of the commands they belong to | |
223 | + */ | |
224 | + | |
225 | + | |
226 | +/* | |
227 | + * mh_admin - help message handler | |
228 | + * TODO: check HIS remote | |
229 | + */ | |
230 | +int mh_admin(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
231 | +{ | |
232 | + if (!IsAnOper(sptr)) | |
233 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
234 | + "ADMIN :ADMIN"); | |
235 | + else | |
236 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
237 | + "ADMIN :ADMIN [<server>]"); | |
238 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
239 | + "ADMIN :Shows administrative contact for the server."); | |
240 | + return 0; | |
241 | +} | |
242 | + | |
243 | + | |
244 | +/* | |
245 | + * mh_asll - help message handler | |
246 | + */ | |
247 | +int mh_asll(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
248 | +{ | |
249 | + if (!IsAnOper(sptr)) | |
250 | + return mh_not_oper(cptr, sptr, parc, parv); | |
251 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
252 | + "ASLL :ASLL <mask> [<server>]"); | |
253 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
254 | + "ASLL :Shows Asymmetric Link Latency information."); | |
255 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
256 | + "ASLL :Parameter <mask> is matched against directly linked servers, and may have more than one match."); | |
257 | + return 0; | |
258 | +} | |
259 | + | |
260 | + | |
261 | +/* | |
262 | + * mh_away - help message handler | |
263 | + */ | |
264 | +int mh_away(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
265 | +{ | |
266 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
267 | + "AWAY :AWAY [<message>]"); | |
268 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
269 | + "AWAY :Sets or clears the away message."); | |
270 | + return 0; | |
271 | +} | |
272 | + | |
273 | + | |
274 | +/* | |
275 | + * mh_check - help message handler | |
276 | + */ | |
277 | +int mh_check(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
278 | +{ | |
279 | + if (!IsAnOper(sptr)) | |
280 | + return mh_not_oper(cptr, sptr, parc, parv); | |
281 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
282 | + "CHECK :CHECK [<server>] <mask> [<flags>]"); | |
283 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
284 | + "CHECK :Shows detailed information about a user, a channel, a hostmask, or a server."); | |
285 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
286 | + "CHECK :Flags are: -C show clones, -c show channels, -s show servernames, -e show more, " | |
287 | + "-i show IPs, -I show hostnames and IPs, -u do not show users, -o show only channel operators."); | |
288 | + return 0; | |
289 | +} | |
290 | + | |
291 | + | |
292 | +/* | |
293 | + * mh_clearmode - help message handler | |
294 | + */ | |
295 | +int mh_clearmode(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
296 | +{ | |
297 | + if (!IsAnOper(sptr)) | |
298 | + return mh_not_oper(cptr, sptr, parc, parv); | |
299 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
300 | + "CLEARMODE :CLEARMODE [!]<channel> [<modes>]"); | |
301 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
302 | + "CLEARMODE :Clears modes on a channel."); | |
303 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
304 | + "CLEARMODE :Default modes are ovpsmikbl - o deops all channel operators, " | |
305 | + "v devoices all channel voices, and b removes all channel bans."); | |
306 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
307 | + "CLEARMODE :The ! prefix may be used to override a channel quarantine."); | |
308 | + return 0; | |
309 | +} | |
310 | + | |
311 | + | |
312 | +/* | |
313 | + * mh_close - help message handler | |
314 | + */ | |
315 | +int mh_close(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
316 | +{ | |
317 | + if (!IsAnOper(sptr)) | |
318 | + return mh_not_oper(cptr, sptr, parc, parv); | |
319 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
320 | + "CLOSE :CLOSE"); | |
321 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
322 | + "CLOSE :Closes unregistered connections to the server."); | |
323 | + return 0; | |
324 | +} | |
325 | + | |
326 | + | |
327 | +/* | |
328 | + * mh_cnotice - help message handler | |
329 | + */ | |
330 | +int mh_cnotice(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
331 | +{ | |
332 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
333 | + "CNOTICE :CNOTICE <nick> <channel> :<message>"); | |
334 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
335 | + "CNOTICE :Sends a private notice to a user."); | |
336 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
337 | + "CNOTICE :A channel voice or operator can use this to bypass the target flood limit " | |
338 | + "(target change too fast error) when the user is on the channel."); | |
339 | + return 0; | |
340 | +} | |
341 | + | |
342 | + | |
343 | +/* | |
344 | + * mh_connect - help message handler | |
345 | + */ | |
346 | +int mh_connect(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
347 | +{ | |
348 | + if (!IsAnOper(sptr)) | |
349 | + return mh_not_oper(cptr, sptr, parc, parv); | |
350 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
351 | + "CONNECT :CONNECT <server> [<port> [<remote server>]]"); | |
352 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
353 | + "CONNECT :Connects the server to another server."); | |
354 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
355 | + "CONNECT :Special port 0 can be used to let the remote server workout the port to use."); | |
356 | + return 0; | |
357 | +} | |
358 | + | |
359 | + | |
360 | +/* | |
361 | + * mh_cprivmsg - help message handler | |
362 | + */ | |
363 | +int mh_cprivmsg(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
364 | +{ | |
365 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
366 | + "CPRIVMSG :CPRIVMSG <nick> <channel> :<message>"); | |
367 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
368 | + "CPRIVMSG :Sends a private message to a user."); | |
369 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
370 | + "CPRIVMSG :A channel voice or operator can use this to bypass the target flood limit " | |
371 | + "(target change too fast error) when the user is on the channel."); | |
372 | + return 0; | |
373 | +} | |
374 | + | |
375 | + | |
376 | +/* | |
377 | + * mh_die - help message handler | |
378 | + */ | |
379 | +int mh_die(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
380 | +{ | |
381 | + if (!IsAnOper(sptr)) | |
382 | + return mh_not_oper(cptr, sptr, parc, parv); | |
383 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
384 | + "DIE :DIE <server>"); | |
385 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
386 | + "DIE :Terminates the server. The servername needs to be given as sanity check."); | |
387 | + return 0; | |
388 | +} | |
389 | + | |
390 | + | |
391 | +/* | |
392 | + * mh_get - help message handler | |
393 | + * TODO: check HIS | |
394 | + */ | |
395 | +int mh_get(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
396 | +{ | |
397 | + if (!IsAnOper(sptr)) | |
398 | + return mh_not_oper(cptr, sptr, parc, parv); | |
399 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
400 | + "GET :GET <feature> [<parameters>]"); | |
401 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
402 | + "GET :Returns the value of a feature."); | |
403 | + return 0; | |
404 | +} | |
405 | + | |
406 | + | |
407 | +/* | |
408 | + * mh_gline - help message handler | |
409 | + * TODO: check HIS | |
410 | + */ | |
411 | +int mh_gline(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
412 | +{ | |
413 | + if (!IsAnOper(sptr)) | |
414 | + return mh_not_oper(cptr, sptr, parc, parv); | |
415 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
416 | + "GLINE :GLINE [[!][+|-|>|<]<mask> [<target>] [<duration> [:<reason>]]]"); | |
417 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
418 | + "GLINE :Views, sets or changes a gline."); | |
419 | + return 0; | |
420 | +} | |
421 | + | |
422 | + | |
423 | +/* | |
424 | + * mh_hash - help message handler | |
425 | + * TODO: check HIS | |
426 | + */ | |
427 | +int mh_hash(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
428 | +{ | |
429 | + if (!IsAnOper(sptr)) | |
430 | + return mh_not_oper(cptr, sptr, parc, parv); | |
431 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
432 | + "HASH :HASH"); | |
433 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
434 | + "HASH :Shows hash table statistics."); | |
435 | + return 0; | |
436 | +} | |
437 | + | |
438 | + | |
439 | +/* | |
440 | + * mh_info - help message handler | |
441 | + * TODO: check HIS remote | |
442 | + */ | |
443 | +int mh_info(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
444 | +{ | |
445 | + if (!IsAnOper(sptr)) { | |
446 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, "INFO :INFO"); | |
447 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, "INFO :Shows info about the IRCd."); | |
448 | + return mh_not_oper(cptr, sptr, parc, parv); | |
449 | + } else { | |
450 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, "INFO :INFO [<server>]"); | |
451 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
452 | + "INFO :Show info about the IRCd. Lists a file hash and version number for its source files."); | |
453 | + } | |
454 | + return 0; | |
455 | +} | |
456 | + | |
457 | + | |
458 | +/* | |
459 | + * mh_invite - help message handler | |
460 | + */ | |
461 | +int mh_invite(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
462 | +{ | |
463 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
464 | + "INVITE :INVITE <nick> <channel>"); | |
465 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
466 | + "INVITE :Invites a user to a channel."); | |
467 | + return 0; | |
468 | +} | |
469 | + | |
470 | + | |
471 | +/* | |
472 | + * mh_ison - help message handler | |
473 | + * TODO: check that syntax is clear - no limit on number of nicks | |
474 | + */ | |
475 | +int mh_ison(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
476 | +{ | |
477 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
478 | + "ISON :ISON <nick> [<nick> [..]]"); | |
479 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
480 | + "ISON :Returns the nicks that are on the network."); | |
481 | + return 0; | |
482 | +} | |
483 | + | |
484 | + | |
485 | +/* | |
486 | + * mh_join - help message handler | |
487 | + */ | |
488 | +int mh_join(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
489 | +{ | |
490 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
491 | + "JOIN :JOIN <channel> [<key>]"); | |
492 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
493 | + "JOIN :Joins a channel, where <channel> and <key> are a comma separated list of one or more elements."); | |
494 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
495 | + "JOIN :Joining channel 0 can be used to leave all channels."); | |
496 | + return 0; | |
497 | +} | |
498 | + | |
499 | + | |
500 | +/* | |
501 | + * mh_jupe - help message handler | |
502 | + * TODO: check HIS? | |
503 | + */ | |
504 | +int mh_jupe(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
505 | +{ | |
506 | + if (!IsAnOper(sptr)) | |
507 | + return mh_not_oper(cptr, sptr, parc, parv); | |
508 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
509 | + "JUPE :JUPE [[+|-]<server> [[<target>] <duration> :<reason>]]"); | |
510 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
511 | + "JUPE :Views or manipulates server jupes."); | |
512 | + return 0; | |
513 | +} | |
514 | + | |
515 | + | |
516 | +/* | |
517 | + * mh_kick - help message handler | |
518 | + */ | |
519 | +int mh_kick(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
520 | +{ | |
521 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
522 | + "KICK :KICK <channel> <nick> [:<reason>]"); | |
523 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
524 | + "KICK :Kicks a user from a channel."); | |
525 | + return 0; | |
526 | +} | |
527 | + | |
528 | + | |
529 | +/* | |
530 | + * mh_kill - help message handler | |
531 | + */ | |
532 | +int mh_kill(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
533 | +{ | |
534 | + if (!IsAnOper(sptr)) | |
535 | + return mh_not_oper(cptr, sptr, parc, parv); | |
536 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
537 | + "KILL :KILL <nick> :<reason>"); | |
538 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
539 | + "KILL :Disconnects a user from the network."); | |
540 | + return 0; | |
541 | +} | |
542 | + | |
543 | + | |
544 | +/* | |
545 | + * mh_links - help message handler | |
546 | + * TODO: check HIS feature | |
547 | + */ | |
548 | +int mh_links(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
549 | +{ | |
550 | + if (!IsAnOper(sptr)) | |
551 | + return mh_not_oper(cptr, sptr, parc, parv); | |
552 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
553 | + "LINKS :LINKS [[<remote server>] <mask>]"); | |
554 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
555 | + "LINKS :Shows server links on the network."); | |
556 | + return 0; | |
557 | +} | |
558 | + | |
559 | + | |
560 | +/* | |
561 | + * mh_list - help message handler | |
562 | + */ | |
563 | +int mh_list(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
564 | +{ | |
565 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
566 | + "LIST :LIST :[<channel>|<parameters>|STOP]"); | |
567 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
568 | + "LIST :Lists channels on the network. See \"/QUOTE LIST :\" for more info."); | |
569 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
570 | + "LIST :Parameter <channel> is a comma separated list of one or more channels."); | |
571 | + return 0; | |
572 | +} | |
573 | + | |
574 | + | |
575 | +/* | |
576 | + * mh_lusers - help message handler | |
577 | + * TODO: check HIS remote feature | |
578 | + */ | |
579 | +int mh_lusers(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
580 | +{ | |
581 | + if (!IsAnOper(sptr)) | |
582 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
583 | + "LUSERS :LUSERS"); | |
584 | + else | |
585 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
586 | + "LUSERS :LUSERS [<dummy> [<remote server>]]"); | |
587 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
588 | + "LUSERS :Shows information about the number of users on the network."); | |
589 | + return 0; | |
590 | +} | |
591 | + | |
592 | + | |
593 | +/* | |
594 | + * mh_map - help message handler | |
595 | + * TODO: check HIS feature | |
596 | + */ | |
597 | +int mh_map(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
598 | +{ | |
599 | + if (!IsAnOper(sptr)) | |
600 | + return mh_not_oper(cptr, sptr, parc, parv); | |
601 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
602 | + "MAP :MAP [<mask>]"); | |
603 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
604 | + "MAP :Shows a map of the servers on the network."); | |
605 | + return 0; | |
606 | +} | |
607 | + | |
608 | + | |
609 | +/* | |
610 | + * mh_mode - help message handler | |
611 | + * TODO: check syntax is clear | |
612 | + */ | |
613 | +int mh_mode(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
614 | +{ | |
615 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
616 | + "MODE :MODE <channel>|<nick> [<modes>]"); | |
617 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
618 | + "MODE :Views or changes modes of a channel or user."); | |
619 | + return 0; | |
620 | +} | |
621 | + | |
622 | + | |
623 | +/* | |
624 | + * mh_motd - help message handler | |
625 | + * TODO: check HIS remote feature | |
626 | + */ | |
627 | +int mh_motd(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
628 | +{ | |
629 | + if (!IsAnOper(sptr)) | |
630 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
631 | + "MOTD :MOTD"); | |
632 | + else | |
633 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
634 | + "MOTD :MOTD [<server>]"); | |
635 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
636 | + "MOTD :Shows the Message Of The Day."); | |
637 | + return 0; | |
638 | +} | |
639 | + | |
640 | + | |
641 | +/* | |
642 | + * mh_names - help message handler | |
643 | + * TODO: check HIS remote feature | |
644 | + */ | |
645 | +int mh_names(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
646 | +{ | |
647 | + if (!IsAnOper(sptr)) | |
648 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
649 | + "NAMES :NAMES [[-D] <channel>]"); | |
650 | + else | |
651 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
652 | + "NAMES :NAMES [[[-D] [channel]] [<server>]]"); | |
653 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
654 | + "NAMES :Shows the names of users on the channel."); | |
655 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
656 | + "NAMES :Parameter <channel> is a comma separated list of one or more channels," | |
657 | + " and the -D option is for listing delayedjoin users."); | |
658 | + return 0; | |
659 | +} | |
660 | + | |
661 | + | |
662 | +/* | |
663 | + * mh_nick - help message handler | |
664 | + */ | |
665 | +int mh_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
666 | +{ | |
667 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
668 | + "NICK :NICK <newnick>"); | |
669 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
670 | + "NICK :Changes nickname."); | |
671 | + return 0; | |
672 | +} | |
673 | + | |
674 | + | |
675 | +/* | |
676 | + * mh_notice - help message handler | |
677 | + */ | |
678 | +int mh_notice(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
679 | +{ | |
680 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
681 | + "NOTICE :NOTICE <target> :<message>"); | |
682 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
683 | + "NOTICE :Sends a notice to a target, where <target> can be a comma separated list of one or more nicks or channels."); | |
684 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
685 | + "NOTICE :Parameter <target> can be @<channel> to send a message to all channel operators (same as WALLCHOPS)."); | |
686 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
687 | + "NOTICE :Parameter <target> can be in the form of <nick>@<server> to send to a service."); | |
688 | + if (IsAnOper(sptr)) { | |
689 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
690 | + "NOTICE :Parameter <target> can be a $<servername> to broadcast a message to all users on a server."); | |
691 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
692 | + "NOTICE :Parameter <target> can be a $@<hostmask> to broadcast a message to all users with a matching host."); | |
693 | + } | |
694 | + return 0; | |
695 | +} | |
696 | + | |
697 | + | |
698 | +/* | |
699 | + * mh_oper - help message handler | |
700 | + */ | |
701 | +int mh_oper(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
702 | +{ | |
703 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
704 | + "OPER :OPER <username> <password>"); | |
705 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
706 | + "OPER :Logs in as IRC Operator."); | |
707 | + return 0; | |
708 | +} | |
709 | + | |
710 | + | |
711 | +/* | |
712 | + * mh_opmode - help message handler | |
713 | + */ | |
714 | +int mh_opmode(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
715 | +{ | |
716 | + if (!IsAnOper(sptr)) | |
717 | + return mh_not_oper(cptr, sptr, parc, parv); | |
718 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
719 | + "OPMODE :OPMODE [!]<channel> <modes>"); | |
720 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
721 | + "OPMODE :Changes modes on a channel."); | |
722 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
723 | + "OPMODE :The ! prefix may be used to override a channel quarantine."); | |
724 | + return 0; | |
725 | +} | |
726 | + | |
727 | +/* | |
728 | + * mh_part - help message handler | |
729 | + */ | |
730 | +int mh_part(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
731 | +{ | |
732 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
733 | + "PART :PART <channel> [:<message>]"); | |
734 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
735 | + "PART :Parts a channel with an optional message."); | |
736 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
737 | + "PART :Parameter <channel> is a comma separated list of one or more channels."); | |
738 | + return 0; | |
739 | +} | |
740 | + | |
741 | + | |
742 | +/* | |
743 | + * mh_pass - help message handler | |
744 | + */ | |
745 | +int mh_pass(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
746 | +{ | |
747 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
748 | + "PASS :PASS :<password>"); | |
749 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
750 | + "PASS :Provides the password required to connect to the server."); | |
751 | + return 0; | |
752 | +} | |
753 | + | |
754 | + | |
755 | +/* | |
756 | + * mh_ping - help message handler | |
757 | + * TODO: <text> ? | |
758 | + */ | |
759 | +int mh_ping(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
760 | +{ | |
761 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
762 | + "PING :PING :<text>"); | |
763 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
764 | + "PING :Sends a ping to the server."); | |
765 | + return 0; | |
766 | +} | |
767 | + | |
768 | + | |
769 | +/* | |
770 | + * mh_pong - help message handler | |
771 | + * TODO: <text> ? | |
772 | + */ | |
773 | +int mh_pong(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
774 | +{ | |
775 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
776 | + "PONG :PONG :<text>"); | |
777 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
778 | + "PONG :Sends a pong as reply to a PING from the server."); | |
779 | + return 0; | |
780 | +} | |
781 | + | |
782 | + | |
783 | +/* | |
784 | + * mh_privmsg - help message handler | |
785 | + */ | |
786 | +int mh_privmsg(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
787 | +{ | |
788 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
789 | + "PRIVMSG :PRIVMSG <target> :<message>"); | |
790 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
791 | + "PRIVMSG :Sends a message to a target, where <target> can be a comma separated list of one or more nicks or channels."); | |
792 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
793 | + "PRIVMSG :Parameter <target> can be @<channel> to send a message to all channel operators (same as WALLCHOPS)."); | |
794 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
795 | + "PRIVMSG :Parameter <target> can be in the form of <nick>@<server> to send to a service."); | |
796 | + if (IsAnOper(sptr)) { | |
797 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
798 | + "PRIVMSG :Parameter <target> can be a $<servername> to broadcast a message to all users on a server."); | |
799 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
800 | + "PRIVMSG :Parameter <target> can be a $@<hostmask> to broadcast a message to all users with a matching host."); | |
801 | + } | |
802 | + return 0; | |
803 | +} | |
804 | + | |
805 | + | |
806 | +/* | |
807 | + * mh_privs - help message handler | |
808 | + */ | |
809 | +int mh_privs(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
810 | +{ | |
811 | + if (!IsAnOper(sptr)) | |
812 | + return mh_not_oper(cptr, sptr, parc, parv); | |
813 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
814 | + "PRIVS :PRIVS <nick> [<nick> [..]]"); | |
815 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
816 | + "PRIVS :Shows the privileges an IRC Operator has."); | |
817 | + return 0; | |
818 | +} | |
819 | + | |
820 | + | |
821 | +/* | |
822 | + * mh_quit - help message handler | |
823 | + * TODO: Disconnect or Disconnects? | |
824 | + */ | |
825 | +int mh_quit(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
826 | +{ | |
827 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
828 | + "QUIT :QUIT :<message>"); | |
829 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
830 | + "QUIT :Disconnect from the network with an optional message."); | |
831 | + return 0; | |
832 | +} | |
833 | + | |
834 | + | |
835 | +/* | |
836 | + * mh_rehash - help message handler | |
837 | + * TODO: check the options, etc. | |
838 | + */ | |
839 | +int mh_rehash(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
840 | +{ | |
841 | + if (!IsAnOper(sptr)) | |
842 | + return mh_not_oper(cptr, sptr, parc, parv); | |
843 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
844 | + "REHASH :REHASH [L|M|Q]"); | |
845 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
846 | + "REHASH :Reloads the server conf file, MOTD, and log files."); | |
847 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
848 | + "REHASH :Where L reopens the log files, M flushes the MOTD cache, Q the DNS resolver is not restarted."); | |
849 | + return 0; | |
850 | +} | |
851 | + | |
852 | + | |
853 | +/* | |
854 | + * mh_reset - help message handler | |
855 | + */ | |
856 | +int mh_reset(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
857 | +{ | |
858 | + if (!IsAnOper(sptr)) | |
859 | + return mh_not_oper(cptr, sptr, parc, parv); | |
860 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
861 | + "RESET :RESET <feature> [<parameters>]"); | |
862 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
863 | + "RESET :Resets a feature to its default hardcoded value."); | |
864 | + return 0; | |
865 | +} | |
866 | + | |
867 | + | |
868 | +/* | |
869 | + * mh_restart - help message handler | |
870 | + */ | |
871 | +int mh_restart(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
872 | +{ | |
873 | + if (!IsAnOper(sptr)) | |
874 | + return mh_not_oper(cptr, sptr, parc, parv); | |
875 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
876 | + "RESTART :RESTART <server>"); | |
877 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
878 | + "RESTART :Restarts the server. The servername needs to be given as sanity check."); | |
879 | + return 0; | |
880 | +} | |
881 | + | |
882 | + | |
883 | +/* | |
884 | + * mh_rping - help message handler | |
885 | + * TODO: <text> ? | |
886 | + */ | |
887 | +int mh_rping(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
888 | +{ | |
889 | + if (!IsAnOper(sptr)) | |
890 | + return mh_not_oper(cptr, sptr, parc, parv); | |
891 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
892 | + "RPING :RPING <server> [<remote server>] [:<text>]"); | |
893 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
894 | + "RPING :Pings a remote server and returns the Round Trip Time in milliseconds."); | |
895 | + return 0; | |
896 | +} | |
897 | + | |
898 | + | |
899 | +/* | |
900 | + * mh_set - help message handler | |
901 | + */ | |
902 | +int mh_set(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
903 | +{ | |
904 | + if (!IsAnOper(sptr)) | |
905 | + return mh_not_oper(cptr, sptr, parc, parv); | |
906 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
907 | + "SET :SET <feature> [<parameters>] :<value>"); | |
908 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
909 | + "SET :Changes the value of a feature."); | |
910 | + return 0; | |
911 | +} | |
912 | + | |
913 | + | |
914 | +/* | |
915 | + * mh_sethost - help message handler | |
916 | + */ | |
917 | +int mh_sethost(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
918 | +{ | |
919 | + if (!IsAnOper(sptr)) { | |
920 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
921 | + "SETHOST :SETHOST <spoofhost> <password>"); | |
922 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
923 | + "SETHOST :Sets a spoof host."); | |
924 | + } else { | |
925 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
926 | + "SETHOST :SETHOST <user> <host>"); | |
927 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
928 | + "SETHOST :Sets a spoof user@host."); | |
929 | + } | |
930 | + return 0; | |
931 | +} | |
932 | + | |
933 | + | |
934 | +/* | |
935 | + * mh_settime - help message handler | |
936 | + */ | |
937 | +int mh_settime(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
938 | +{ | |
939 | + if (!IsAnOper(sptr)) | |
940 | + return mh_not_oper(cptr, sptr, parc, parv); | |
941 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
942 | + "SETTIME :SETTIME <timestamp> [<server>]"); | |
943 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
944 | + "SETTIME :Changes the time on a server." | |
945 | + "When parameter <timestamp> is 0 the local server " | |
946 | + "uses its own timestamp before sending it to the remote server."); | |
947 | + return 0; | |
948 | +} | |
949 | + | |
950 | + | |
951 | +/* | |
952 | + * mh_silence - help message handler | |
953 | + * TODO: mention ~ exempt mask prefix | |
954 | + */ | |
955 | +int mh_silence(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
956 | +{ | |
957 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
958 | + "SILENCE :SILENCE [[+|-]<mask>|<nick>]"); | |
959 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
960 | + "SILENCE :Views or changes the silence list."); | |
961 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
962 | + "SILENCE :Parameter <mask> is a comma separated list of one or more masks."); | |
963 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
964 | + "SILENCE :Silence is a server side ignore -" | |
965 | + " any message sent privately or invites from a user matching a silence mask is dropped."); | |
966 | + return 0; | |
967 | +} | |
968 | + | |
969 | + | |
970 | +/* | |
971 | + * mh_squit - help message handler | |
972 | + */ | |
973 | +int mh_squit(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
974 | +{ | |
975 | + if (!IsAnOper(sptr)) | |
976 | + return mh_not_oper(cptr, sptr, parc, parv); | |
977 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
978 | + "SQUIT :SQUIT <server> [:<reason>]"); | |
979 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
980 | + "SQUIT :Disconnects a server from the network."); | |
981 | + return 0; | |
982 | +} | |
983 | + | |
984 | + | |
985 | +/* | |
986 | + * mh_stats - help message handler | |
987 | + * TODO: check HIS (too many per stats type) / HIS remote? | |
988 | + */ | |
989 | +int mh_stats(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
990 | +{ | |
991 | + if (!IsAnOper(sptr)) | |
992 | + return mh_not_oper(cptr, sptr, parc, parv); | |
993 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
994 | + "STATS :STATS [<type> [[<server>] [<mask>]]]"); | |
995 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
996 | + "STATS :Shows server configuration and statistics."); | |
997 | + return 0; | |
998 | +} | |
999 | + | |
1000 | + | |
1001 | +/* | |
1002 | + * mh_time - help message handler | |
1003 | + * TODO: check HIS remote feature | |
1004 | + */ | |
1005 | +int mh_time(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
1006 | +{ | |
1007 | + if (!IsAnOper(sptr)) { | |
1008 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1009 | + "TIME :TIME"); | |
1010 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1011 | + "TIME :Shows the time on the server."); | |
1012 | + } | |
1013 | + else { | |
1014 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1015 | + "TIME :TIME [<server>]"); | |
1016 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1017 | + "TIME :Shows the time on the server."); | |
1018 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1019 | + "TIME :Parameter <server> can be a * to view the time from all servers."); | |
1020 | + } | |
1021 | + | |
1022 | + return 0; | |
1023 | +} | |
1024 | + | |
1025 | + | |
1026 | +/* | |
1027 | + * mh_topic - help message handler | |
1028 | + */ | |
1029 | +int mh_topic(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
1030 | +{ | |
1031 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1032 | + "TOPIC :TOPIC <channel> [:<text>]"); | |
1033 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1034 | + "TOPIC :Views or changes the topic on a channel."); | |
1035 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1036 | + "TOPIC :Parameter <channel> is a comma separated list of one or more channels."); | |
1037 | + return 0; | |
1038 | +} | |
1039 | + | |
1040 | + | |
1041 | +/* | |
1042 | + * mh_trace - help message handler | |
1043 | + * TODO: check HIS / HIS remote? | |
1044 | + * TODO: check <to server> parameter | |
1045 | + */ | |
1046 | +int mh_trace(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
1047 | +{ | |
1048 | + if (!IsAnOper(sptr)) | |
1049 | + return mh_not_oper(cptr, sptr, parc, parv); | |
1050 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1051 | + "TRACE :TRACE [<nick>|<server> <to server>]"); | |
1052 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1053 | + "TRACE :Shows the route to a user or server."); | |
1054 | + return 0; | |
1055 | +} | |
1056 | + | |
1057 | + | |
1058 | +/* | |
1059 | + * mh_uping - help message handler | |
1060 | + * TODO: default port 7007, define UDP_PORT | |
1061 | + */ | |
1062 | +int mh_uping(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
1063 | +{ | |
1064 | + if (!IsAnOper(sptr)) | |
1065 | + return mh_not_oper(cptr, sptr, parc, parv); | |
1066 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1067 | + "UPING :UPING <server> [<port>] [<remote server>] [<number of packets>]"); | |
1068 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1069 | + "UPING :Pings the host of the server with UDP packets - server does not have to be linked."); | |
1070 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1071 | + "UPING :By default port 7007 is used, and 5 packets are sent (maximum is 20)."); | |
1072 | + return 0; | |
1073 | +} | |
1074 | + | |
1075 | + | |
1076 | +/* | |
1077 | + * mh_user - help message handler | |
1078 | + */ | |
1079 | +int mh_user(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
1080 | +{ | |
1081 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1082 | + "USER :USER <username> <hostname> <servername> :<realname>"); | |
1083 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1084 | + "USER :Registers a new client connection. Parameters <hostname> and <servername> are ignored."); | |
1085 | + return 0; | |
1086 | +} | |
1087 | + | |
1088 | + | |
1089 | +/* | |
1090 | + * mh_userhost - help message handler | |
1091 | + * TODO: syntax clear? | |
1092 | + * TODO: max 5 | |
1093 | + */ | |
1094 | +int mh_userhost(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
1095 | +{ | |
1096 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1097 | + "USERHOST :USERHOST <nick> [<nick> [..]]"); | |
1098 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1099 | + "USERHOST :Returns the user@host for a user."); | |
1100 | + return 0; | |
1101 | +} | |
1102 | + | |
1103 | + | |
1104 | +/* | |
1105 | + * mh_userip - help message handler | |
1106 | + * TODO: syntax clear? | |
1107 | + * TODO: max 5 | |
1108 | + */ | |
1109 | +int mh_userip(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
1110 | +{ | |
1111 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1112 | + "USERIP :USERIP <nick> [<nick> [..]]"); | |
1113 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1114 | + "USERIP :Returns the user@ip for a user."); | |
1115 | + return 0; | |
1116 | +} | |
1117 | + | |
1118 | + | |
1119 | +/* | |
1120 | + * mh_version - help message handler | |
1121 | + * TODO: check HIS remote feature | |
1122 | + */ | |
1123 | +int mh_version(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
1124 | +{ | |
1125 | + if (!IsAnOper(sptr)) { | |
1126 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1127 | + "VERSION :VERSION"); | |
1128 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1129 | + "VERSION :Shows information about the server, and the supported features and settings."); | |
1130 | + } | |
1131 | + else { | |
1132 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1133 | + "VERSION :VERSION [<server>]"); | |
1134 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1135 | + "VERSION :Shows information about the server, and the supported features and settings."); | |
1136 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1137 | + "VERSION :Parameter <server> can be a * to view the version info from all servers."); | |
1138 | + } | |
1139 | + return 0; | |
1140 | +} | |
1141 | + | |
1142 | + | |
1143 | +/* | |
1144 | + * mh_wallchops - help message handler | |
1145 | + * TODO: mention NOTICE @#channel? | |
1146 | + */ | |
1147 | +int mh_wallchops(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
1148 | +{ | |
1149 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1150 | + "WALLCHOPS :WALLCHOPS <channel> :<message>"); | |
1151 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1152 | + "WALLCHOPS :Sends a channel notice to the operators on a channel."); | |
1153 | + return 0; | |
1154 | +} | |
1155 | + | |
1156 | + | |
1157 | +/* | |
1158 | + * mh_wallops - help message handler | |
1159 | + * TODO: check HIS ? | |
1160 | + */ | |
1161 | +int mh_wallops(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
1162 | +{ | |
1163 | + if (!IsAnOper(sptr)) | |
1164 | + return mh_not_oper(cptr, sptr, parc, parv); | |
1165 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1166 | + "WALLOPS :WALLOPS :<message>"); | |
1167 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1168 | + "WALLOPS :Sends a message to all IRC Operators with usermode +w set."); | |
1169 | + return 0; | |
1170 | +} | |
1171 | + | |
1172 | + | |
1173 | +/* | |
1174 | + * mh_wallusers - help message handler | |
1175 | + */ | |
1176 | +int mh_wallusers(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
1177 | +{ | |
1178 | + if (!IsAnOper(sptr)) | |
1179 | + return mh_not_oper(cptr, sptr, parc, parv); | |
1180 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1181 | + "WALLUSERS :WALLUSERS :<message>"); | |
1182 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1183 | + "WALLUSERS :Sends a message to all users with usermode +w set."); | |
1184 | + return 0; | |
1185 | +} | |
1186 | + | |
1187 | + | |
1188 | +/* | |
1189 | + * mh_wallvoices - help message handler | |
1190 | + */ | |
1191 | +int mh_wallvoices(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
1192 | +{ | |
1193 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1194 | + "WALLVOICES :WALLVOICES <channel> :<message>"); | |
1195 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1196 | + "WALLVOICES :Sends a channel notice to the voices and operators on a channel."); | |
1197 | + return 0; | |
1198 | +} | |
1199 | + | |
1200 | + | |
1201 | +/* | |
1202 | + * mh_who - help message handler | |
1203 | + * TODO: this is all way too much to add here.. :( | |
1204 | + * TODO: mention <mask> - chan, nick, user, host, ip, server, realname | |
1205 | + * TODO: filter | |
1206 | +d Join-delayed channel members | |
1207 | +o IRC Operator (specifying this one means only opers are matched) | |
1208 | + | |
1209 | + * TODO: x for operators | |
1210 | + | |
1211 | + * TODO: match | |
1212 | +n Nick, u Username, h Hostname, i Numeric IP, | |
1213 | +s Servername, r Realname, a Account name | |
1214 | + | |
1215 | + | |
1216 | + * TODO: return | |
1217 | +t Include the querytype in the reply | |
1218 | +c Include (first) channel name (* when none can be shown) | |
1219 | +u Include userID with eventual ~ | |
1220 | +i Include IP | |
1221 | +h Include hostname | |
1222 | +s Include server name | |
1223 | +n Include nick | |
1224 | +f Include flags | |
1225 | +d Include "distance" in hops | |
1226 | +l Include idle time (0 for remote users) | |
1227 | +a Include account name (0 when the user has no account set) | |
1228 | +o Include oplevel | |
1229 | +r Include real name | |
1230 | +b Include account ID | |
1231 | + | |
1232 | + * TODO: HIS settings | |
1233 | + */ | |
1234 | +int mh_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
1235 | +{ | |
1236 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1237 | + "WHO :WHO <mask> [[<match>][%<fields>[,<querytype>]] [:<mask>]]"); | |
1238 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1239 | + "WHO :Returns information on a user."); | |
1240 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1241 | + "WHO :Parameter <mask> can be a comma separated list of one or more nicks and channels."); | |
1242 | + return 0; | |
1243 | +} | |
1244 | + | |
1245 | + | |
1246 | +/* | |
1247 | + * mh_whois - help message handler | |
1248 | + * TODO: check HIS / HIS remote | |
1249 | + */ | |
1250 | +int mh_whois(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
1251 | +{ | |
1252 | + if (!IsAnOper(sptr)) { | |
1253 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1254 | + "WHOIS :WHOIS [<dummy>] <nick>"); | |
1255 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1256 | + "WHOIS :Shows who someone is."); | |
1257 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1258 | + "WHOIS :Parameter <nick> is a comma separated list of one or more nicks," | |
1259 | + " <dummy> can be specified to get a reply from the user's server to show idle and signon time"); | |
1260 | + } | |
1261 | + else { | |
1262 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1263 | + "WHOIS :WHOIS [<server>] <nick>"); | |
1264 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1265 | + "WHOIS :Shows who someone is."); | |
1266 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1267 | + "WHOIS :Parameter <nick> is a comma separated list of one or more nicks," | |
1268 | + " the same nick can be specified as <server> to get a reply from the user's server to show idle and signon time"); | |
1269 | + } | |
1270 | + return 0; | |
1271 | +} | |
1272 | + | |
1273 | + | |
1274 | +/* | |
1275 | + * mh_whowas - help message handler | |
1276 | + * TODO: check HIS / HIS remote | |
1277 | + * TODO: see if 20 is a define | |
1278 | + */ | |
1279 | +int mh_whowas(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) | |
1280 | +{ | |
1281 | + if (!IsAnOper(sptr)) { | |
1282 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1283 | + "WHOWAS :WHOWAS <nick> [<max>]"); | |
1284 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1285 | + "WHOWAS :Shows who someone was."); | |
1286 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1287 | + "WHOWAS :Parameter <nick> is a comma separated list of one or more nicks," | |
1288 | + " <max> is 0 by default (unlimited)."); | |
1289 | + } | |
1290 | + else { | |
1291 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1292 | + "WHOWAS :WHOIS <nick> [<max> [<server>]]"); | |
1293 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1294 | + "WHOWAS :Shows who someone was."); | |
1295 | + send_reply(sptr, SND_EXPLICIT | RPL_HELP, | |
1296 | + "WHOWAS :Parameter <nick> is a comma separated list of one or more nicks," | |
1297 | + " <max> is 0 by default (unlimited)," | |
1298 | + " maximum number of results from a remote server is 20."); | |
1299 | + } | |
1300 | + return 0; | |
1301 | +} | |
1302 | \ No newline at end of file | |
1303 | diff -r 7fa4708bac45 ircd/parse.c | |
1304 | --- a/ircd/parse.c Sun Jan 25 12:48:01 2009 +0100 | |
1305 | +++ b/ircd/parse.c Sun Jan 25 23:52:18 2009 +0100 | |
1306 | @@ -110,534 +110,534 @@ | |
12e82c05 | 1307 | MSG_PRIVATE, |
cddf800b | 1308 | TOK_PRIVATE, |
1309 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1310 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1311 | - { m_unregistered, m_privmsg, ms_privmsg, mo_privmsg, m_ignore } | |
1312 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1313 | + { m_unregistered, m_privmsg, ms_privmsg, mo_privmsg, m_ignore, mh_privmsg } | |
1314 | }, | |
1315 | { | |
1316 | MSG_NICK, | |
1317 | TOK_NICK, | |
1318 | 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL, | |
1319 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1320 | - { m_nick, m_nick, ms_nick, m_nick, m_ignore } | |
1321 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1322 | + { m_nick, m_nick, ms_nick, m_nick, m_ignore, mh_nick } | |
1323 | }, | |
1324 | { | |
1325 | MSG_NOTICE, | |
1326 | TOK_NOTICE, | |
1327 | 0, MAXPARA, MFLG_SLOW | MFLG_IGNORE, 0, NULL, | |
1328 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1329 | - { m_ignore, m_notice, ms_notice, mo_notice, m_ignore } | |
1330 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1331 | + { m_ignore, m_notice, ms_notice, mo_notice, m_ignore, mh_notice } | |
1332 | }, | |
1333 | { | |
1334 | MSG_WALLCHOPS, | |
1335 | TOK_WALLCHOPS, | |
1336 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1337 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1338 | - { m_unregistered, m_wallchops, ms_wallchops, m_wallchops, m_ignore } | |
1339 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1340 | + { m_unregistered, m_wallchops, ms_wallchops, m_wallchops, m_ignore, mh_wallchops } | |
1341 | }, | |
1342 | { | |
1343 | MSG_WALLVOICES, | |
1344 | TOK_WALLVOICES, | |
1345 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1346 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1347 | - { m_unregistered, m_wallvoices, ms_wallvoices, m_wallvoices, m_ignore } | |
1348 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1349 | + { m_unregistered, m_wallvoices, ms_wallvoices, m_wallvoices, m_ignore, mh_wallvoices } | |
1350 | }, | |
1351 | { | |
1352 | MSG_CPRIVMSG, | |
1353 | TOK_CPRIVMSG, | |
1354 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1355 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1356 | - { m_unregistered, m_cprivmsg, m_ignore, m_cprivmsg, m_ignore } | |
1357 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1358 | + { m_unregistered, m_cprivmsg, m_ignore, m_cprivmsg, m_ignore, mh_cprivmsg } | |
1359 | }, | |
1360 | { | |
1361 | MSG_CNOTICE, | |
1362 | TOK_CNOTICE, | |
1363 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1364 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1365 | - { m_unregistered, m_cnotice, m_ignore, m_cnotice, m_ignore } | |
1366 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1367 | + { m_unregistered, m_cnotice, m_ignore, m_cnotice, m_ignore, mh_cnotice } | |
1368 | }, | |
1369 | { | |
1370 | MSG_JOIN, | |
1371 | TOK_JOIN, | |
1372 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1373 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1374 | - { m_unregistered, m_join, ms_join, m_join, m_ignore } | |
1375 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1376 | + { m_unregistered, m_join, ms_join, m_join, m_ignore, mh_join } | |
1377 | }, | |
1378 | { | |
1379 | MSG_MODE, | |
1380 | TOK_MODE, | |
1381 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1382 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1383 | - { m_unregistered, m_mode, ms_mode, m_mode, m_ignore } | |
1384 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1385 | + { m_unregistered, m_mode, ms_mode, m_mode, m_ignore, mh_mode } | |
1386 | }, | |
1387 | { | |
1388 | MSG_BURST, | |
1389 | TOK_BURST, | |
1390 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1391 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1392 | - { m_ignore, m_ignore, ms_burst, m_ignore, m_ignore } | |
1393 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1394 | + { m_ignore, m_ignore, ms_burst, m_ignore, m_ignore, mh_not_server } | |
1395 | }, | |
1396 | { | |
1397 | MSG_CREATE, | |
1398 | TOK_CREATE, | |
1399 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1400 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1401 | - { m_ignore, m_ignore, ms_create, m_ignore, m_ignore } | |
1402 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1403 | + { m_ignore, m_ignore, ms_create, m_ignore, m_ignore, mh_not_server } | |
1404 | }, | |
1405 | { | |
1406 | MSG_DESTRUCT, | |
1407 | TOK_DESTRUCT, | |
1408 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1409 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1410 | - { m_ignore, m_ignore, ms_destruct, m_ignore, m_ignore } | |
1411 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1412 | + { m_ignore, m_ignore, ms_destruct, m_ignore, m_ignore, mh_not_server } | |
1413 | }, | |
1414 | { | |
1415 | MSG_QUIT, | |
1416 | TOK_QUIT, | |
1417 | 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL, | |
1418 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1419 | - { m_quit, m_quit, ms_quit, m_quit, m_ignore } | |
1420 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1421 | + { m_quit, m_quit, ms_quit, m_quit, m_ignore, mh_quit } | |
1422 | }, | |
1423 | { | |
1424 | MSG_PART, | |
1425 | TOK_PART, | |
1426 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1427 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1428 | - { m_unregistered, m_part, ms_part, m_part, m_ignore } | |
1429 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1430 | + { m_unregistered, m_part, ms_part, m_part, m_ignore, mh_part } | |
1431 | }, | |
1432 | { | |
1433 | MSG_TOPIC, | |
1434 | TOK_TOPIC, | |
1435 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1436 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1437 | - { m_unregistered, m_topic, ms_topic, m_topic, m_ignore } | |
1438 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1439 | + { m_unregistered, m_topic, ms_topic, m_topic, m_ignore, mh_topic } | |
1440 | }, | |
1441 | { | |
1442 | MSG_INVITE, | |
1443 | TOK_INVITE, | |
1444 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1445 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1446 | - { m_unregistered, m_invite, ms_invite, m_invite, m_ignore } | |
1447 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1448 | + { m_unregistered, m_invite, ms_invite, m_invite, m_ignore, mh_invite } | |
1449 | }, | |
1450 | { | |
1451 | MSG_KICK, | |
1452 | TOK_KICK, | |
1453 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1454 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1455 | - { m_unregistered, m_kick, ms_kick, m_kick, m_ignore } | |
1456 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1457 | + { m_unregistered, m_kick, ms_kick, m_kick, m_ignore, mh_kick } | |
1458 | }, | |
1459 | { | |
1460 | MSG_WALLOPS, | |
1461 | TOK_WALLOPS, | |
1462 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1463 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1464 | - { m_unregistered, m_not_oper, ms_wallops, mo_wallops, m_ignore } | |
1465 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1466 | + { m_unregistered, m_not_oper, ms_wallops, mo_wallops, m_ignore, mh_wallops } | |
1467 | }, | |
1468 | { | |
1469 | MSG_WALLUSERS, | |
1470 | TOK_WALLUSERS, | |
1471 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1472 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1473 | - { m_unregistered, m_not_oper, ms_wallusers, mo_wallusers, m_ignore } | |
1474 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1475 | + { m_unregistered, m_not_oper, ms_wallusers, mo_wallusers, m_ignore, mh_wallusers } | |
1476 | }, | |
1477 | { | |
1478 | MSG_DESYNCH, | |
1479 | TOK_DESYNCH, | |
1480 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1481 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1482 | - { m_ignore, m_ignore, ms_desynch, m_ignore, m_ignore } | |
1483 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1484 | + { m_ignore, m_ignore, ms_desynch, m_ignore, m_ignore, mh_not_server } | |
1485 | }, | |
1486 | { | |
1487 | MSG_PING, | |
1488 | TOK_PING, | |
1489 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1490 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1491 | - { m_unregistered, m_ping, ms_ping, mo_ping, m_ignore } | |
1492 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1493 | + { m_unregistered, m_ping, ms_ping, mo_ping, m_ignore, mh_ping } | |
1494 | }, | |
1495 | { | |
1496 | MSG_PONG, | |
1497 | TOK_PONG, | |
1498 | 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL, | |
1499 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1500 | - { mr_pong, m_pong, ms_pong, m_pong, m_ignore } | |
1501 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1502 | + { mr_pong, m_pong, ms_pong, m_pong, m_ignore, mh_pong } | |
1503 | }, | |
1504 | { | |
1505 | MSG_ERROR, | |
1506 | TOK_ERROR, | |
1507 | 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL, | |
1508 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1509 | - { mr_error, m_ignore, ms_error, m_ignore, m_ignore } | |
1510 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1511 | + { mr_error, m_ignore, ms_error, m_ignore, m_ignore, mh_not_server } | |
1512 | }, | |
1513 | { | |
1514 | MSG_KILL, | |
1515 | TOK_KILL, | |
1516 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1517 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1518 | - { m_unregistered, m_not_oper, ms_kill, mo_kill, m_ignore } | |
1519 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1520 | + { m_unregistered, m_not_oper, ms_kill, mo_kill, m_ignore, mh_kill } | |
1521 | }, | |
1522 | { | |
1523 | MSG_USER, | |
1524 | TOK_USER, | |
1525 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1526 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1527 | - { m_user, m_registered, m_ignore, m_registered, m_ignore } | |
1528 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1529 | + { m_user, m_registered, m_ignore, m_registered, m_ignore, mh_user } | |
1530 | }, | |
1531 | { | |
1532 | MSG_AWAY, | |
1533 | TOK_AWAY, | |
1534 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1535 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1536 | - { m_unregistered, m_away, ms_away, m_away, m_ignore } | |
1537 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1538 | + { m_unregistered, m_away, ms_away, m_away, m_ignore, mh_away } | |
1539 | }, | |
1540 | { | |
1541 | MSG_ISON, | |
1542 | TOK_ISON, | |
1543 | 0, 1, MFLG_SLOW, 0, NULL, | |
1544 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1545 | - { m_unregistered, m_ison, m_ignore, m_ison, m_ignore } | |
1546 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1547 | + { m_unregistered, m_ison, m_ignore, m_ison, m_ignore, mh_ison } | |
1548 | }, | |
1549 | { | |
1550 | MSG_SERVER, | |
1551 | TOK_SERVER, | |
1552 | 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL, | |
1553 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1554 | - { mr_server, m_registered, ms_server, m_registered, m_ignore } | |
1555 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1556 | + { mr_server, m_registered, ms_server, m_registered, m_ignore, mh_not_server } | |
1557 | }, | |
1558 | { | |
1559 | MSG_SQUIT, | |
1560 | TOK_SQUIT, | |
1561 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1562 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1563 | - { m_unregistered, m_not_oper, ms_squit, mo_squit, m_ignore } | |
1564 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1565 | + { m_unregistered, m_not_oper, ms_squit, mo_squit, m_ignore, mh_squit } | |
1566 | }, | |
1567 | { | |
1568 | MSG_WHOIS, | |
1569 | TOK_WHOIS, | |
1570 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1571 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1572 | - { m_unregistered, m_whois, ms_whois, m_whois, m_ignore } | |
1573 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1574 | + { m_unregistered, m_whois, ms_whois, m_whois, m_ignore, mh_whois } | |
1575 | }, | |
1576 | { | |
1577 | MSG_WHO, | |
1578 | TOK_WHO, | |
1579 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1580 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1581 | - { m_unregistered, m_who, m_ignore, m_who, m_ignore } | |
1582 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1583 | + { m_unregistered, m_who, m_ignore, m_who, m_ignore, mh_who } | |
1584 | }, | |
1585 | { | |
1586 | MSG_WHOWAS, | |
1587 | TOK_WHOWAS, | |
1588 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1589 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1590 | - { m_unregistered, m_whowas, m_whowas, m_whowas, m_ignore } | |
1591 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1592 | + { m_unregistered, m_whowas, m_whowas, m_whowas, m_ignore, mh_whowas } | |
1593 | }, | |
1594 | { | |
1595 | MSG_LIST, | |
1596 | TOK_LIST, | |
1597 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1598 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1599 | - { m_unregistered, m_list, m_ignore, m_list, m_ignore } | |
1600 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1601 | + { m_unregistered, m_list, m_ignore, m_list, m_ignore, mh_list } | |
1602 | }, | |
1603 | { | |
1604 | MSG_NAMES, | |
1605 | TOK_NAMES, | |
1606 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1607 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1608 | - { m_unregistered, m_names, m_names, m_names, m_ignore } | |
1609 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1610 | + { m_unregistered, m_names, m_names, m_names, m_ignore, mh_names } | |
1611 | }, | |
1612 | { | |
1613 | MSG_USERHOST, | |
1614 | TOK_USERHOST, | |
1615 | 0, 1, MFLG_SLOW, 0, NULL, | |
1616 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1617 | - { m_unregistered, m_userhost, m_ignore, m_userhost, m_ignore } | |
1618 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1619 | + { m_unregistered, m_userhost, m_ignore, m_userhost, m_ignore, mh_userhost } | |
1620 | }, | |
1621 | { | |
1622 | MSG_USERIP, | |
1623 | TOK_USERIP, | |
1624 | 0, 1, MFLG_SLOW, 0, NULL, | |
1625 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1626 | - { m_unregistered, m_userip, m_ignore, m_userip, m_ignore } | |
1627 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1628 | + { m_unregistered, m_userip, m_ignore, m_userip, m_ignore, mh_userip } | |
1629 | }, | |
1630 | { | |
1631 | MSG_TRACE, | |
1632 | TOK_TRACE, | |
1633 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1634 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1635 | - { m_unregistered, m_trace, ms_trace, mo_trace, m_ignore } | |
1636 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1637 | + { m_unregistered, m_trace, ms_trace, mo_trace, m_ignore, mh_trace } | |
1638 | }, | |
1639 | { | |
1640 | MSG_PASS, | |
1641 | TOK_PASS, | |
1642 | 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL, | |
1643 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1644 | - { mr_pass, m_registered, m_ignore, m_registered, m_ignore } | |
1645 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1646 | + { mr_pass, m_registered, m_ignore, m_registered, m_ignore, mh_pass } | |
1647 | }, | |
1648 | { | |
1649 | MSG_LUSERS, | |
1650 | TOK_LUSERS, | |
1651 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1652 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1653 | - { m_unregistered, m_lusers, ms_lusers, m_lusers, m_ignore } | |
1654 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1655 | + { m_unregistered, m_lusers, ms_lusers, m_lusers, m_ignore, mh_lusers } | |
1656 | }, | |
1657 | { | |
1658 | MSG_TIME, | |
1659 | TOK_TIME, | |
1660 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1661 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1662 | - { m_unregistered, m_time, m_time, m_time, m_ignore } | |
1663 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1664 | + { m_unregistered, m_time, m_time, m_time, m_ignore, mh_time } | |
1665 | }, | |
1666 | { | |
1667 | MSG_SETTIME, | |
1668 | TOK_SETTIME, | |
1669 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1670 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1671 | - { m_unregistered, m_not_oper, ms_settime, mo_settime, m_ignore } | |
1672 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1673 | + { m_unregistered, m_not_oper, ms_settime, mo_settime, m_ignore, mh_settime } | |
1674 | }, | |
1675 | { | |
1676 | MSG_RPING, | |
1677 | TOK_RPING, | |
1678 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1679 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1680 | - { m_unregistered, m_not_oper, ms_rping, mo_rping, m_ignore } | |
1681 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1682 | + { m_unregistered, m_not_oper, ms_rping, mo_rping, m_ignore, mh_rping } | |
1683 | }, | |
1684 | { | |
1685 | MSG_RPONG, | |
1686 | TOK_RPONG, | |
1687 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1688 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1689 | - { m_unregistered, m_ignore, ms_rpong, m_ignore, m_ignore } | |
1690 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1691 | + { m_unregistered, m_ignore, ms_rpong, m_ignore, m_ignore, mh_not_server } | |
1692 | }, | |
1693 | { | |
1694 | MSG_OPER, | |
1695 | TOK_OPER, | |
1696 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1697 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1698 | - { m_unregistered, m_oper, ms_oper, mo_oper, m_ignore } | |
1699 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1700 | + { m_unregistered, m_oper, ms_oper, mo_oper, m_ignore, mh_oper } | |
1701 | }, | |
1702 | { | |
1703 | MSG_CONNECT, | |
1704 | TOK_CONNECT, | |
1705 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1706 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1707 | - { m_unregistered, m_not_oper, ms_connect, mo_connect, m_ignore } | |
1708 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1709 | + { m_unregistered, m_not_oper, ms_connect, mo_connect, m_ignore, mh_connect } | |
1710 | }, | |
1711 | { | |
1712 | MSG_MAP, | |
1713 | TOK_MAP, | |
1714 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1715 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1716 | - { m_unregistered, m_map, m_ignore, m_map, m_ignore } | |
1717 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1718 | + { m_unregistered, m_map, m_ignore, m_map, m_ignore, mh_map } | |
1719 | }, | |
1720 | { | |
1721 | MSG_VERSION, | |
1722 | TOK_VERSION, | |
1723 | 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL, | |
1724 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1725 | - { m_version, m_version, ms_version, mo_version, m_ignore } | |
1726 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1727 | + { m_version, m_version, ms_version, mo_version, m_ignore, mh_version } | |
1728 | }, | |
1729 | { | |
1730 | MSG_STATS, | |
1731 | TOK_STATS, | |
1732 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1733 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1734 | - { m_unregistered, m_stats, m_stats, m_stats, m_ignore } | |
1735 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1736 | + { m_unregistered, m_stats, m_stats, m_stats, m_ignore, mh_stats } | |
1737 | }, | |
1738 | { | |
1739 | MSG_LINKS, | |
1740 | TOK_LINKS, | |
1741 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1742 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1743 | - { m_unregistered, m_links, ms_links, m_links, m_ignore } | |
1744 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1745 | + { m_unregistered, m_links, ms_links, m_links, m_ignore, mh_links } | |
1746 | }, | |
1747 | { | |
1748 | MSG_ADMIN, | |
1749 | TOK_ADMIN, | |
1750 | 0, MAXPARA, MFLG_SLOW | MFLG_UNREG, 0, NULL, | |
1751 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1752 | - { m_admin, m_admin, ms_admin, mo_admin, m_ignore } | |
1753 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1754 | + { m_admin, m_admin, ms_admin, mo_admin, m_ignore, mh_admin } | |
1755 | }, | |
1756 | { | |
1757 | MSG_HELP, | |
1758 | TOK_HELP, | |
1759 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1760 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1761 | - { m_unregistered, m_help, m_ignore, m_help, m_ignore } | |
1762 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1763 | + { m_unregistered, m_help, m_ignore, m_help, m_ignore, mh_help } | |
1764 | }, | |
1765 | { | |
1766 | MSG_INFO, | |
1767 | TOK_INFO, | |
1768 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1769 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1770 | - { m_unregistered, m_info, ms_info, mo_info, m_ignore } | |
1771 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1772 | + { m_unregistered, m_info, ms_info, mo_info, m_ignore, mh_info } | |
1773 | }, | |
1774 | { | |
1775 | MSG_MOTD, | |
1776 | TOK_MOTD, | |
1777 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1778 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1779 | - { m_unregistered, m_motd, m_motd, m_motd, m_ignore } | |
1780 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1781 | + { m_unregistered, m_motd, m_motd, m_motd, m_ignore, mh_motd } | |
1782 | }, | |
1783 | { | |
1784 | MSG_CLOSE, | |
1785 | TOK_CLOSE, | |
1786 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1787 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1788 | - { m_unregistered, m_not_oper, m_ignore, mo_close, m_ignore } | |
1789 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1790 | + { m_unregistered, m_not_oper, m_ignore, mo_close, m_ignore, mh_close } | |
1791 | }, | |
1792 | { | |
1793 | MSG_SILENCE, | |
1794 | TOK_SILENCE, | |
1795 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1796 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1797 | - { m_unregistered, m_silence, ms_silence, m_silence, m_ignore } | |
1798 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1799 | + { m_unregistered, m_silence, ms_silence, m_silence, m_ignore, mh_silence } | |
1800 | }, | |
1801 | { | |
1802 | MSG_GLINE, | |
1803 | TOK_GLINE, | |
1804 | 0, MAXPARA, 0, 0, NULL, | |
1805 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1806 | - { m_unregistered, m_gline, ms_gline, mo_gline, m_ignore } | |
1807 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1808 | + { m_unregistered, m_gline, ms_gline, mo_gline, m_ignore, mh_gline } | |
1809 | }, | |
1810 | { | |
1811 | MSG_JUPE, | |
1812 | TOK_JUPE, | |
1813 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1814 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1815 | - { m_unregistered, m_not_oper, ms_jupe, mo_jupe, m_ignore } | |
1816 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1817 | + { m_unregistered, m_not_oper, ms_jupe, mo_jupe, m_ignore, mh_jupe } | |
1818 | }, | |
1819 | { | |
1820 | MSG_OPMODE, | |
1821 | TOK_OPMODE, | |
1822 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1823 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1824 | - { m_unregistered, m_not_oper, ms_opmode, mo_opmode, m_ignore } | |
1825 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1826 | + { m_unregistered, m_not_oper, ms_opmode, mo_opmode, m_ignore, mh_opmode } | |
1827 | }, | |
1828 | { | |
1829 | MSG_CLEARMODE, | |
1830 | TOK_CLEARMODE, | |
1831 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1832 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1833 | - { m_unregistered, m_not_oper, ms_clearmode, mo_clearmode, m_ignore } | |
1834 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1835 | + { m_unregistered, m_not_oper, ms_clearmode, mo_clearmode, m_ignore, mh_clearmode } | |
1836 | }, | |
1837 | { | |
1838 | MSG_UPING, | |
1839 | TOK_UPING, | |
1840 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1841 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1842 | - { m_unregistered, m_not_oper, ms_uping, mo_uping, m_ignore } | |
1843 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1844 | + { m_unregistered, m_not_oper, ms_uping, mo_uping, m_ignore, mh_uping } | |
1845 | }, | |
1846 | { | |
1847 | MSG_END_OF_BURST, | |
1848 | TOK_END_OF_BURST, | |
1849 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1850 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1851 | - { m_ignore, m_ignore, ms_end_of_burst, m_ignore, m_ignore } | |
1852 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1853 | + { m_ignore, m_ignore, ms_end_of_burst, m_ignore, m_ignore, mh_not_server } | |
1854 | }, | |
1855 | { | |
1856 | MSG_END_OF_BURST_ACK, | |
1857 | TOK_END_OF_BURST_ACK, | |
1858 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1859 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1860 | - { m_ignore, m_ignore, ms_end_of_burst_ack, m_ignore, m_ignore } | |
1861 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1862 | + { m_ignore, m_ignore, ms_end_of_burst_ack, m_ignore, m_ignore, mh_not_server } | |
1863 | }, | |
1864 | { | |
1865 | MSG_REBURST, | |
1866 | TOK_REBURST, | |
1867 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1868 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1869 | - { m_ignore, m_ignore, ms_reburst, m_ignore, m_ignore } | |
1870 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1871 | + { m_ignore, m_ignore, ms_reburst, m_ignore, m_ignore, mh_not_server } | |
1872 | }, | |
1873 | { | |
1874 | MSG_HASH, | |
1875 | TOK_HASH, | |
1876 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1877 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1878 | - { m_unregistered, m_not_oper, m_hash, m_hash, m_ignore } | |
1879 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1880 | + { m_unregistered, m_not_oper, m_hash, m_hash, m_ignore, mh_hash } | |
1881 | }, | |
1882 | { | |
1883 | MSG_REHASH, | |
1884 | TOK_REHASH, | |
1885 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1886 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1887 | - { m_unregistered, m_not_oper, m_ignore, mo_rehash, m_ignore } | |
1888 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1889 | + { m_unregistered, m_not_oper, m_ignore, mo_rehash, m_ignore, mh_rehash } | |
1890 | }, | |
1891 | { | |
1892 | MSG_RESTART, | |
1893 | TOK_RESTART, | |
1894 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1895 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1896 | - { m_unregistered, m_not_oper, m_ignore, mo_restart, m_ignore } | |
1897 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1898 | + { m_unregistered, m_not_oper, m_ignore, mo_restart, m_ignore, mh_restart } | |
1899 | }, | |
1900 | { | |
1901 | MSG_DIE, | |
1902 | TOK_DIE, | |
1903 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1904 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1905 | - { m_unregistered, m_not_oper, m_ignore, mo_die, m_ignore } | |
1906 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1907 | + { m_unregistered, m_not_oper, m_ignore, mo_die, m_ignore, mh_die } | |
1908 | }, | |
1909 | { | |
1910 | MSG_PROTO, | |
1911 | TOK_PROTO, | |
1912 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1913 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1914 | - { m_proto, m_proto, m_proto, m_proto, m_ignore } | |
1915 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1916 | + { m_proto, m_proto, m_proto, m_proto, m_ignore, mh_nohelp } | |
1917 | }, | |
1918 | { | |
1919 | MSG_SET, | |
1920 | TOK_SET, | |
1921 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1922 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1923 | - { m_unregistered, m_not_oper, m_ignore, mo_set, m_ignore } | |
1924 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1925 | + { m_unregistered, m_not_oper, m_ignore, mo_set, m_ignore, mh_set } | |
1926 | }, | |
1927 | { | |
1928 | MSG_RESET, | |
1929 | TOK_RESET, | |
1930 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1931 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1932 | - { m_unregistered, m_not_oper, m_ignore, mo_reset, m_ignore } | |
1933 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1934 | + { m_unregistered, m_not_oper, m_ignore, mo_reset, m_ignore, mh_reset } | |
1935 | }, | |
1936 | { | |
1937 | MSG_GET, | |
1938 | TOK_GET, | |
1939 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1940 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1941 | - { m_unregistered, m_not_oper, m_ignore, mo_get, m_ignore } | |
1942 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1943 | + { m_unregistered, m_not_oper, m_ignore, mo_get, m_ignore, mh_get } | |
1944 | }, | |
1945 | { | |
1946 | MSG_PRIVS, | |
1947 | TOK_PRIVS, | |
1948 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1949 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1950 | - { m_unregistered, m_not_oper, ms_privs, mo_privs, m_ignore } | |
1951 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1952 | + { m_unregistered, m_not_oper, ms_privs, mo_privs, m_ignore, mh_privs } | |
1953 | }, | |
1954 | { | |
1955 | MSG_ACCOUNT, | |
1956 | TOK_ACCOUNT, | |
1957 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1958 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1959 | - { m_ignore, m_ignore, ms_account, m_ignore, m_ignore } | |
1960 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1961 | + { m_ignore, m_ignore, ms_account, m_ignore, m_ignore, mh_not_server } | |
1962 | }, | |
1963 | { | |
1964 | MSG_ASLL, | |
1965 | TOK_ASLL, | |
1966 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1967 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1968 | - { m_ignore, m_not_oper, ms_asll, mo_asll, m_ignore } | |
1969 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1970 | + { m_ignore, m_not_oper, ms_asll, mo_asll, m_ignore, mh_asll } | |
1971 | }, | |
1972 | { | |
1973 | MSG_SETHOST, | |
1974 | TOK_SETHOST, | |
1975 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1976 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1977 | - { m_unregistered, m_sethost, ms_sethost, m_sethost, m_ignore } | |
1978 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1979 | + { m_unregistered, m_sethost, ms_sethost, m_sethost, m_ignore, mh_sethost } | |
1980 | }, | |
1981 | #if WE_HAVE_A_REAL_CAPABILITY_NOW | |
1982 | { | |
1983 | MSG_CAP, | |
1984 | TOK_CAP, | |
1985 | 0, MAXPARA, 0, 0, NULL, | |
1986 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
1987 | - { m_cap, m_cap, m_ignore, m_cap, m_ignore } | |
1988 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
1989 | + { m_cap, m_cap, m_ignore, m_cap, m_ignore, mh_nohelp } | |
1990 | }, | |
1991 | #endif | |
1992 | ||
1993 | @@ -654,7 +654,7 @@ | |
1994 | MSG_CHECK, | |
1995 | TOK_CHECK, | |
1996 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
1997 | - { m_unregistered, m_not_oper, m_check, m_check, m_ignore } | |
1998 | + { m_unregistered, m_not_oper, m_check, m_check, m_ignore, mh_check } | |
1999 | }, | |
2000 | ||
2001 | /* | |
2002 | @@ -664,8 +664,8 @@ | |
2003 | MSG_OPKICK, | |
2004 | TOK_OPKICK, | |
2005 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
2006 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
2007 | - { m_unregistered, m_not_oper, ms_opkick, mo_opkick, m_ignore } | |
2008 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
2009 | + { m_unregistered, m_not_oper, ms_opkick, mo_opkick, m_ignore, mh_nohelp } | |
2010 | }, | |
2011 | ||
2012 | /* This command is an alias for QUIT during the unregistered part of | |
2013 | @@ -678,8 +678,8 @@ | |
2014 | MSG_POST, | |
2015 | TOK_POST, | |
2016 | 0, MAXPARA, MFLG_SLOW, 0, NULL, | |
2017 | - /* UNREG, CLIENT, SERVER, OPER, SERVICE */ | |
2018 | - { m_quit, m_ignore, m_ignore, m_ignore, m_ignore } | |
2019 | + /* UNREG, CLIENT, SERVER, OPER, SERVICE, HELP */ | |
2020 | + { m_quit, m_ignore, m_ignore, m_ignore, m_ignore, mh_nohelp } | |
2021 | }, | |
2022 | { 0 } | |
2023 | }; | |
2024 | @@ -779,6 +779,14 @@ | |
2025 | return NULL; | |
2026 | } | |
2027 | ||
2028 | +/** Look up a command in the message trie. | |
2029 | + * @param cmd Text of command to look up. | |
2030 | + * @return Pointer to matching message, or NULL if non exists. | |
2031 | + */ | |
2032 | +struct Message *find_message_by_cmd(char *cmd) { | |
2033 | + return msg_tree_parse(cmd, &msg_tree); | |
2034 | +} | |
2035 | + | |
2036 | /** Registers a service mapping to the pseudocommand handler. | |
2037 | * @param[in] map Service mapping to add. | |
2038 | * @return Non-zero on success; zero if a command already used the name. | |
2039 | @@ -806,6 +814,7 @@ | |
2040 | msg->handlers[SERVER_HANDLER] = m_ignore; | |
2041 | msg->handlers[OPER_HANDLER] = m_pseudo; | |
2042 | msg->handlers[SERVICE_HANDLER] = m_ignore; | |
2043 | + msg->handlers[HELP_HANDLER] = mh_nohelp; | |
2044 | ||
2045 | add_msg_element(&msg_tree, msg, msg->cmd); | |
2046 | map->msg = msg; | |
2047 | diff -r 7fa4708bac45 ircd/s_err.c | |
2048 | --- a/ircd/s_err.c Sun Jan 25 12:48:01 2009 +0100 | |
2049 | +++ b/ircd/s_err.c Sun Jan 25 23:52:18 2009 +0100 | |
2050 | @@ -1230,6 +1230,16 @@ | |
2051 | /* 598 */ | |
2052 | { 0 }, | |
2053 | /* 599 */ | |
2054 | + { 0 }, | |
2055 | +/* 600 */ | |
2056 | + { 0 }, | |
2057 | +/* 601 */ | |
2058 | + { RPL_HELP, 0, "601" }, | |
2059 | +/* 602 */ | |
2060 | + { RPL_ENDOFHELP, "%s :End of /HELP report.", "602" }, | |
2061 | +/* 603 */ | |
2062 | + { ERR_NOHELP, "%s :No help found.", "603" }, | |
2063 | +/* 604 */ | |
2064 | { 0 } | |
2065 | }; | |
2066 |