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.
343 lines
13 KiB
C#
343 lines
13 KiB
C#
// <copyright file="CastleSiegeConfiguration.Generated.cs" company="MUnique">
|
|
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
|
|
// </copyright>
|
|
|
|
//------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// This source code was auto-generated by a roslyn code generator.
|
|
// </auto-generated>
|
|
//------------------------------------------------------------------------------
|
|
|
|
// ReSharper disable All
|
|
|
|
namespace MUnique.OpenMU.Persistence.BasicModel;
|
|
|
|
using MUnique.OpenMU.Persistence.Json;
|
|
|
|
/// <summary>
|
|
/// A plain implementation of <see cref="CastleSiegeConfiguration"/>.
|
|
/// </summary>
|
|
public partial class CastleSiegeConfiguration : MUnique.OpenMU.DataModel.Configuration.CastleSiegeConfiguration, IIdentifiable, IConvertibleTo<CastleSiegeConfiguration>
|
|
{
|
|
|
|
/// <summary>
|
|
/// Gets or sets the identifier of this instance.
|
|
/// </summary>
|
|
public Guid Id { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets the raw collection of <see cref="StateSchedule" />.
|
|
/// </summary>
|
|
[System.Text.Json.Serialization.JsonPropertyName("stateSchedule")]
|
|
public ICollection<CastleSiegeStateScheduleEntry> RawStateSchedule { get; } = new List<CastleSiegeStateScheduleEntry>();
|
|
|
|
/// <inheritdoc/>
|
|
[System.Text.Json.Serialization.JsonIgnore]
|
|
public override ICollection<MUnique.OpenMU.DataModel.Configuration.CastleSiegeStateScheduleEntry> StateSchedule
|
|
{
|
|
get => base.StateSchedule ??= new CollectionAdapter<MUnique.OpenMU.DataModel.Configuration.CastleSiegeStateScheduleEntry, CastleSiegeStateScheduleEntry>(this.RawStateSchedule);
|
|
protected set
|
|
{
|
|
this.StateSchedule.Clear();
|
|
foreach (var item in value)
|
|
{
|
|
this.StateSchedule.Add(item);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the raw collection of <see cref="NpcDefinitions" />.
|
|
/// </summary>
|
|
[System.Text.Json.Serialization.JsonPropertyName("npcDefinitions")]
|
|
public ICollection<CastleSiegeNpcDefinition> RawNpcDefinitions { get; } = new List<CastleSiegeNpcDefinition>();
|
|
|
|
/// <inheritdoc/>
|
|
[System.Text.Json.Serialization.JsonIgnore]
|
|
public override ICollection<MUnique.OpenMU.DataModel.Configuration.CastleSiegeNpcDefinition> NpcDefinitions
|
|
{
|
|
get => base.NpcDefinitions ??= new CollectionAdapter<MUnique.OpenMU.DataModel.Configuration.CastleSiegeNpcDefinition, CastleSiegeNpcDefinition>(this.RawNpcDefinitions);
|
|
protected set
|
|
{
|
|
this.NpcDefinitions.Clear();
|
|
foreach (var item in value)
|
|
{
|
|
this.NpcDefinitions.Add(item);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the raw collection of <see cref="GateDefenseUpgrades" />.
|
|
/// </summary>
|
|
[System.Text.Json.Serialization.JsonPropertyName("gateDefenseUpgrades")]
|
|
public ICollection<CastleSiegeUpgradeDefinition> RawGateDefenseUpgrades { get; } = new List<CastleSiegeUpgradeDefinition>();
|
|
|
|
/// <inheritdoc/>
|
|
[System.Text.Json.Serialization.JsonIgnore]
|
|
public override ICollection<MUnique.OpenMU.DataModel.Configuration.CastleSiegeUpgradeDefinition> GateDefenseUpgrades
|
|
{
|
|
get => base.GateDefenseUpgrades ??= new CollectionAdapter<MUnique.OpenMU.DataModel.Configuration.CastleSiegeUpgradeDefinition, CastleSiegeUpgradeDefinition>(this.RawGateDefenseUpgrades);
|
|
protected set
|
|
{
|
|
this.GateDefenseUpgrades.Clear();
|
|
foreach (var item in value)
|
|
{
|
|
this.GateDefenseUpgrades.Add(item);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the raw collection of <see cref="GateLifeUpgrades" />.
|
|
/// </summary>
|
|
[System.Text.Json.Serialization.JsonPropertyName("gateLifeUpgrades")]
|
|
public ICollection<CastleSiegeUpgradeDefinition> RawGateLifeUpgrades { get; } = new List<CastleSiegeUpgradeDefinition>();
|
|
|
|
/// <inheritdoc/>
|
|
[System.Text.Json.Serialization.JsonIgnore]
|
|
public override ICollection<MUnique.OpenMU.DataModel.Configuration.CastleSiegeUpgradeDefinition> GateLifeUpgrades
|
|
{
|
|
get => base.GateLifeUpgrades ??= new CollectionAdapter<MUnique.OpenMU.DataModel.Configuration.CastleSiegeUpgradeDefinition, CastleSiegeUpgradeDefinition>(this.RawGateLifeUpgrades);
|
|
protected set
|
|
{
|
|
this.GateLifeUpgrades.Clear();
|
|
foreach (var item in value)
|
|
{
|
|
this.GateLifeUpgrades.Add(item);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the raw collection of <see cref="StatueDefenseUpgrades" />.
|
|
/// </summary>
|
|
[System.Text.Json.Serialization.JsonPropertyName("statueDefenseUpgrades")]
|
|
public ICollection<CastleSiegeUpgradeDefinition> RawStatueDefenseUpgrades { get; } = new List<CastleSiegeUpgradeDefinition>();
|
|
|
|
/// <inheritdoc/>
|
|
[System.Text.Json.Serialization.JsonIgnore]
|
|
public override ICollection<MUnique.OpenMU.DataModel.Configuration.CastleSiegeUpgradeDefinition> StatueDefenseUpgrades
|
|
{
|
|
get => base.StatueDefenseUpgrades ??= new CollectionAdapter<MUnique.OpenMU.DataModel.Configuration.CastleSiegeUpgradeDefinition, CastleSiegeUpgradeDefinition>(this.RawStatueDefenseUpgrades);
|
|
protected set
|
|
{
|
|
this.StatueDefenseUpgrades.Clear();
|
|
foreach (var item in value)
|
|
{
|
|
this.StatueDefenseUpgrades.Add(item);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the raw collection of <see cref="StatueLifeUpgrades" />.
|
|
/// </summary>
|
|
[System.Text.Json.Serialization.JsonPropertyName("statueLifeUpgrades")]
|
|
public ICollection<CastleSiegeUpgradeDefinition> RawStatueLifeUpgrades { get; } = new List<CastleSiegeUpgradeDefinition>();
|
|
|
|
/// <inheritdoc/>
|
|
[System.Text.Json.Serialization.JsonIgnore]
|
|
public override ICollection<MUnique.OpenMU.DataModel.Configuration.CastleSiegeUpgradeDefinition> StatueLifeUpgrades
|
|
{
|
|
get => base.StatueLifeUpgrades ??= new CollectionAdapter<MUnique.OpenMU.DataModel.Configuration.CastleSiegeUpgradeDefinition, CastleSiegeUpgradeDefinition>(this.RawStatueLifeUpgrades);
|
|
protected set
|
|
{
|
|
this.StatueLifeUpgrades.Clear();
|
|
foreach (var item in value)
|
|
{
|
|
this.StatueLifeUpgrades.Add(item);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the raw collection of <see cref="StatueRegenUpgrades" />.
|
|
/// </summary>
|
|
[System.Text.Json.Serialization.JsonPropertyName("statueRegenUpgrades")]
|
|
public ICollection<CastleSiegeUpgradeDefinition> RawStatueRegenUpgrades { get; } = new List<CastleSiegeUpgradeDefinition>();
|
|
|
|
/// <inheritdoc/>
|
|
[System.Text.Json.Serialization.JsonIgnore]
|
|
public override ICollection<MUnique.OpenMU.DataModel.Configuration.CastleSiegeUpgradeDefinition> StatueRegenUpgrades
|
|
{
|
|
get => base.StatueRegenUpgrades ??= new CollectionAdapter<MUnique.OpenMU.DataModel.Configuration.CastleSiegeUpgradeDefinition, CastleSiegeUpgradeDefinition>(this.RawStatueRegenUpgrades);
|
|
protected set
|
|
{
|
|
this.StatueRegenUpgrades.Clear();
|
|
foreach (var item in value)
|
|
{
|
|
this.StatueRegenUpgrades.Add(item);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the raw collection of <see cref="AttackMachineZones" />.
|
|
/// </summary>
|
|
[System.Text.Json.Serialization.JsonPropertyName("attackMachineZones")]
|
|
public ICollection<CastleSiegeZoneDefinition> RawAttackMachineZones { get; } = new List<CastleSiegeZoneDefinition>();
|
|
|
|
/// <inheritdoc/>
|
|
[System.Text.Json.Serialization.JsonIgnore]
|
|
public override ICollection<MUnique.OpenMU.DataModel.Configuration.CastleSiegeZoneDefinition> AttackMachineZones
|
|
{
|
|
get => base.AttackMachineZones ??= new CollectionAdapter<MUnique.OpenMU.DataModel.Configuration.CastleSiegeZoneDefinition, CastleSiegeZoneDefinition>(this.RawAttackMachineZones);
|
|
protected set
|
|
{
|
|
this.AttackMachineZones.Clear();
|
|
foreach (var item in value)
|
|
{
|
|
this.AttackMachineZones.Add(item);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the raw collection of <see cref="DefenseMachineZones" />.
|
|
/// </summary>
|
|
[System.Text.Json.Serialization.JsonPropertyName("defenseMachineZones")]
|
|
public ICollection<CastleSiegeZoneDefinition> RawDefenseMachineZones { get; } = new List<CastleSiegeZoneDefinition>();
|
|
|
|
/// <inheritdoc/>
|
|
[System.Text.Json.Serialization.JsonIgnore]
|
|
public override ICollection<MUnique.OpenMU.DataModel.Configuration.CastleSiegeZoneDefinition> DefenseMachineZones
|
|
{
|
|
get => base.DefenseMachineZones ??= new CollectionAdapter<MUnique.OpenMU.DataModel.Configuration.CastleSiegeZoneDefinition, CastleSiegeZoneDefinition>(this.RawDefenseMachineZones);
|
|
protected set
|
|
{
|
|
this.DefenseMachineZones.Clear();
|
|
foreach (var item in value)
|
|
{
|
|
this.DefenseMachineZones.Add(item);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the raw object of <see cref="CastleSiegeMapDefinition" />.
|
|
/// </summary>
|
|
[System.Text.Json.Serialization.JsonPropertyName("castleSiegeMapDefinition")]
|
|
public GameMapDefinition RawCastleSiegeMapDefinition
|
|
{
|
|
get => base.CastleSiegeMapDefinition as GameMapDefinition;
|
|
set => base.CastleSiegeMapDefinition = value;
|
|
}
|
|
|
|
/// <inheritdoc/>
|
|
[System.Text.Json.Serialization.JsonIgnore]
|
|
public override MUnique.OpenMU.DataModel.Configuration.GameMapDefinition CastleSiegeMapDefinition
|
|
{
|
|
get => base.CastleSiegeMapDefinition;
|
|
set => base.CastleSiegeMapDefinition = value;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the raw object of <see cref="LandOfTrialsMapDefinition" />.
|
|
/// </summary>
|
|
[System.Text.Json.Serialization.JsonPropertyName("landOfTrialsMapDefinition")]
|
|
public GameMapDefinition RawLandOfTrialsMapDefinition
|
|
{
|
|
get => base.LandOfTrialsMapDefinition as GameMapDefinition;
|
|
set => base.LandOfTrialsMapDefinition = value;
|
|
}
|
|
|
|
/// <inheritdoc/>
|
|
[System.Text.Json.Serialization.JsonIgnore]
|
|
public override MUnique.OpenMU.DataModel.Configuration.GameMapDefinition LandOfTrialsMapDefinition
|
|
{
|
|
get => base.LandOfTrialsMapDefinition;
|
|
set => base.LandOfTrialsMapDefinition = value;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the raw object of <see cref="RewardItemDefinition" />.
|
|
/// </summary>
|
|
[System.Text.Json.Serialization.JsonPropertyName("rewardItemDefinition")]
|
|
public ItemDefinition RawRewardItemDefinition
|
|
{
|
|
get => base.RewardItemDefinition as ItemDefinition;
|
|
set => base.RewardItemDefinition = value;
|
|
}
|
|
|
|
/// <inheritdoc/>
|
|
[System.Text.Json.Serialization.JsonIgnore]
|
|
public override MUnique.OpenMU.DataModel.Configuration.Items.ItemDefinition RewardItemDefinition
|
|
{
|
|
get => base.RewardItemDefinition;
|
|
set => base.RewardItemDefinition = value;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the raw object of <see cref="DefenseRespawnArea" />.
|
|
/// </summary>
|
|
[System.Text.Json.Serialization.JsonPropertyName("defenseRespawnArea")]
|
|
public CastleSiegeZoneDefinition RawDefenseRespawnArea
|
|
{
|
|
get => base.DefenseRespawnArea as CastleSiegeZoneDefinition;
|
|
set => base.DefenseRespawnArea = value;
|
|
}
|
|
|
|
/// <inheritdoc/>
|
|
[System.Text.Json.Serialization.JsonIgnore]
|
|
public override MUnique.OpenMU.DataModel.Configuration.CastleSiegeZoneDefinition DefenseRespawnArea
|
|
{
|
|
get => base.DefenseRespawnArea;
|
|
set => base.DefenseRespawnArea = value;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the raw object of <see cref="AttackRespawnArea" />.
|
|
/// </summary>
|
|
[System.Text.Json.Serialization.JsonPropertyName("attackRespawnArea")]
|
|
public CastleSiegeZoneDefinition RawAttackRespawnArea
|
|
{
|
|
get => base.AttackRespawnArea as CastleSiegeZoneDefinition;
|
|
set => base.AttackRespawnArea = value;
|
|
}
|
|
|
|
/// <inheritdoc/>
|
|
[System.Text.Json.Serialization.JsonIgnore]
|
|
public override MUnique.OpenMU.DataModel.Configuration.CastleSiegeZoneDefinition AttackRespawnArea
|
|
{
|
|
get => base.AttackRespawnArea;
|
|
set => base.AttackRespawnArea = value;
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public override MUnique.OpenMU.DataModel.Configuration.CastleSiegeConfiguration Clone(MUnique.OpenMU.DataModel.Configuration.GameConfiguration gameConfiguration)
|
|
{
|
|
var clone = new CastleSiegeConfiguration();
|
|
clone.AssignValuesOf(this, gameConfiguration);
|
|
return clone;
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public override void AssignValuesOf(MUnique.OpenMU.DataModel.Configuration.CastleSiegeConfiguration other, MUnique.OpenMU.DataModel.Configuration.GameConfiguration gameConfiguration)
|
|
{
|
|
base.AssignValuesOf(other, gameConfiguration);
|
|
this.Id = other.GetId();
|
|
}
|
|
|
|
/// <inheritdoc/>
|
|
public override bool Equals(object obj)
|
|
{
|
|
var baseObject = obj as IIdentifiable;
|
|
if (baseObject != null)
|
|
{
|
|
return baseObject.Id == this.Id;
|
|
}
|
|
|
|
return base.Equals(obj);
|
|
}
|
|
|
|
/// <inheritdoc/>
|
|
public override int GetHashCode()
|
|
{
|
|
return this.Id.GetHashCode();
|
|
}
|
|
|
|
/// <inheritdoc/>
|
|
public CastleSiegeConfiguration Convert() => this;
|
|
}
|