1
0
mirror of https://github.com/anope/anope.git synced 2026-07-03 12:23:13 +02:00

Rewrote all of the command handling to get rid of all the nasty strtoks() everywhere, and added a bot map by uid

This commit is contained in:
Adam
2010-05-29 20:44:31 -04:00
committed by Adam
parent 435c9116e9
commit b8f9116b19
24 changed files with 371 additions and 398 deletions
+10 -5
View File
@@ -12,7 +12,8 @@
#include "modules.h"
#include "commands.h"
botinfo_map BotList;
botinfo_map BotListByNick;
botinfo_uid_map BotListByUID;
BotInfo *BotServ = NULL;
BotInfo *ChanServ = NULL;
@@ -62,7 +63,9 @@ BotInfo::BotInfo(const std::string &nnick, const std::string &nuser, const std::
Global = this;
}
BotList[this->nick.c_str()] = this;
BotListByNick[this->nick.c_str()] = this;
if (!this->uid.empty())
BotListByUID[this->uid] = this;
// If we're synchronised with the uplink already, call introduce_user() for this bot.
if (Me && Me->GetUplink()->IsSynced())
@@ -85,17 +88,19 @@ BotInfo::~BotInfo()
}
}
BotList.erase(this->nick.c_str());
BotListByNick.erase(this->nick.c_str());
if (!this->uid.empty())
BotListByUID.erase(this->uid);
}
void BotInfo::ChangeNick(const char *newnick)
{
BotList.erase(this->nick.c_str());
BotListByNick.erase(this->nick.c_str());
this->nick = newnick;
BotList[this->nick.c_str()] = this;
BotListByNick[this->nick.c_str()] = this;
}
void BotInfo::RejoinAll()