1
0
mirror of https://github.com/anope/anope.git synced 2026-06-25 06:16:39 +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
+6 -6
View File
@@ -113,8 +113,12 @@ public:
{
if (this->sql)
{
Serialize::Type *s_type = obj->GetSerializableType();
if (!s_type)
continue;
Data data;
obj->Serialize(data);
s_type->Serialize(obj, data);
if (obj->IsCached(data))
continue;
@@ -125,10 +129,6 @@ public:
if (!this->loaded && !this->imported && !this->import)
continue;
Serialize::Type *s_type = obj->GetSerializableType();
if (!s_type)
continue;
auto create = this->sql->CreateTable(GetTableName(s_type), data);
auto insert = this->sql->BuildInsert(GetTableName(s_type), obj->id, data);
@@ -267,7 +267,7 @@ public:
*/
Data data2;
obj->Serialize(data2);
sb->Serialize(obj, data2);
obj->UpdateCache(data2); /* We know this is the most up to date copy */
}
}