| 1 |
pippijn |
1.1 |
/* |
| 2 |
|
|
* Copyright © 2005 Atheme Development Group |
| 3 |
pippijn |
1.2 |
* Rights to this code are documented in doc/pod/license.pod. |
| 4 |
pippijn |
1.1 |
* |
| 5 |
|
|
* This file contains routines to handle the MemoServ HELP command. |
| 6 |
|
|
* |
| 7 |
pippijn |
1.2 |
* $Id: help.C,v 1.1 2007-07-19 08:24:53 pippijn Exp $ |
| 8 |
pippijn |
1.1 |
*/ |
| 9 |
|
|
|
| 10 |
|
|
#include "atheme.h" |
| 11 |
|
|
|
| 12 |
|
|
static char const rcsid[] = "$Id"; |
| 13 |
|
|
|
| 14 |
|
|
struct gs_help_listeners : callback::has_listeners |
| 15 |
|
|
{ |
| 16 |
|
|
}; |
| 17 |
|
|
|
| 18 |
|
|
gs_help_listeners listeners; |
| 19 |
|
|
|
| 20 |
pippijn |
1.2 |
DECLARE_MODULE_V1 ("gameserv/help", false, _modinit, _moddeinit, "$Id: help.C,v 1.1 2007-07-19 08:24:53 pippijn Exp $", "The Ermyth Team <http://ermyth.schmorp.de>"); |
| 21 |
pippijn |
1.1 |
|
| 22 |
|
|
cmdvec *gs_cmdtree; |
| 23 |
|
|
helpvec *gs_helptree; |
| 24 |
|
|
|
| 25 |
|
|
static void gs_cmd_help (sourceinfo_t *si, int parc, char *parv[]); |
| 26 |
|
|
|
| 27 |
|
|
command_t gs_help = { "HELP", N_("Displays contextual help information."), AC_NONE, 2, gs_cmd_help }; |
| 28 |
|
|
|
| 29 |
|
|
void |
| 30 |
|
|
_modinit (module_t *m) |
| 31 |
|
|
{ |
| 32 |
|
|
MODULE_USE_SYMBOL_T (gs_cmdtree, cmdvec, "gameserv/main", "gs_cmdtree"); |
| 33 |
|
|
MODULE_USE_SYMBOL_T (gs_helptree, helpvec, "gameserv/main", "gs_helptree"); |
| 34 |
|
|
|
| 35 |
|
|
gs_cmdtree << gs_help; |
| 36 |
|
|
help_addentry (gs_helptree, "HELP", "help/help", NULL); |
| 37 |
|
|
} |
| 38 |
|
|
|
| 39 |
|
|
void |
| 40 |
|
|
_moddeinit () |
| 41 |
|
|
{ |
| 42 |
|
|
gs_cmdtree >> gs_help; |
| 43 |
|
|
help_delentry (gs_helptree, "HELP"); |
| 44 |
|
|
} |
| 45 |
|
|
|
| 46 |
|
|
/* HELP <command> [params] */ |
| 47 |
|
|
void |
| 48 |
|
|
gs_cmd_help (sourceinfo_t *si, int parc, char *parv[]) |
| 49 |
|
|
{ |
| 50 |
|
|
char *command = parv[0]; |
| 51 |
|
|
|
| 52 |
|
|
if (!command) |
| 53 |
|
|
{ |
| 54 |
|
|
command_success_nodata (si, _("***** \2%s Help\2 *****"), gamesvs.nick); |
| 55 |
|
|
command_success_nodata (si, _("\2%s\2 provides games and tools for playing games to the network."), gamesvs.nick); |
| 56 |
|
|
command_success_nodata (si, " "); |
| 57 |
|
|
command_success_nodata (si, _("For more information on a command, type:")); |
| 58 |
|
|
command_success_nodata (si, "\2/%s%s help <command>\2", (ircd->uses_rcommand == false) ? "msg " : "", gamesvs.disp); |
| 59 |
|
|
command_success_nodata (si, " "); |
| 60 |
|
|
|
| 61 |
|
|
command_help (si, gs_cmdtree); |
| 62 |
|
|
|
| 63 |
|
|
command_success_nodata (si, _("***** \2End of Help\2 *****")); |
| 64 |
|
|
return; |
| 65 |
|
|
} |
| 66 |
|
|
|
| 67 |
|
|
/* take the command through the hash table */ |
| 68 |
|
|
help_display (si, command, gs_helptree); |
| 69 |
|
|
} |
| 70 |
|
|
|
| 71 |
|
|
/* vim:cinoptions=>s,e0,n0,f0,{0,}0,^0,=s,ps,t0,c3,+s,(2s,us,)20,*30,gs,hs |
| 72 |
|
|
* vim:ts=8 |
| 73 |
|
|
* vim:sw=8 |
| 74 |
|
|
* vim:noexpandtab |
| 75 |
|
|
*/ |