diff options
author | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-11-29 04:11:25 +0000 |
---|---|---|
committer | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-11-29 04:11:25 +0000 |
commit | ccb8c76295f95e0c8b6b2fd23e8007fa18cf4641 (patch) | |
tree | df3556cf12926548f27a3ab22151e20c452d4023 | |
parent | f300ac836e41b84689c5d824f62053b493cd6487 (diff) |
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
-rw-r--r-- | src/core/ss_main.c | 45 |
1 files changed, 45 insertions, 0 deletions
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) |