diff --git a/src/DataModel/Configuration/Items/ItemOfItemSet.cs b/src/DataModel/Configuration/Items/ItemOfItemSet.cs index cf507f305..2e36d6424 100644 --- a/src/DataModel/Configuration/Items/ItemOfItemSet.cs +++ b/src/DataModel/Configuration/Items/ItemOfItemSet.cs @@ -47,23 +47,6 @@ public partial class ItemOfItemSet [JsonIgnore] public string Name => $"{this.ItemSetGroup?.Name} {this.ItemDefinition?.Name}"; - ///// - //public void AssignValuesOf(ItemOfItemSet other, GameConfiguration gameConfiguration) - //{ - // this.AncientSetDiscriminator = other.AncientSetDiscriminator; - // this.ItemSetGroup = other.ItemSetGroup is null ? null : gameConfiguration.ItemSetGroups.FirstOrDefault(o => o == other.ItemSetGroup); - // this.ItemDefinition = other.ItemDefinition is null ? null : gameConfiguration.Items.FirstOrDefault(o => o == other.ItemDefinition); - // this.BonusOption = other.BonusOption is null ? null : gameConfiguration.ItemOptions.SelectMany(iod => iod.PossibleOptions).FirstOrDefault(o => o == other.BonusOption); - //} - - ///// - //public virtual ItemOfItemSet Clone(GameConfiguration gameConfiguration) - //{ - // var clone = new ItemOfItemSet(); - // clone.AssignValuesOf(this, gameConfiguration); - // return clone; - //} - /// public override string ToString() { diff --git a/src/DataModel/Configuration/MonsterDefinition.cs b/src/DataModel/Configuration/MonsterDefinition.cs index d3d4aebe8..b379c1ca7 100644 --- a/src/DataModel/Configuration/MonsterDefinition.cs +++ b/src/DataModel/Configuration/MonsterDefinition.cs @@ -341,53 +341,6 @@ public float this[AttributeDefinition key] } } - ///// - //public void AssignValuesOf(object other, GameConfiguration gameConfiguration) - //{ - // if (other is MonsterDefinition typedOther) - // { - // this.AssignValuesOf(typedOther, gameConfiguration); - // } - //} - - ///// - //public void AssignValuesOf(MonsterDefinition other, GameConfiguration gameConfiguration) - //{ - // this.AttackDelay = other.AttackDelay; - // this.AttackRange = other.AttackRange; - // this.Attribute = other.Attribute; - // this.Designation = other.Designation; - // this.IntelligenceTypeName = other.IntelligenceTypeName; - // this.MoveDelay = other.MoveDelay; - // this.MoveRange = other.MoveRange; - // this.Number = other.Number; - // this.ObjectKind = other.ObjectKind; - // this.RespawnDelay = other.RespawnDelay; - // this.ViewRange = other.ViewRange; - // this.NpcWindow = other.NpcWindow; - // this.NumberOfMaximumItemDrops = other.NumberOfMaximumItemDrops; - - // // Object references: - // if (this.AttackSkill != other.AttackSkill) - // { - // this.AttackSkill = other.AttackSkill == null ? null : gameConfiguration.Skills.FirstOrDefault(s => s == other.AttackSkill); - // } - - // if (this.MerchantStore is null && other.MerchantStore is not null) - // { - // // Implement cloning - // //this.MerchantStore = other.MerchantStore.Clone(); - // } - - // //this.MerchantStore = other.MerchantStore; - - // // Collections: todo: compare collections; add new ones, remove old ones - // //this.Attributes = other.Attributes; - // //this.DropItemGroups = other.DropItemGroups; - // //this.ItemCraftings = other.ItemCraftings; - // //this.Quests = other.Quests; - //} - /// public override string ToString() { diff --git a/src/Persistence/EntityFramework/CachingGameConfigurationRepository.cs b/src/Persistence/EntityFramework/CachingGameConfigurationRepository.cs index 81bf50d12..403060715 100644 --- a/src/Persistence/EntityFramework/CachingGameConfigurationRepository.cs +++ b/src/Persistence/EntityFramework/CachingGameConfigurationRepository.cs @@ -2,9 +2,6 @@ // Licensed under the MIT License. See LICENSE file in the project root for full license information. // -using Microsoft.Extensions.Logging.Abstractions; -using MUnique.OpenMU.Interfaces; - namespace MUnique.OpenMU.Persistence.EntityFramework; using Microsoft.EntityFrameworkCore; @@ -80,14 +77,12 @@ public override async ValueTask> GetAllAsync() { configs.ForEach(config => { - //using var context = new CachingEntityFrameworkContext(currentContext.Context, this.RepositoryProvider, false, IConfigurationChangePublisher.None, NullLogger.Instance); ((EntityDataContext)currentContext.Context).CurrentGameConfiguration = config; (this.RepositoryProvider as ICacheAwareRepositoryProvider)?.EnsureCachesForCurrentGameConfiguration(); }); } finally { - ((EntityDataContext)currentContext.Context).CurrentGameConfiguration = oldConfig; }