Debian Codegraph @

modules/rpgserv/help.c

raw
1 /* main.c - rpgserv main() routine.
2 * based on elly's rpgserv for atheme-6.x --nenolod
3 */
4
5 #include "atheme.h"
6
7 DECLARE_MODULE_V1
8 (
9 "rpgserv/help", false, _modinit, _moddeinit,
10 PACKAGE_STRING,
11 VENDOR_STRING
12 );
13
14 static void rs_cmd_help(sourceinfo_t *si, int parc, char *parv[]);
15
16 command_t rs_help = { "HELP", N_("Displays contextual help information."),
17 AC_NONE, 2, rs_cmd_help, { .path = "help" } };
18
19 static void rs_cmd_help(sourceinfo_t *si, int parc, char *parv[])
20 {
21 char *command = parv[0];
22 if (!command)
23 {
24 command_success_nodata(si, _("***** \2%s Help\2 *****"), si->service->nick);
25 command_success_nodata(si, _("\2%s\2 allows users to search for game channels by matching on properties."), si->service->nick);
26 command_success_nodata(si, " ");
27 command_success_nodata(si, _("For more information on a command, type:"));
28 command_success_nodata(si, "\2/%s%s help <command>\2", (ircd->uses_rcommand == false) ? "msg " : "", si->service->disp);
29 command_success_nodata(si, " ");
30 command_help(si, si->service->commands);
31 command_success_nodata(si, _("***** \2End of Help\2 *****"));
32 return;
33 }
34
35 help_display(si, si->service, command, si->service->commands);
36 }
37
38 void _modinit(module_t *m)
39 {
40 service_named_bind_command("rpgserv", &rs_help);
41 }
42
43 void _moddeinit(module_unload_intent_t intent)
44 {
45 service_named_unbind_command("rpgserv", &rs_help);
46 }