summaryrefslogtreecommitdiff
path: root/src/bots.cpp
diff options
context:
space:
mode:
authorAdam <Adam@drink-coca-cola.info>2010-05-29 20:44:31 -0400
committerAdam <Adam@anope.org>2010-06-18 21:04:08 -0400
commitb8f9116b19eb511c4f5e6a683725f50bf732a7dd (patch)
treea5848c9797ec4dc3477621fc42211f4985eaec7b /src/bots.cpp
parent435c9116e9997634eb7215e998c8f01a5e46fb2c (diff)
Rewrote all of the command handling to get rid of all the nasty strtoks() everywhere, and added a bot map by uid
Diffstat (limited to 'src/bots.cpp')
-rw-r--r--src/bots.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/bots.cpp b/src/bots.cpp
index 3c23da7d4..e9021b188 100644
--- a/src/bots.cpp
+++ b/src/bots.cpp
@@ -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()