1
0
mirror of https://github.com/anope/anope.git synced 2026-06-25 20:16:36 +02:00

Move serialization from Serializable to a Serialize::Type child.

This commit is contained in:
Sadie Powell
2025-03-12 10:29:11 +00:00
parent 718f2e922a
commit cdcf0e2f9a
40 changed files with 778 additions and 452 deletions
+16 -10
View File
@@ -84,19 +84,25 @@ BotInfo::~BotInfo()
BotListByUID->erase(this->uid);
}
void BotInfo::Serialize(Serialize::Data &data) const
BotInfo::Type::Type()
: Serialize::Type("BotInfo")
{
data.Store("nick", this->nick);
data.Store("user", this->ident);
data.Store("host", this->host);
data.Store("realname", this->realname);
data.Store("created", this->created);
data.Store("oper_only", this->oper_only);
Extensible::ExtensibleSerialize(this, this, data);
}
Serializable *BotInfo::Unserialize(Serializable *obj, Serialize::Data &data)
void BotInfo::Type::Serialize(const Serializable *obj, Serialize::Data &data) const
{
const auto *bi = static_cast<const BotInfo *>(obj);
data.Store("nick", bi->nick);
data.Store("user", bi->ident);
data.Store("host", bi->host);
data.Store("realname", bi->realname);
data.Store("created", bi->created);
data.Store("oper_only", bi->oper_only);
Extensible::ExtensibleSerialize(bi, bi, data);
}
Serializable *BotInfo::Type::Unserialize(Serializable *obj, Serialize::Data &data) const
{
Anope::string nick, user, host, realname, flags;