From 8df578edb6d135796a48b219ecc7a7291c7ef460 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 13 Jul 2021 09:14:07 -0400 Subject: migrate to Harmony 2.1 (#711) --- build/common.targets | 1 + 1 file changed, 1 insertion(+) (limited to 'build/common.targets') diff --git a/build/common.targets b/build/common.targets index ce805402..f5d01606 100644 --- a/build/common.targets +++ b/build/common.targets @@ -38,6 +38,7 @@ + -- cgit From 167d5831d12f0b7c58b3533b716f9041f6ae02e7 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 23 Jul 2021 20:29:44 -0400 Subject: use unmerged Harmony assembly (#711) Harmony merges Mono.Cecil and MonoMod.Common into its DLL, and keeps some (but not all) of the merged types public. That causes type conflicts in SMAPI's code since it uses both Harmony and Mono.Cecil, and extern aliases break on Linux due to IDE/compiler limitations. This commit uses a custom build of Harmony without the assembly merging, so SMAPI can use and manage Mono.Cecil itself. --- build/0Harmony.dll | Bin 802816 -> 166912 bytes build/common.targets | 3 +++ build/prepare-install-package.targets | 3 +++ .../Framework/TemporaryHacks/MiniMonoModHotfix.cs | 2 +- src/SMAPI/SMAPI.csproj | 3 ++- 5 files changed, 9 insertions(+), 2 deletions(-) (limited to 'build/common.targets') diff --git a/build/0Harmony.dll b/build/0Harmony.dll index 1c5b9c09..bab3bb4d 100644 Binary files a/build/0Harmony.dll and b/build/0Harmony.dll differ diff --git a/build/common.targets b/build/common.targets index f5d01606..aed619da 100644 --- a/build/common.targets +++ b/build/common.targets @@ -40,6 +40,9 @@ + + + diff --git a/build/prepare-install-package.targets b/build/prepare-install-package.targets index 0c1a6c1a..88e565f9 100644 --- a/build/prepare-install-package.targets +++ b/build/prepare-install-package.targets @@ -47,6 +47,9 @@ + + + diff --git a/src/SMAPI/Framework/TemporaryHacks/MiniMonoModHotfix.cs b/src/SMAPI/Framework/TemporaryHacks/MiniMonoModHotfix.cs index 6814abea..9f5819d7 100644 --- a/src/SMAPI/Framework/TemporaryHacks/MiniMonoModHotfix.cs +++ b/src/SMAPI/Framework/TemporaryHacks/MiniMonoModHotfix.cs @@ -69,7 +69,7 @@ namespace MonoMod.Utils ); harmony.Patch( - original: typeof(Harmony).Assembly + original: typeof(MonoMod.Utils.ReflectionHelper).Assembly .GetType("MonoMod.Utils.DynamicMethodDefinition+<>c__DisplayClass3_0") .GetMethod("<_CopyMethodToDefinition>g__ResolveTokenAs|1", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance), transpiler: new HarmonyMethod(typeof(MiniMonoModHotfix), nameof(ResolveTokenFix)) diff --git a/src/SMAPI/SMAPI.csproj b/src/SMAPI/SMAPI.csproj index d36d0d7a..d06e3364 100644 --- a/src/SMAPI/SMAPI.csproj +++ b/src/SMAPI/SMAPI.csproj @@ -20,9 +20,10 @@ - + MonoCecilPackage + -- cgit From d688cdf8c3c852d4b11cdd046d67c4b35443cc95 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 1 Aug 2021 13:11:27 -0400 Subject: prepare for release --- build/common.targets | 2 +- docs/release-notes.md | 16 +++++++++------- src/SMAPI.Mods.ConsoleCommands/manifest.json | 4 ++-- src/SMAPI.Mods.ErrorHandler/manifest.json | 4 ++-- src/SMAPI.Mods.SaveBackup/manifest.json | 4 ++-- src/SMAPI/Constants.cs | 2 +- 6 files changed, 17 insertions(+), 15 deletions(-) (limited to 'build/common.targets') diff --git a/build/common.targets b/build/common.targets index aed619da..d526a2bb 100644 --- a/build/common.targets +++ b/build/common.targets @@ -1,7 +1,7 @@ - 3.11.0 + 3.12.0 SMAPI latest $(AssemblySearchPaths);{GAC} diff --git a/docs/release-notes.md b/docs/release-notes.md index 4f874e38..36f07129 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -1,20 +1,22 @@ ← [README](README.md) # Release notes -## Upcoming release +## 3.12.0 +01 August 2021 for Stardew Valley 1.5.4 or later. See [release highlights](https://www.patreon.com/posts/54388616). + * For players: - * Added automatic save recovery when custom content mods leave null objects in the save. + * Added save recovery when content mods leave null objects in the save (in _Error Handler_). * Added error if the wrong SMAPI bitness is installed (e.g. 32-bit SMAPI with 64-bit game). * Added error if some SMAPI files aren't updated correctly. - * Added `removable` option to the `world_clear` console command (thanks to bladeoflight16!). + * Added `removable` option to the `world_clear` console command (in _Console Commands_, thanks to bladeoflight16!). * Fixed handling of Unicode characters in console commands. - * Fixed intermittent error if a mod fetches mod-provided APIs asynchronously. + * Fixed intermittent error if a mod gets mod-provided APIs asynchronously. * Fixed crash when creating a farm name containing characters that aren't allowed in a folder path. * For mod authors: - * Updated Harmony 1.2.0.1 to 2.1.0 (see [_migrate to Harmony 2.0_](https://stardewvalleywiki.com/Modding:Migrate_to_Harmony_2.0) for more info). - * SMAPI now intercepts `KeyNotFoundException` dictionary errors and adds the key to the error message to simplify troubleshooting. (Due to Harmony limitations, this only works for the dictionary types used by the game.) - * Fixed error loading `.xnb` files from the local mod folder since SMAPI 3.0. + * **Updated Harmony 1.2.0.1 to 2.1.0 (see [_migrate to Harmony 2.0_](https://stardewvalleywiki.com/Modding:Migrate_to_Harmony_2.0) for more info).** + * SMAPI now intercepts `KeyNotFoundException` errors and adds the key to the error message to simplify troubleshooting. (Due to Harmony limitations, this only works for the dictionary types used by the game.) + * Fixed error loading `.xnb` files from the local mod folder. * Fixed reloading a map not correctly reapplying interior doors. ## 3.11.0 diff --git a/src/SMAPI.Mods.ConsoleCommands/manifest.json b/src/SMAPI.Mods.ConsoleCommands/manifest.json index 1781c40d..09684f32 100644 --- a/src/SMAPI.Mods.ConsoleCommands/manifest.json +++ b/src/SMAPI.Mods.ConsoleCommands/manifest.json @@ -1,9 +1,9 @@ { "Name": "Console Commands", "Author": "SMAPI", - "Version": "3.11.0", + "Version": "3.12.0", "Description": "Adds SMAPI console commands that let you manipulate the game.", "UniqueID": "SMAPI.ConsoleCommands", "EntryDll": "ConsoleCommands.dll", - "MinimumApiVersion": "3.11.0" + "MinimumApiVersion": "3.12.0" } diff --git a/src/SMAPI.Mods.ErrorHandler/manifest.json b/src/SMAPI.Mods.ErrorHandler/manifest.json index 82e6152d..c83ca3d0 100644 --- a/src/SMAPI.Mods.ErrorHandler/manifest.json +++ b/src/SMAPI.Mods.ErrorHandler/manifest.json @@ -1,9 +1,9 @@ { "Name": "Error Handler", "Author": "SMAPI", - "Version": "3.11.0", + "Version": "3.12.0", "Description": "Handles some common vanilla errors to log more useful info or avoid breaking the game.", "UniqueID": "SMAPI.ErrorHandler", "EntryDll": "ErrorHandler.dll", - "MinimumApiVersion": "3.11.0" + "MinimumApiVersion": "3.12.0" } diff --git a/src/SMAPI.Mods.SaveBackup/manifest.json b/src/SMAPI.Mods.SaveBackup/manifest.json index 6042dee4..42f1af59 100644 --- a/src/SMAPI.Mods.SaveBackup/manifest.json +++ b/src/SMAPI.Mods.SaveBackup/manifest.json @@ -1,9 +1,9 @@ { "Name": "Save Backup", "Author": "SMAPI", - "Version": "3.11.0", + "Version": "3.12.0", "Description": "Automatically backs up all your saves once per day into its folder.", "UniqueID": "SMAPI.SaveBackup", "EntryDll": "SaveBackup.dll", - "MinimumApiVersion": "3.11.0" + "MinimumApiVersion": "3.12.0" } diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs index 6fb796de..3877e17a 100644 --- a/src/SMAPI/Constants.cs +++ b/src/SMAPI/Constants.cs @@ -61,7 +61,7 @@ namespace StardewModdingAPI internal static int? LogScreenId { get; set; } /// SMAPI's current raw semantic version. - internal static string RawApiVersion = "3.11.0"; + internal static string RawApiVersion = "3.12.0"; } /// Contains SMAPI's constants and assumptions. -- cgit