diff options
author | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-02-25 07:12:17 +0000 |
---|---|---|
committer | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-02-25 07:12:17 +0000 |
commit | 9edede4f3a594bb4dd3f028a8dc11d4a177d90fd (patch) | |
tree | cc5671ecf72d549723d633af530b331e4c9046e9 /src | |
parent | 235c4ae95c1cf467ec47514c2226df675494c12c (diff) |
Removed OnBotPreLoad event, this is a much better way to prevent multiple of the same bots being loaded
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2796 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r-- | src/bots.cpp | 2 | ||||
-rw-r--r-- | src/core/db_plain.cpp | 4 | ||||
-rw-r--r-- | src/core/ss_main.c | 11 |
3 files changed, 3 insertions, 14 deletions
diff --git a/src/bots.cpp b/src/bots.cpp index 6e97d4aa2..e9b72f3e8 100644 --- a/src/bots.cpp +++ b/src/bots.cpp @@ -60,8 +60,6 @@ BotInfo::BotInfo(const std::string &nnick, const std::string &nuser, const std:: this->SetFlag(BI_GLOBAL); } - FOREACH_MOD(I_OnBotPreLoad, OnBotPreLoad(this)); - insert_bot(this); // XXX, this is ugly, but it needs to stay until hashing of bots is redone in STL. // If we're synchronised with the uplink already, call introduce_user() for this bot. diff --git a/src/core/db_plain.cpp b/src/core/db_plain.cpp index 039f19674..c1c9cdae5 100644 --- a/src/core/db_plain.cpp +++ b/src/core/db_plain.cpp @@ -420,7 +420,9 @@ static void LoadNickAlias(const std::vector<std::string> ¶ms) static void LoadBotInfo(const std::vector<std::string> ¶ms) { - BotInfo *bi = new BotInfo(params[0].c_str()); + BotInfo *bi = findbot(params[0]); + if (!bi) + bi = new BotInfo(params[0]); bi->user = sstrdup(params[1].c_str()); bi->host = sstrdup(params[2].c_str()); bi->created = strtol(params[4].c_str(), NULL, 10); diff --git a/src/core/ss_main.c b/src/core/ss_main.c index 8ff8080b9..6405c8858 100644 --- a/src/core/ss_main.c +++ b/src/core/ss_main.c @@ -42,7 +42,6 @@ class SSMain : public Module this->SetPermanent(true); this->AddCommand(cmdTable, new CommandSSHelp()); - ModuleManager::Attach(I_OnBotPreLoad, this); statserv = findbot("StatServ"); if (!statserv) @@ -72,16 +71,6 @@ class SSMain : public Module delete statserv; } } - - void OnBotPreLoad(BotInfo *bi) - { - if (bi->nick == "StatServ") - { - delete statserv; - statserv = bi; - statserv->cmdTable = cmdTable; - } - } }; MODULE_INIT(SSMain) |