1
0
mirror of https://github.com/anope/anope.git synced 2026-06-25 09:36: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
@@ -93,18 +93,18 @@ public:
{
if (obj && 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;
obj->UpdateCache(data);
Serialize::Type *s_type = obj->GetSerializableType();
if (!s_type)
continue;
auto create = this->SQL->CreateTable(GetTableName(s_type), data);
for (const auto &query : create)
this->RunQuery(query);
@@ -232,7 +232,7 @@ public:
*/
Data data2;
new_s->Serialize(data2);
obj->Serialize(new_s, data2);
new_s->UpdateCache(data2); /* We know this is the most up to date copy */
}
}