int AnopeInit(int argc, char **argv) { Command *c; EvtHook *hook; c = createCommand("request", hs_do_request, nick_identified, -1, -1, -1, -1, -1); moduleAddHelp(c, hs_help_request); moduleAddCommand(HOSTSERV, c, MOD_HEAD); c = createCommand("activate", hs_do_activate, is_host_setter, -1, -1, -1, -1, -1); moduleAddHelp(c, hs_help_activate); moduleAddCommand(HOSTSERV, c, MOD_HEAD); c = createCommand("reject", hs_do_reject, is_host_setter, -1, -1, -1, -1, -1); moduleAddHelp(c, hs_help_reject); moduleAddCommand(HOSTSERV, c, MOD_HEAD); c = createCommand("waiting", hs_do_waiting, is_host_setter, -1, -1, -1, -1, -1); moduleAddHelp(c, hs_help_waiting); moduleAddCommand(HOSTSERV, c, MOD_HEAD); c = createCommand("list", hs_do_list_out, is_services_oper, -1, -1, -1, -1, -1); moduleAddCommand(HOSTSERV, c, MOD_HEAD); hook = createEventHook(EVENT_NICK_DROPPED, hsreqevt_nick_dropped); moduleAddEventHook(hook); hook = createEventHook(EVENT_NICK_EXPIRE, hsreqevt_nick_dropped); moduleAddEventHook(hook); hook = createEventHook(EVENT_DB_SAVING, hsreqevt_db_saving); moduleAddEventHook(hook); hook = createEventHook(EVENT_DB_BACKUP, hsreqevt_db_backup); moduleAddEventHook(hook); moduleSetHostHelp(hs_help); moduleAddAuthor(AUTHOR); moduleAddVersion(VERSION); moduleSetType(SUPPORTED); my_load_config(); my_add_languages(); hs_request_head = NULL; if (debug) alog("[hs_request] Loading database..."); hsreq_load_db(); alog("hs_request loaded"); return MOD_CONT; }
/** * Create the off command, and tell anope about it. * @param argc Argument count * @param argv Argument list * @return MOD_CONT to allow the module, MOD_STOP to stop it **/ int AnopeInit(int argc, char **argv) { Command *c; moduleAddAuthor("Anope"); moduleAddVersion("$Id: hs_setall.c 1265 2007-08-26 15:33:06Z geniusdex $"); moduleSetType(CORE); c = createCommand("SETALL", do_setall, is_host_setter, HOST_HELP_SETALL, -1, -1, -1, -1); moduleAddCommand(HOSTSERV, c, MOD_UNIQUE); moduleSetHostHelp(myHostServHelp); return MOD_CONT; }
/** * Create the off command, and tell anope about it. * @param argc Argument count * @param argv Argument list * @return MOD_CONT to allow the module, MOD_STOP to stop it **/ int AnopeInit(int argc, char **argv) { Command *c; moduleAddAuthor("Anope"); moduleAddVersion("$Id: hs_off.c 953 2006-01-14 11:36:29Z certus $"); moduleSetType(CORE); c = createCommand("OFF", do_off, NULL, HOST_HELP_OFF, -1, -1, -1, -1); moduleAddCommand(HOSTSERV, c, MOD_UNIQUE); moduleSetHostHelp(myHostServHelp); return MOD_CONT; }
/** * Create the off command, and tell anope about it. * @param argc Argument count * @param argv Argument list * @return MOD_CONT to allow the module, MOD_STOP to stop it **/ int AnopeInit(int argc, char **argv) { Command *c; moduleAddAuthor("Anope"); moduleAddVersion("$Id: hs_list.c 1265 2007-08-26 15:33:06Z geniusdex $"); moduleSetType(CORE); c = createCommand("LIST", listOut, is_services_oper, -1, -1, HOST_HELP_LIST, HOST_HELP_LIST, HOST_HELP_LIST); moduleAddCommand(HOSTSERV, c, MOD_UNIQUE); moduleSetHostHelp(myHostServHelp); return MOD_CONT; }
/** * Create the off command, and tell anope about it. * @param argc Argument count * @param argv Argument list * @return MOD_CONT to allow the module, MOD_STOP to stop it **/ int AnopeInit(int argc, char **argv) { Command *c; moduleAddAuthor("Anope"); moduleAddVersion(VERSION_STRING); moduleSetType(CORE); c = createCommand("LIST", listOut, is_services_oper, -1, -1, HOST_HELP_LIST, HOST_HELP_LIST, HOST_HELP_LIST); moduleAddCommand(HOSTSERV, c, MOD_UNIQUE); moduleSetHostHelp(myHostServHelp); return MOD_CONT; }
/** * Create the off command, and tell anope about it. * @param argc Argument count * @param argv Argument list * @return MOD_CONT to allow the module, MOD_STOP to stop it **/ int AnopeInit(int argc, char **argv) { Command *c; moduleAddAuthor("Anope"); moduleAddVersion(VERSION_STRING); moduleSetType(CORE); c = createCommand("SET", myDoSet, is_host_setter, HOST_HELP_SET, -1, -1, -1, -1); moduleAddCommand(HOSTSERV, c, MOD_UNIQUE); moduleSetHostHelp(myHostServHelp); return MOD_CONT; }
/** * Create the off command, and tell anope about it. * @param argc Argument count * @param argv Argument list * @return MOD_CONT to allow the module, MOD_STOP to stop it **/ int AnopeInit(int argc, char **argv) { Command *c; moduleAddAuthor("Anope"); moduleAddVersion(VERSION_STRING); moduleSetType(CORE); c = createCommand("DELALL", do_delall, is_host_remover, HOST_HELP_DELALL, -1, -1, -1, -1); moduleAddCommand(HOSTSERV, c, MOD_UNIQUE); moduleSetHostHelp(myHostServHelp); return MOD_CONT; }
int AnopeInit(int argc, char **argv) /* This will be executed when the module is loaded */ { Command *c; /* Pointer to a Command */ int status = 0; /* the status of our new command */ c = createCommand("moo", hs_moo_show, NULL, -1, -1, -1, -1, -1); /* Create a new command "moo" pointing to hs_moo */ moduleAddHelp(c,myHostServMooHelp); /* add help for all users to this command */ moduleAddRegHelp(c,myHostServMooRegHelp); /* add extra regular-user only help to this command */ moduleAddOperHelp(c,myHostServMooOperHelp); /* add extra oper only help to this command */ moduleAddAdminHelp(c,myHostServMooAdminHelp); /* add extra admin only help to this command */ moduleAddRootHelp(c,myHostServMooRootHelp); /* add extra root only help to this command */ moduleSetHostHelp(myHostServHelp); /* add us to the .hs help list */ status = moduleAddCommand(HOSTSERV, c, MOD_HEAD); /* Add the command to the HOSTSERV cmd table */ /* Check if we have any argv's */ if(argc>0) { /* we do, the first will be the nick of the person modload'ing us */ /* or NULL if we were auto-loaded */ if(argv[0]) { alog("hs_moo was modloaded by: [%s]",argv[0]); } else { alog("hs_moo was automatically loaded by anope"); } } alog("hs_moo.so: Add Command 'moo' Status: %d",status); /* Log the command being added */ moduleAddCallback("test",time(NULL)+dotime("15s"),test,0,NULL); /* set a call-back function to exec in 3 mins time */ moduleDelCallback("test"); moduleAddAuthor(AUTHOR); /* tell Anope about the author */ moduleAddVersion(VERSION); /* Tell Anope about the verison */ if(status!=MOD_ERR_OK) { return MOD_STOP; } return MOD_CONT; }