feat: Adds new decay system and SkipSerialization#2311
Merged
kamronbatman merged 11 commits intomainfrom Jan 8, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request introduces a SkipSerialization property to the ISerializable interface to provide a cleaner mechanism for marking entities that should not be persisted. This replaces the previous pattern of using [AfterDeserialization(false)] methods that unconditionally call Delete().
- Adds
SkipSerializationproperty toISerializableinterface - Updates serialization logic to skip entities where
SkipSerialization => true - Converts 16 classes from the old deletion-on-deserialization pattern to the new skip-serialization approach
Reviewed changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Projects/Server/Serialization/ISerializable.cs | Adds SkipSerialization property to interface |
| Projects/Server/Serialization/GenericEntityPersistence.cs | Updates serialization logic to skip entities and maintain accurate counts |
| Projects/Server/Items/Item.cs | Adds default implementation returning false |
| Projects/Server/Mobiles/Mobile.cs | Adds default implementation returning false |
| Projects/Server/Guild.cs | Adds implementation returning false |
| Projects/Server/IEntity.cs | Adds implementation returning true and removes deserialization deletion logic |
| Projects/Server/Items/VirtualCheck.cs | Adds SkipSerialization, refactors properties to use serialization generator |
| Projects/UOContent/Spells/Spellweaving/Mobiles/NatureFury.cs | Replaces AfterDeserialization with SkipSerialization |
| Projects/UOContent/Spells/Seventh/GateTravel.cs | Replaces AfterDeserialization with SkipSerialization |
| Projects/UOContent/Multis/Houses/PreviewHouse.cs | Replaces AfterDeserialization with SkipSerialization |
| Projects/UOContent/Multis/Houses/BaseHouse.cs | Replaces AfterDeserialization with SkipSerialization for TransferItem |
| Projects/UOContent/Mobiles/Monsters/Mammal/Melee/VorpalBunny.cs | Replaces AfterDeserialization with SkipSerialization for BunnyHole |
| Projects/UOContent/Mobiles/Monsters/Humanoid/Melee/KhaldunRevenant.cs | Replaces AfterDeserialization with SkipSerialization |
| Projects/UOContent/Mobiles/Monsters/AOS/Revenant.cs | Replaces AfterDeserialization with SkipSerialization |
| Projects/UOContent/Mobiles/AI/BaseAI/TransferItem.cs | Replaces AfterDeserialization with SkipSerialization |
| Projects/UOContent/Items/Weapons/Fists.cs | Replaces AfterDeserialization with SkipSerialization |
| Projects/UOContent/Items/Misc/MoonstoneGate.cs | Replaces AfterDeserialization with SkipSerialization |
| Projects/UOContent/Items/Misc/EffectItem.cs | Replaces AfterDeserialization with SkipSerialization |
| Projects/UOContent/Items/Misc/Acid.cs | Replaces AfterDeserialization with SkipSerialization |
| Projects/UOContent/Items/Maps/TreasureMap.cs | Replaces AfterDeserialization with SkipSerialization for TreasureChestDirt |
| Projects/UOContent/Engines/Spawners/Commands/ShowSpawnerBordersCommand.cs | Replaces AfterDeserialization with SkipSerialization for SpawnerBorder |
| Projects/UOContent/Engines/Quests/Core/Items/HornOfRetreat.cs | Replaces AfterDeserialization with SkipSerialization for HornOfRetreatMoongate |
| Projects/UOContent/Engines/Plants/MiscItems/GreenThorns.cs | Replaces AfterDeserialization with SkipSerialization for GreenThornsSHTeleporter |
| Projects/UOContent/Engines/Ethics/Core/EthicsEntity.cs | Adds SkipSerialization returning false |
| Projects/UOContent/Engines/ConPVP/Games/BombingRun.cs | Adds SkipSerialization, makes FindOwner static, removes deserialization logic |
| Projects/UOContent/Accounting/Account.cs | Adds SkipSerialization returning false |
| Projects/Server.Tests/Tests/Network/Packets/Outgoing/AccountPacketTests.cs | Updates mock to implement SkipSerialization |
| Projects/Server.Tests/Tests/Maps/ClientEnumeratorTests.cs | Updates mock to implement SkipSerialization |
Comments suppressed due to low confidence (1)
Projects/UOContent/Engines/ConPVP/Games/BombingRun.cs:73
- Since this class now has
SkipSerialization => true, theSerializeandDeserializemethods should also be removed as they will never be called. These methods are redundant and will cause confusion.
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadInt();
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write(0); // version
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
DecayScheduler (new):
Item.cs:
World.cs:
Performance
Configuration
decay.maxItemsPerTick = 250 # Items processed per tick
decay.tickInterval = 256ms # Base processing interval
decay.bucketInterval = 5min # Timer wheel bucket size
decay.jitterMaxMs = 25 # ±25ms tick jitter