mirror of
https://github.com/anope/anope.git
synced 2026-06-28 18:36:39 +02:00
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
This commit is contained in:
@@ -602,12 +602,6 @@ class CoreExport Module
|
||||
*/
|
||||
virtual void OnBotBan(User *u, ChannelInfo *ci, const char *mask) { }
|
||||
|
||||
/** Called after a bot has been created, but NOT added to the internal
|
||||
* list and NOT introduced
|
||||
* @param bi The bot
|
||||
*/
|
||||
virtual void OnBotPreLoad(BotInfo *bi) { }
|
||||
|
||||
/** Called before a bot kicks a user
|
||||
* @param bi The bot sending the kick
|
||||
* @param c The channel the user is being kicked on
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user