diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bots.cpp | 10 | ||||
-rw-r--r-- | src/core/ss_main.c | 24 |
2 files changed, 16 insertions, 18 deletions
diff --git a/src/bots.cpp b/src/bots.cpp index a6ef20e37..c8afd91fd 100644 --- a/src/bots.cpp +++ b/src/bots.cpp @@ -36,6 +36,11 @@ BotInfo::BotInfo(const char *nnick) this->flags |= BI_NICKSERV; else if (s_GlobalNoticer && !stricmp(s_GlobalNoticer, nnick)) this->flags |= BI_GLOBAL; + + // If we're synchronised with the uplink already, call introduce_user() for this bot. + alog("serv_uplink is %p and status is %d", serv_uplink, serv_uplink ? serv_uplink->sync == SSYNC_DONE : 0); + if (serv_uplink && serv_uplink->sync == SSYNC_DONE) + ircdproto->SendClientIntroduction(this->nick, this->user, this->host, this->real, ircd->pseudoclient_mode, this->uid.c_str()); } BotInfo::BotInfo(const char *nnick, const char *nuser, const char *nhost, const char *nreal) @@ -65,6 +70,11 @@ BotInfo::BotInfo(const char *nnick, const char *nuser, const char *nhost, const this->flags |= BI_NICKSERV; else if (s_GlobalNoticer && !stricmp(s_GlobalNoticer, nnick)) this->flags |= BI_GLOBAL; + + // If we're synchronised with the uplink already, call introduce_user() for this bot. + alog("serv_uplink is %p and status is %d", serv_uplink, serv_uplink ? serv_uplink->sync == SSYNC_DONE : 0); + if (serv_uplink && serv_uplink->sync == SSYNC_DONE) + ircdproto->SendClientIntroduction(this->nick, this->user, this->host, this->real, ircd->pseudoclient_mode, this->uid.c_str()); } BotInfo::~BotInfo() diff --git a/src/core/ss_main.c b/src/core/ss_main.c index 8653c161f..22d2edc1b 100644 --- a/src/core/ss_main.c +++ b/src/core/ss_main.c @@ -17,8 +17,6 @@ BotInfo *statserv = NULL; CommandHash *cmdTable[MAX_CMD_HASH]; -int statserv_create(int argc, char **argv); - class CommandSSHelp : public Command { public: @@ -45,12 +43,14 @@ class SSMain : public Module this->AddCommand(cmdTable, new CommandSSHelp(), MOD_HEAD); - if (servsock == -1) + statserv = findbot("StatServ"); + if (!statserv) { - ModuleManager::Attach(I_OnServerConnect, this); + alog("Creating SS"); + statserv = new BotInfo("StatServ", ServiceUser, ServiceHost, "Stats Service"); } - else - statserv_create(0, NULL); + alog("Done creating SS"); + statserv->cmdTable = cmdTable; } ~SSMain() @@ -71,18 +71,6 @@ class SSMain : public Module delete statserv; } } - - /** This hack is necessary to replace delayed loading, for now */ - void OnServerConnect(Server *) - { - 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; - } }; MODULE_INIT("ss_main", SSMain) |