summaryrefslogtreecommitdiff
path: root/src/core/ss_main.c
diff options
context:
space:
mode:
authorrburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>2009-03-31 14:43:04 +0000
committerrburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>2009-03-31 14:43:04 +0000
commitab9c1e46513ffd2b44fb30fbc0845e7474d1c5fa (patch)
treefc2f0ce02311159a7a6ba566780b9fc0acd35c7b /src/core/ss_main.c
parentfdfc12f398d2524cbc2ce0038e0da8502233070b (diff)
Fix ss_main's client introduction.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2226 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/core/ss_main.c')
-rw-r--r--src/core/ss_main.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/core/ss_main.c b/src/core/ss_main.c
index a0a855dd8..c92ce5211 100644
--- a/src/core/ss_main.c
+++ b/src/core/ss_main.c
@@ -47,12 +47,12 @@ class SSMain : public Module
if (servsock == -1)
{
-// EvtHook *hook = createEventHook(EVENT_SERVER_CONNECT, statserv_create);
-// this->AddEventHook(hook);
+ ModuleManager::Attach(I_OnServerConnect, this);
}
else
statserv_create(0, NULL);
}
+
~SSMain()
{
CommandHash *current;
@@ -71,18 +71,17 @@ class SSMain : public Module
delete statserv;
}
}
-};
-int statserv_create(int argc, char **argv)
-{
- statserv = findbot("StatServ");
- if (!statserv)
+ void OnServerConnect(const std::string &sname)
{
- statserv = new BotInfo("StatServ", ServiceUser, ServiceHost, "Stats Service");
- ircdproto->SendClientIntroduction("StatServ", ServiceUser, ServiceHost, "Stats Service", ircd->pseudoclient_mode, statserv->uid.c_str());
+ statserv = findbot("StatServ");
+ if (!statserv)
+ {
+ statserv = new BotInfo("StatServ", ServiceUser, ServiceHost, "Stats Service");
+ ircdproto->SendClientIntroduction("StatServ", ServiceUser, ServiceHost, "Stats Service", ircd->pseudoclient_mode, statserv->uid.c_str());
+ }
+ statserv->cmdTable = cmdTable;
}
- statserv->cmdTable = cmdTable;
- return MOD_CONT;
-}
+};
MODULE_INIT("ss_main", SSMain)