diff options
Diffstat (limited to 'src/SMAPI')
-rw-r--r-- | src/SMAPI/Framework/SCore.cs | 37 | ||||
-rw-r--r-- | src/SMAPI/Metadata/CoreAssetPropagator.cs | 28 |
2 files changed, 0 insertions, 65 deletions
diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index ce5a701d..5913430e 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -787,9 +787,6 @@ namespace StardewModdingAPI.Framework this.Monitor.Log(context); - // apply save fixes - this.ApplySaveFixes(); - // raise events this.OnLoadStageChanged(LoadStage.Ready); events.SaveLoaded.RaiseEmpty(); @@ -1107,40 +1104,6 @@ namespace StardewModdingAPI.Framework this.EventManager.ReturnedToTitle.RaiseEmpty(); } - /// <summary>Apply fixes to the save after it's loaded.</summary> - private void ApplySaveFixes() - { - // get last SMAPI version used with this save - const string migrationKey = "Pathoschild.SMAPI/api-version"; - if (!Game1.CustomData.TryGetValue(migrationKey, out string rawVersion) || !SemanticVersion.TryParse(rawVersion, out ISemanticVersion lastVersion)) - lastVersion = new SemanticVersion(3, 8, 0); - - // fix bundle corruption in SMAPI 3.8.0 - // For non-English players who created a new save in SMAPI 3.8.0, bundle data was - // incorrectly translated which caused the code to crash whenever the game tried to - // read it. - if (lastVersion.IsOlderThan(new SemanticVersion(3, 8, 1)) && Game1.netWorldState?.Value?.BundleData != null) - { - var oldData = new Dictionary<string, string>(Game1.netWorldState.Value.BundleData); - - try - { - Game1.applySaveFix(SaveGame.SaveFixes.FixBotchedBundleData); - bool changed = Game1.netWorldState.Value.BundleData.Any(p => oldData.TryGetValue(p.Key, out string oldValue) && oldValue != p.Value); - if (changed) - this.Monitor.Log("Found broken community center bundles and fixed them automatically.", LogLevel.Info); - } - catch (Exception ex) - { - this.Monitor.Log("Failed to verify community center data.", LogLevel.Error); // should never happen - this.Monitor.Log($"Technical details: {ex}"); - } - } - - // update last run - Game1.CustomData[migrationKey] = Constants.ApiVersion.ToString(); - } - /// <summary>A callback invoked before <see cref="Game1.newDayAfterFade"/> runs.</summary> protected void OnNewDayAfterFade() { diff --git a/src/SMAPI/Metadata/CoreAssetPropagator.cs b/src/SMAPI/Metadata/CoreAssetPropagator.cs index a8686ca4..708673c3 100644 --- a/src/SMAPI/Metadata/CoreAssetPropagator.cs +++ b/src/SMAPI/Metadata/CoreAssetPropagator.cs @@ -4,7 +4,6 @@ using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; using Microsoft.Xna.Framework.Graphics; -using Netcode; using StardewModdingAPI.Framework.ContentManagers; using StardewModdingAPI.Framework.Reflection; using StardewModdingAPI.Internal; @@ -16,7 +15,6 @@ using StardewValley.Characters; using StardewValley.GameData.Movies; using StardewValley.Locations; using StardewValley.Menus; -using StardewValley.Network; using StardewValley.Objects; using StardewValley.Projectiles; using StardewValley.TerrainFeatures; @@ -283,32 +281,6 @@ namespace StardewModdingAPI.Metadata Game1.bigCraftablesInformation = content.Load<Dictionary<int, string>>(key); return true; - case "data\\bundles": // NetWorldState constructor - if (Context.IsMainPlayer && Game1.netWorldState != null) - { - var bundles = this.Reflection.GetField<NetBundles>(Game1.netWorldState.Value, "bundles").GetValue(); - var rewards = this.Reflection.GetField<NetIntDictionary<bool, NetBool>>(Game1.netWorldState.Value, "bundleRewards").GetValue(); - foreach (var pair in content.Load<Dictionary<string, string>>(key)) - { - int bundleKey = int.Parse(pair.Key.Split('/')[1]); - int rewardsCount = pair.Value.Split('/')[2].Split(' ').Length; - - // add bundles - if (!bundles.TryGetValue(bundleKey, out bool[] values) || values.Length < rewardsCount) - { - values ??= new bool[0]; - - bundles.Remove(bundleKey); - bundles[bundleKey] = values.Concat(Enumerable.Repeat(false, rewardsCount - values.Length)).ToArray(); - } - - // add bundle rewards - if (!rewards.ContainsKey(bundleKey)) - rewards[bundleKey] = false; - } - } - break; - case "data\\clothinginformation": // Game1.LoadContent Game1.clothingInformation = content.Load<Dictionary<int, string>>(key); return true; |