diff --git a/Projects/Server/Guild.cs b/Projects/Server/Guild.cs index 1b07f9047..2ec19c7f5 100644 --- a/Projects/Server/Guild.cs +++ b/Projects/Server/Guild.cs @@ -33,6 +33,7 @@ namespace Server.Guilds World.AddGuild(this); SetTypeRef(GetType()); + ((ISerializable)this).MarkDirty(); } protected BaseGuild(Serial serial) diff --git a/Projects/Server/Items/Item.cs b/Projects/Server/Items/Item.cs index 6f9f2e258..7d6682436 100644 --- a/Projects/Server/Items/Item.cs +++ b/Projects/Server/Items/Item.cs @@ -231,6 +231,7 @@ namespace Server World.AddEntity(this); SetTypeRef(GetType()); + ((ISerializable)this).MarkDirty(); } public Item(Serial serial) diff --git a/Projects/Server/Mobiles/Mobile.cs b/Projects/Server/Mobiles/Mobile.cs index f603f63d2..579de0561 100644 --- a/Projects/Server/Mobiles/Mobile.cs +++ b/Projects/Server/Mobiles/Mobile.cs @@ -559,8 +559,8 @@ namespace Server DefaultMobileInit(); World.AddEntity(this); - SetTypeRef(GetType()); + ((ISerializable)this).MarkDirty(); } public Mobile(Serial serial) diff --git a/Projects/Server/Serialization/ISerializable.cs b/Projects/Server/Serialization/ISerializable.cs index 274735f65..d4e313b09 100644 --- a/Projects/Server/Serialization/ISerializable.cs +++ b/Projects/Server/Serialization/ISerializable.cs @@ -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; + } } } } diff --git a/Projects/UOContent/Accounting/AccessRestrictions.cs b/Projects/UOContent/Accounting/AccessRestrictions.cs index 3b657b872..08ad2484c 100644 --- a/Projects/UOContent/Accounting/AccessRestrictions.cs +++ b/Projects/UOContent/Accounting/AccessRestrictions.cs @@ -1,4 +1,3 @@ -using System; using System.IO; using System.Net; using Server.Logging; diff --git a/Projects/UOContent/Accounting/Account.cs b/Projects/UOContent/Accounting/Account.cs index ff3b803db..7a9b6c1d4 100644 --- a/Projects/UOContent/Accounting/Account.cs +++ b/Projects/UOContent/Accounting/Account.cs @@ -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(); Accounts.Add(this); + ((ISerializable)this).MarkDirty(); } public Account(Serial serial) { Serial = serial; - SetTypeRef(GetType()); } diff --git a/Projects/UOContent/Accounting/AccountHandler.cs b/Projects/UOContent/Accounting/AccountHandler.cs index 008585e5c..91a5a4096 100644 --- a/Projects/UOContent/Accounting/AccountHandler.cs +++ b/Projects/UOContent/Accounting/AccountHandler.cs @@ -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; diff --git a/Projects/UOContent/Accounting/Security/PBKDF2PasswordProtection.cs b/Projects/UOContent/Accounting/Security/PBKDF2PasswordProtection.cs index 7194e7f71..75cc3b6a1 100644 --- a/Projects/UOContent/Accounting/Security/PBKDF2PasswordProtection.cs +++ b/Projects/UOContent/Accounting/Security/PBKDF2PasswordProtection.cs @@ -16,7 +16,6 @@ using System; using System.Buffers.Binary; using System.Security.Cryptography; -using Server.Network; using Server.Text; namespace Server.Accounting.Security