summaryrefslogtreecommitdiff
path: root/src/bots.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-07-26 08:45:44 -0400
committerAdam <Adam@anope.org>2013-07-26 08:45:44 -0400
commit3dc64bac4d436ba27683270b88c0cc5bfa346acc (patch)
treeaa1dd95d1c5d4618c06cb8662d9d888c0e5793c8 /src/bots.cpp
parent2450a64bf4dc55635c9f4c1c829f149dc6621b41 (diff)
Fix issues with 'Me' related to previous commit
Diffstat (limited to 'src/bots.cpp')
-rw-r--r--src/bots.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/bots.cpp b/src/bots.cpp
index 0a65393bb..b85bd2534 100644
--- a/src/bots.cpp
+++ b/src/bots.cpp
@@ -106,13 +106,25 @@ Serializable* BotInfo::Unserialize(Serializable *obj, Serialize::Data &data)
return bi;
}
-void BotInfo::GenerateUID()
+void BotInfo::Up()
{
if (!this->uid.empty())
throw CoreException("Bot already has a uid?");
+
this->uid = Servers::TS6_UID_Retrieve();
(*BotListByUID)[this->uid] = this;
UserListByUID[this->uid] = this;
+ this->server = Me;
+ ++this->server->users;
+}
+
+void BotInfo::Down()
+{
+ BotListByUID->erase(this->uid);
+ UserListByUID.erase(this->uid);
+ --this->server->users;
+ this->server = NULL;
+ this->uid = "";
}
void BotInfo::SetNewNick(const Anope::string &newnick)