The PreBuild targets ran the generator with "--no-build", so it used whatever
assemblies happened to sit in its output folder. When that copy of the data model
was older than a newly added type, the generator regenerated the checked-in
*.Generated.cs files WITHOUT that type and overwrote them in the source tree.
Nothing failed at build time: the C# compile stayed green and docker builds
(-p:ci=true) skip the generator entirely, so they compiled whatever was in the
tree. The damage only surfaced at runtime, when EF validated the model and found
the inherited GameConfiguration.CastleSiegeConfiguration navigation pointing at a
keyless type - the server died on startup with "The entity type
'CastleSiegeConfiguration' requires a primary key to be defined".
Dropping the switch makes the generator build first, so its output always matches
the data model. The regenerated files here are that missing output: the Castle
Siege mappings, and the packet tests for packets whose XML was already committed.
TypedContextModelTests builds the typed context the startup reads its plugin
configurations through - the first one to touch the model - so this class of
breakage fails in seconds without a database.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Brings in the database layer of upstream OpenMU PRs #754 and #860 without
touching AdaMu's working Castle Siege gameplay. This is purely additive: the
existing 5-phase implementation still runs exactly as before.
What is included:
- DataModel: CastleSiegeState (the original Season 6 values 0-9, which are
exactly what the game client's CASTLESIEGE_STATE enum expects),
CastleSiegeJoinSide, and the zone/NPC/upgrade definition types.
- Entities: CastleSiegeData, CastleSiegeGuildRegistration, CastleSiegeNpcState.
These identify a guild by its persistent Guid rather than by name.
- Generated persistence: 8 BasicModel + 8 EntityFramework model classes,
CastleSiegeExtensions, and the regenerated ExtendedTypeContext,
MapsterConfigurator and GameConfiguration partials.
- Migrations: 20260730194321_AddCastleSiege and
20260801162427_ConfigureCastleSiegePersistence, plus the model snapshot.
- EntityDataContext gains the two DbSets and the five model registrations.
- EntityFrameworkContextBase only publishes configuration changes for entities
in the configuration schema, so siege state writes are no longer broadcast as
configuration changes.
AdaMu-specific adaptations:
- UpdateVersion.AddCastleSiegeData is 105, not upstream's 100. AdaMu already
ships 95-104, and the applied-update bookkeeping is keyed on this value, so a
collision would skip or re-run updates on live databases.
- CastleSiegeInitializer does not seed a weekly StateSchedule. Upstream drives
the cycle from a fixed Saturday schedule; AdaMu drives it manually from
CastleSiegeEventPlugIn and the AdminPanel, so the schedule is left empty and
nothing reads it.
The seeded NPC definitions match AdaMu's existing hard-coded coordinates
exactly (6 gates, the two crown switches and the crown), and additionally
provide 4 guardian statues, 6 guardsmen and real gate/statue hit point tables
that the current implementation does not have yet.
Two pre-existing migrations were restyled by upstream (copyright header, using
placement, trailing comma). No functional change.
Verified: full server build succeeds with 0 errors.