-
-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
297 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
"Name": "Console Commands", | ||
"Author": "SMAPI", | ||
"Version": "3.14.6", | ||
"Version": "3.14.7", | ||
"Description": "Adds SMAPI console commands that let you manipulate the game.", | ||
"UniqueID": "SMAPI.ConsoleCommands", | ||
"EntryDll": "ConsoleCommands.dll", | ||
"MinimumApiVersion": "3.14.6" | ||
"MinimumApiVersion": "3.14.7" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
"Name": "Error Handler", | ||
"Author": "SMAPI", | ||
"Version": "3.14.6", | ||
"Version": "3.14.7", | ||
"Description": "Handles some common vanilla errors to log more useful info or avoid breaking the game.", | ||
"UniqueID": "SMAPI.ErrorHandler", | ||
"EntryDll": "ErrorHandler.dll", | ||
"MinimumApiVersion": "3.14.6" | ||
"MinimumApiVersion": "3.14.7" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
"Name": "Save Backup", | ||
"Author": "SMAPI", | ||
"Version": "3.14.6", | ||
"Version": "3.14.7", | ||
"Description": "Automatically backs up all your saves once per day into its folder.", | ||
"UniqueID": "SMAPI.SaveBackup", | ||
"EntryDll": "SaveBackup.dll", | ||
"MinimumApiVersion": "3.14.6" | ||
"MinimumApiVersion": "3.14.7" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/SMAPI/Framework/ModLoading/Finders/LegacyAssemblyFinder.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using Mono.Cecil; | ||
using StardewModdingAPI.Framework.ModLoading.Framework; | ||
|
||
namespace StardewModdingAPI.Framework.ModLoading.Finders | ||
{ | ||
/// <summary>Detects assembly references which will break in SMAPI 4.0.0.</summary> | ||
internal class LegacyAssemblyFinder : BaseInstructionHandler | ||
{ | ||
/********* | ||
** Public methods | ||
*********/ | ||
/// <summary>Construct an instance.</summary> | ||
public LegacyAssemblyFinder() | ||
: base(defaultPhrase: "legacy assembly references") { } | ||
|
||
|
||
/// <inheritdoc /> | ||
public override bool Handle(ModuleDefinition module) | ||
{ | ||
foreach (AssemblyNameReference assembly in module.AssemblyReferences) | ||
{ | ||
InstructionHandleResult flag = this.GetFlag(assembly); | ||
if (flag is InstructionHandleResult.None) | ||
continue; | ||
|
||
this.MarkFlag(flag); | ||
} | ||
|
||
return false; | ||
} | ||
|
||
|
||
/********* | ||
** Private methods | ||
*********/ | ||
/// <summary>Get the instruction handle flag for the given assembly reference, if any.</summary> | ||
/// <param name="assemblyRef">The assembly reference.</param> | ||
private InstructionHandleResult GetFlag(AssemblyNameReference assemblyRef) | ||
{ | ||
return assemblyRef.Name switch | ||
{ | ||
"System.Configuration.ConfigurationManager" => InstructionHandleResult.DetectedLegacyConfigurationDll, | ||
"System.Runtime.Caching" => InstructionHandleResult.DetectedLegacyCachingDll, | ||
"System.Security.Permission" => InstructionHandleResult.DetectedLegacyPermissionsDll, | ||
_ => InstructionHandleResult.None | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.