1
0
mirror of https://github.com/anope/anope.git synced 2026-06-28 08:56:38 +02:00

Added a new database format and sqlite support. Also moved db-convert to a module.

This commit is contained in:
Adam
2011-09-25 04:19:15 -04:00
parent 43201ead95
commit 1f2399de36
75 changed files with 4143 additions and 5880 deletions
+23
View File
@@ -64,6 +64,29 @@ BotInfo::~BotInfo()
BotListByUID.erase(this->uid);
}
SerializableBase::serialized_data BotInfo::serialize()
{
SerializableBase::serialized_data data;
data["nick"] << this->nick;
data["user"] << this->ident;
data["host"] << this->host;
data["realname"] << this->realname;
data["created"] << this->created;
data["chancount"] << this->chancount;
return data;
}
void BotInfo::unserialize(SerializableBase::serialized_data &data)
{
BotInfo *bi = findbot(data["nick"].astr());
if (bi == NULL)
bi = new BotInfo(data["nick"].astr(), data["user"].astr(), data["host"].astr(), data["realname"].astr());
data["created"] >> bi->created;
data["chancount"] >> bi->chancount;
}
void BotInfo::GenerateUID()
{
if (!this->uid.empty())