ModernUO/Projects/UOContent/Engines/Bulk Orders
Kamron Batman 84153fba58
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.
2026-09-06 09:43:44 -07:00
..
Books fix: Fixes dirty-tracking gaps in generated content: setters, sub-object owners, BaseVendor (#2609) 2026-09-06 09:43:44 -07:00
BaseBOD.cs fix: Optimizes items to use default weights. (Part 1) (#2240) 2025-07-24 14:44:39 -07:00
BODTarget.cs fix(core): Converts more packets and switches to Moq (#415) 2021-01-16 22:09:05 -08:00
BulkMaterialType.cs cleanup: Fixes bugs and cleans up code (#660) 2021-07-19 20:49:59 -07:00
LargeBOD.cs feat: Adds Feature Flag System (#2328) 2026-02-07 12:02:57 -08:00
LargeBODAcceptGump.cs chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
LargeBODGump.cs chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
LargeBulkEntry.cs fix(codegen): Fixes bulk order deed hue and codegens (#647) 2021-06-11 19:51:03 -07:00
LargeSmithBOD.cs fix: Updates serialization to use v2.0 (#998) 2022-04-17 08:02:15 -07:00
LargeTailorBOD.cs fix: Updates serialization to use v2.0 (#998) 2022-04-17 08:02:15 -07:00
Rewards.cs chore: Cleans up pattern checks. (#892) 2021-12-24 15:53:59 -08:00
SmallBOD.cs fix: Fixes PlayerConstructed stacking/BODs (#2579) 2026-08-14 17:14:38 -07:00
SmallBODAcceptGump.cs chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
SmallBODGump.cs chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
SmallBulkEntry.cs fix(core): Fixes type caching & cleanup (#422) 2021-01-20 00:10:33 -08:00
SmallSmithBOD.cs chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
SmallTailorBOD.cs chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00