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:
@@ -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 */
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user