fix: Fixes dirty-tracking gaps in generated content: setters, sub-object owners, BaseVendor (#2609)
## Why Delta world saves re-serialize an entity only when it has been marked dirty. An audit of the generated classes found three ways serialized state changes without a mark; this PR closes the ones that do not need a new generator package. ## What - **Custom `[SerializableProperty]` setters mark dirty.** Twelve hand-written setters assigned their backing field without `this.MarkDirty()`. `PlagueBeastLord.OpenedBy` was an auto-property carrying the attribute with no backing field at all; it is now a generated field with the same name, order and command-property exposure. - **Generated sub-objects are linked to their owner.** Without a `[DirtyTrackingEntity]` member the generator emits setters that mark nothing. Eight entity-owned sub-objects now carry the link and receive the owner through the constructor the generator calls: `BOBFilter` (owner is `IEntity`: a `PlayerMobile` or a `BulkOrderBook`), `BOBLargeSubEntry`, `PuzzleChestSolution` and `PuzzleChestSolutionAndTime`, `TalismanAttribute` (the random factories now take the talisman), `VendorItem`, `PlayerBBMessage`, `RaffleEntry`, `ShardPollOption`. Migration schemas were regenerated with the pinned tool; the only change is the value rule argument becoming `DeserializationRequiresParent`. - **BaseVendor uses the generator; restock amounts are no longer persisted.** The only state it wrote was which buy entries had grown restock amounts, packed by index into the live `SBInfos` tables. Restock is transient now and rebuilds on load; version 1 records are read and discarded through the legacy path. Every vendor subclass now serializes through a generated chain. ## Generator 4.1.0 This PR adopts SerializationGenerator 4.1.0 (modernuo/SerializationGenerator#55): SG3019/SG3020 diagnostics, `[VolatileSerializedState]`, `StopXxx()` timer helpers, and owner-constructor preference for sub-objects (so dictionary values are constructed with their owner; the 4.0.0 relink fallback is gone). `PlayerVendor.v3.json` gains `DeserializationRequiresParent` for its `VendorItem` values so the migration content struct constructs them with their vendor. SG3019 is an error under `TreatWarningsAsErrors` and generator diagnostics ignore pragmas, so the five contexts that live in whole-file player-keyed persistences (`ChampionTitle`, `ChampionTitleContext`, `MurderContext`, `VirtueContext`, `JailRecord`) now carry a `[DirtyTrackingEntity]` link to their `PlayerMobile`, which is where they will live once those blobs move onto the player record. `JailSystem.EmptyRecord` keeps a null player (`[CanBeNull]`). `ChampionTitle` needs both a context and a player constructor because the generator resolves the rule against the containing type but emits the call with the parent field; a comment in the file records this. ## Wire format Unchanged. No version bumps except `BaseVendor` 1 to 2 (which now writes nothing of its own). Schema diffs are rule-argument only (`DeserializationRequiresParent`). ## Testing Server.Tests 848 passed, UOContent.Tests 759 passed.
This commit is contained in:
parent
a2c232f4a8
commit
84153fba58
49 changed files with 223 additions and 214 deletions
|
|
@ -9,7 +9,7 @@
|
|||
"ruleArguments": [
|
||||
"Server.Engines.BulkOrders.BOBLargeSubEntry",
|
||||
"RawSerializableMigrationRule",
|
||||
""
|
||||
"DeserializationRequiresParent"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
"type": "Server.Engines.BulkOrders.BOBFilter",
|
||||
"rule": "RawSerializableMigrationRule",
|
||||
"ruleArguments": [
|
||||
""
|
||||
"DeserializationRequiresParent"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
"usesSaveFlag": true,
|
||||
"rule": "RawSerializableMigrationRule",
|
||||
"ruleArguments": [
|
||||
""
|
||||
"DeserializationRequiresParent"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
"usesSaveFlag": true,
|
||||
"rule": "RawSerializableMigrationRule",
|
||||
"ruleArguments": [
|
||||
""
|
||||
"DeserializationRequiresParent"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
"usesSaveFlag": true,
|
||||
"rule": "RawSerializableMigrationRule",
|
||||
"ruleArguments": [
|
||||
""
|
||||
"DeserializationRequiresParent"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
"usesSaveFlag": true,
|
||||
"rule": "RawSerializableMigrationRule",
|
||||
"ruleArguments": [
|
||||
""
|
||||
"DeserializationRequiresParent"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -52,7 +52,7 @@
|
|||
"usesSaveFlag": true,
|
||||
"rule": "RawSerializableMigrationRule",
|
||||
"ruleArguments": [
|
||||
""
|
||||
"DeserializationRequiresParent"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -61,7 +61,7 @@
|
|||
"usesSaveFlag": true,
|
||||
"rule": "RawSerializableMigrationRule",
|
||||
"ruleArguments": [
|
||||
""
|
||||
"DeserializationRequiresParent"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -70,7 +70,7 @@
|
|||
"usesSaveFlag": true,
|
||||
"rule": "RawSerializableMigrationRule",
|
||||
"ruleArguments": [
|
||||
""
|
||||
"DeserializationRequiresParent"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -79,7 +79,7 @@
|
|||
"usesSaveFlag": true,
|
||||
"rule": "RawSerializableMigrationRule",
|
||||
"ruleArguments": [
|
||||
""
|
||||
"DeserializationRequiresParent"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -88,7 +88,7 @@
|
|||
"usesSaveFlag": true,
|
||||
"rule": "RawSerializableMigrationRule",
|
||||
"ruleArguments": [
|
||||
""
|
||||
"DeserializationRequiresParent"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
"type": "Server.Items.PlayerBBMessage",
|
||||
"rule": "RawSerializableMigrationRule",
|
||||
"ruleArguments": [
|
||||
"",
|
||||
"DeserializationRequiresParent",
|
||||
"@CanBeNull"
|
||||
]
|
||||
},
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
"ruleArguments": [
|
||||
"Server.Items.PlayerBBMessage",
|
||||
"RawSerializableMigrationRule",
|
||||
""
|
||||
"DeserializationRequiresParent"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
"usesSaveFlag": true,
|
||||
"rule": "RawSerializableMigrationRule",
|
||||
"ruleArguments": [
|
||||
""
|
||||
"DeserializationRequiresParent"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -35,7 +35,7 @@
|
|||
"usesSaveFlag": true,
|
||||
"rule": "RawSerializableMigrationRule",
|
||||
"ruleArguments": [
|
||||
""
|
||||
"DeserializationRequiresParent"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
"usesSaveFlag": true,
|
||||
"rule": "RawSerializableMigrationRule",
|
||||
"ruleArguments": [
|
||||
""
|
||||
"DeserializationRequiresParent"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@
|
|||
"ruleArguments": [
|
||||
"Server.Items.RaffleEntry",
|
||||
"RawSerializableMigrationRule",
|
||||
""
|
||||
"DeserializationRequiresParent"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
"type": "Server.Items.PuzzleChestSolution",
|
||||
"rule": "RawSerializableMigrationRule",
|
||||
"ruleArguments": [
|
||||
""
|
||||
"DeserializationRequiresParent"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
"Server.Items.PuzzleChestSolutionAndTime",
|
||||
"RawSerializableMigrationRule",
|
||||
"2",
|
||||
"",
|
||||
"DeserializationRequiresParent",
|
||||
"@CanBeNull"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
"ruleArguments": [
|
||||
"Server.Misc.ShardPollOption",
|
||||
"RawSerializableMigrationRule",
|
||||
""
|
||||
"DeserializationRequiresParent"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
|||
4
Projects/UOContent/Migrations/Server.Mobiles.BaseVendor.v2.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Mobiles.BaseVendor.v2.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version": 2,
|
||||
"type": "Server.Mobiles.BaseVendor"
|
||||
}
|
||||
|
|
@ -55,7 +55,7 @@
|
|||
"Server.Mobiles.VendorItem",
|
||||
"RawSerializableMigrationRule",
|
||||
"1",
|
||||
""
|
||||
"DeserializationRequiresParent"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@
|
|||
"Server.Mobiles.VendorItem",
|
||||
"RawSerializableMigrationRule",
|
||||
"1",
|
||||
""
|
||||
"DeserializationRequiresParent"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue