From ccb8c76295f95e0c8b6b2fd23e8007fa18cf4641 Mon Sep 17 00:00:00 2001 From: cyberbotx Date: Sat, 29 Nov 2008 04:11:25 +0000 Subject: [PATCH] Added ss_main.c, a small sample showing how to create a pseudo-client from a module, will soon become StatServ though. git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1817 5417fbe8-f217-4b02-8779-1006273d7864 --- src/core/ss_main.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 src/core/ss_main.c diff --git a/src/core/ss_main.c b/src/core/ss_main.c new file mode 100644 index 000000000..04e58b050 --- /dev/null +++ b/src/core/ss_main.c @@ -0,0 +1,45 @@ +/* StatServ core functions + * + * (C) 2003-2008 Anope Team + * Contact us at info@anope.org + * + * Please read COPYING and README for further details. + * + * Based on the original code of Epona by Lara. + * Based on the original code of Services by Andy Church. + * + * $Id$ + * + */ + +#include "module.h" + +class StatServ : public Service +{ + public: + StatServ() : Service("StatServ", ServiceUser, ServiceHost, "Stats Service") + { + } +} *statserv = NULL; + +int statserv_create(int argc, char **argv); + +class SSMain : public Module +{ + public: + SSMain(const std::string &modname, const std::string &creator) : Module(modname, creator) + { + EvtHook *hook; + + hook = createEventHook(EVENT_SERVER_CONNECT, statserv_create); + this->AddEventHook(hook); + } +}; + +int statserv_create(int argc, char **argv) +{ + statserv = new StatServ(); + return MOD_CONT; +} + +MODULE_INIT("ss_main", SSMain)