diff options
| author | trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2005-02-14 06:01:38 +0000 |
|---|---|---|
| committer | trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2005-02-14 06:01:38 +0000 |
| commit | 59f3a38ffd13b9fa2d31b89efa7558f4919c810b (patch) | |
| tree | 1431c63a2ebccbacb4b6f41e7716498a9e4cd970 /src/modules | |
| parent | f19412921768cfadec42215e538588108d3c8b40 (diff) | |
BUILD : 1.7.8 (574) BUGS : N/A NOTES : Internal Events, Win32 can build with encryption, nickIsServices() works if format is nick@services
git-svn-id: svn://svn.anope.org/anope/trunk@574 31f1291d-b8d6-0310-a050-a5561fc1590b
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@424 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/events.c | 53 | ||||
| -rw-r--r-- | src/modules/makefile.inc.win32 | 2 |
2 files changed, 54 insertions, 1 deletions
diff --git a/src/modules/events.c b/src/modules/events.c new file mode 100644 index 000000000..af53a3d40 --- /dev/null +++ b/src/modules/events.c @@ -0,0 +1,53 @@ +/** + * Simple module to show the usage of event messages and hooks + * This module is an example, and has no useful purpose! + * + * Please visit http://modules.anope.org for useful modules! + * + **/ + +#include "module.h" + +#define AUTHOR "Anope" +#define VERSION "1.1" + +int my_nick(char *source, int ac, char **av); +int my_save(char *message); + +int AnopeInit(int argc, char **argv) +{ + EvtMessage *msg = NULL; + EvtHook *hook = NULL; + int status; + msg = createEventHandler("NICK", my_nick); + status = moduleAddEventHandler(msg); + + hook = createEventHook(EVENT_DB_SAVING, my_save); + status = moduleAddEventHook(hook); + + moduleAddAuthor(AUTHOR); + moduleAddVersion(VERSION); + return MOD_CONT; +} + +void AnopeFini(void) +{ + /* unloading */ +} + +int my_nick(char *source, int ac, char **av) +{ + alog("Internal Event - nick is %s",av[0]); + return MOD_CONT; +} + +int my_save(char *message) +{ + if (!stricmp(message, EVENT_START)) { + alog("Saving the databases! has started"); + } else { + alog("Saving the databases is complete"); + } + return MOD_CONT; +} + diff --git a/src/modules/makefile.inc.win32 b/src/modules/makefile.inc.win32 index 95c0c84b1..f97acfd3d 100644 --- a/src/modules/makefile.inc.win32 +++ b/src/modules/makefile.inc.win32 @@ -1,2 +1,2 @@ -SRCS=hs_moo.c ircd_catserv.c +SRCS=hs_moo.c ircd_catserv.c events.c |
