00001
00009 #include "module.h"
00010
00011 #define AUTHOR "Anope"
00012 #define VERSION "$Id: hs_moo.c 953 2006-01-14 11:36:29Z certus $"
00013
00014 int hs_moo_show(User * u);
00015 int test(int argc, char **argv);
00016 void myHostServHelp(User *u);
00017 int myHostServMooHelp(User *u);
00018 int myHostServMooRegHelp(User *u);
00019 int myHostServMooOperHelp(User *u);
00020 int myHostServMooAdminHelp(User *u);
00021 int myHostServMooRootHelp(User *u);
00022
00023 int AnopeInit(int argc, char **argv)
00024 {
00025 Command *c;
00026 int status = 0;
00027 c = createCommand("moo", hs_moo_show, NULL, -1, -1, -1, -1, -1);
00028
00029 moduleAddHelp(c,myHostServMooHelp);
00030 moduleAddRegHelp(c,myHostServMooRegHelp);
00031 moduleAddOperHelp(c,myHostServMooOperHelp);
00032 moduleAddAdminHelp(c,myHostServMooAdminHelp);
00033 moduleAddRootHelp(c,myHostServMooRootHelp);
00034
00035 moduleSetHostHelp(myHostServHelp);
00036
00037 status = moduleAddCommand(HOSTSERV, c, MOD_HEAD);
00038
00039
00040 if(argc>0) {
00041
00042
00043 if(argv[0]) {
00044 alog("hs_moo was modloaded by: [%s]",argv[0]);
00045 } else {
00046 alog("hs_moo was automatically loaded by anope");
00047 }
00048 }
00049 alog("hs_moo.so: Add Command 'moo' Status: %d",status);
00050
00051 moduleAddCallback("test",time(NULL)+dotime("15s"),test,0,NULL);
00052 moduleDelCallback("test");
00053 moduleAddAuthor(AUTHOR);
00054 moduleAddVersion(VERSION);
00055
00056 if(status!=MOD_ERR_OK) {
00057 return MOD_STOP;
00058 }
00059 return MOD_CONT;
00060 }
00061
00062 int hs_moo_show(User * u)
00063 {
00064 notice(s_HostServ, u->nick, "MOO! - This command was loaded via a module!");
00065 return MOD_STOP;
00066 }
00067
00068 int test(int argc, char **argv) {
00069 alog("CallBack from hs_moo with %d paramaters",argc);
00070 return MOD_CONT;
00071 }
00072
00073 void AnopeFini(void)
00074 {
00075
00076 }
00077
00078
00079
00080
00081
00082 void myHostServHelp(User *u) {
00083 notice(s_HostServ,u->nick, " MOO Moo's at the user!");
00084 }
00085
00086 int myHostServMooHelp(User *u) {
00087 notice(s_HostServ,u->nick,"Syntax: Moo");
00088 notice(s_HostServ,u->nick,"This command is an example provided");
00089 notice(s_HostServ,u->nick,"by the Anope development team.");
00090 return MOD_CONT;
00091 }
00092
00093 int myHostServMooRootHelp(User *u) {
00094 myHostServMooAdminHelp(u);
00095 notice(s_HostServ,u->nick,"Only roots will see this part of the help");
00096 return MOD_CONT;
00097 }
00098
00099 int myHostServMooAdminHelp(User *u) {
00100 myHostServMooOperHelp(u);
00101 notice(s_HostServ,u->nick,"Only admins will see this part of the help");
00102 notice(s_HostServ,u->nick,"why not visit us on www.anope.org ?");
00103 return MOD_CONT;
00104 }
00105
00106 int myHostServMooOperHelp(User *u) {
00107 notice(s_HostServ,u->nick,"Only opers will see this part of the help");
00108 notice(s_HostServ,u->nick,"for more help/support with modules");
00109 notice(s_HostServ,u->nick,"visit us on irc.anope.org #anope! :)");
00110 return MOD_CONT;
00111 }
00112
00113 int myHostServMooRegHelp(User *u) {
00114 notice(s_HostServ,u->nick,"Only non-opers will see this part of the help");
00115 notice(s_HostServ,u->nick,"as we've left it hidden from opers");
00116 return MOD_CONT;
00117 }
00118
00119