fix(core): Fixes issues with deserialization due to bad checking of dirty tracking (#618)
Fixes a major issue where serialization was not respecting the dirty tracking feature flag.
This commit is contained in:
parent
3c6356e8fa
commit
1f499b00c6
8 changed files with 16 additions and 7 deletions
|
|
@ -33,6 +33,7 @@ namespace Server.Guilds
|
|||
World.AddGuild(this);
|
||||
|
||||
SetTypeRef(GetType());
|
||||
((ISerializable)this).MarkDirty();
|
||||
}
|
||||
|
||||
protected BaseGuild(Serial serial)
|
||||
|
|
|
|||
|
|
@ -231,6 +231,7 @@ namespace Server
|
|||
|
||||
World.AddEntity(this);
|
||||
SetTypeRef(GetType());
|
||||
((ISerializable)this).MarkDirty();
|
||||
}
|
||||
|
||||
public Item(Serial serial)
|
||||
|
|
|
|||
|
|
@ -559,8 +559,8 @@ namespace Server
|
|||
DefaultMobileInit();
|
||||
|
||||
World.AddEntity(this);
|
||||
|
||||
SetTypeRef(GetType());
|
||||
((ISerializable)this).MarkDirty();
|
||||
}
|
||||
|
||||
public Mobile(Serial serial)
|
||||
|
|
|
|||
|
|
@ -39,6 +39,14 @@ namespace Server
|
|||
public void InitializeSaveBuffer(byte[] buffer)
|
||||
{
|
||||
SaveBuffer = new BufferWriter(buffer, true);
|
||||
if (World.DirtyTrackingEnabled)
|
||||
{
|
||||
SavePosition = SaveBuffer.Position;
|
||||
}
|
||||
else
|
||||
{
|
||||
SavePosition = -1;
|
||||
}
|
||||
}
|
||||
|
||||
public void Serialize()
|
||||
|
|
@ -59,6 +67,10 @@ namespace Server
|
|||
{
|
||||
SavePosition = SaveBuffer.Position;
|
||||
}
|
||||
else
|
||||
{
|
||||
SavePosition = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using Server.Logging;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Xml;
|
||||
using Server.Accounting.Security;
|
||||
using Server.Misc;
|
||||
|
|
@ -43,12 +41,12 @@ namespace Server.Accounting
|
|||
LoginIPs = Array.Empty<IPAddress>();
|
||||
|
||||
Accounts.Add(this);
|
||||
((ISerializable)this).MarkDirty();
|
||||
}
|
||||
|
||||
public Account(Serial serial)
|
||||
{
|
||||
Serial = serial;
|
||||
|
||||
SetTypeRef(GetType());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ using System.Net;
|
|||
using Server.Accounting;
|
||||
using Server.Engines.Help;
|
||||
using Server.Logging;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
using Server.Regions;
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
using System;
|
||||
using System.Buffers.Binary;
|
||||
using System.Security.Cryptography;
|
||||
using Server.Network;
|
||||
using Server.Text;
|
||||
|
||||
namespace Server.Accounting.Security
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue