From 3a4758dfa63f0f8e03166bffa15e16f7995499d7 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 14 May 2022 13:32:13 -0400 Subject: remove warning for mods which use `dynamic` --- src/SMAPI.Toolkit/Framework/ModData/ModWarning.cs | 1 + src/SMAPI/Framework/Logging/LogManager.cs | 5 ----- src/SMAPI/Framework/ModLoading/AssemblyLoader.cs | 5 ----- src/SMAPI/Framework/ModLoading/InstructionHandleResult.cs | 3 --- src/SMAPI/Metadata/InstructionMetadata.cs | 1 - 5 files changed, 1 insertion(+), 14 deletions(-) (limited to 'src') diff --git a/src/SMAPI.Toolkit/Framework/ModData/ModWarning.cs b/src/SMAPI.Toolkit/Framework/ModData/ModWarning.cs index afebba87..cf804df4 100644 --- a/src/SMAPI.Toolkit/Framework/ModData/ModWarning.cs +++ b/src/SMAPI.Toolkit/Framework/ModData/ModWarning.cs @@ -19,6 +19,7 @@ namespace StardewModdingAPI.Toolkit.Framework.ModData PatchesGame = 4, /// The mod uses the dynamic keyword which won't work on Linux/macOS. + [Obsolete("This value is no longer used by SMAPI and will be removed in the upcoming SMAPI 4.0.0.")] UsesDynamic = 8, /// The mod references specialized 'unvalidated update tick' events which may impact stability. diff --git a/src/SMAPI/Framework/Logging/LogManager.cs b/src/SMAPI/Framework/Logging/LogManager.cs index b94807b5..ed5b6959 100644 --- a/src/SMAPI/Framework/Logging/LogManager.cs +++ b/src/SMAPI/Framework/Logging/LogManager.cs @@ -511,11 +511,6 @@ namespace StardewModdingAPI.Framework.Logging "These mods have no update keys in their manifest. SMAPI may not notify you about updates for these", "mods. Consider notifying the mod authors about this problem." ); - - // not crossplatform - this.LogModWarningGroup(modsWithWarnings, ModWarning.UsesDynamic, LogLevel.Debug, "Not crossplatform", - "These mods use the 'dynamic' keyword, and won't work on Linux/macOS." - ); } } diff --git a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs index a6756e0e..fb5ebc01 100644 --- a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs +++ b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs @@ -414,11 +414,6 @@ namespace StardewModdingAPI.Framework.ModLoading mod.SetWarning(ModWarning.UsesUnvalidatedUpdateTick); break; - case InstructionHandleResult.DetectedDynamic: - template = $"{logPrefix}Detected 'dynamic' keyword ($phrase) in assembly {filename}."; - mod.SetWarning(ModWarning.UsesDynamic); - break; - case InstructionHandleResult.DetectedConsoleAccess: template = $"{logPrefix}Detected direct console access ($phrase) in assembly {filename}."; mod.SetWarning(ModWarning.AccessesConsole); diff --git a/src/SMAPI/Framework/ModLoading/InstructionHandleResult.cs b/src/SMAPI/Framework/ModLoading/InstructionHandleResult.cs index baffc50e..e3f108cb 100644 --- a/src/SMAPI/Framework/ModLoading/InstructionHandleResult.cs +++ b/src/SMAPI/Framework/ModLoading/InstructionHandleResult.cs @@ -20,9 +20,6 @@ namespace StardewModdingAPI.Framework.ModLoading /// The instruction is compatible, but affects the save serializer in a way that may make saves unloadable without the mod. DetectedSaveSerializer, - /// The instruction is compatible, but uses the dynamic keyword which won't work on Linux/macOS. - DetectedDynamic, - /// The instruction is compatible, but references or which may impact stability. DetectedUnvalidatedUpdateTick, diff --git a/src/SMAPI/Metadata/InstructionMetadata.cs b/src/SMAPI/Metadata/InstructionMetadata.cs index 9b56f963..4d512546 100644 --- a/src/SMAPI/Metadata/InstructionMetadata.cs +++ b/src/SMAPI/Metadata/InstructionMetadata.cs @@ -67,7 +67,6 @@ namespace StardewModdingAPI.Metadata /**** ** detect code which may impact game stability ****/ - yield return new TypeFinder("System.Runtime.CompilerServices.CallSite", InstructionHandleResult.DetectedDynamic); yield return new FieldFinder(typeof(SaveGame).FullName!, new[] { nameof(SaveGame.serializer), nameof(SaveGame.farmerSerializer), nameof(SaveGame.locationSerializer) }, InstructionHandleResult.DetectedSaveSerializer); yield return new EventFinder(typeof(ISpecializedEvents).FullName!, new[] { nameof(ISpecializedEvents.UnvalidatedUpdateTicked), nameof(ISpecializedEvents.UnvalidatedUpdateTicking) }, InstructionHandleResult.DetectedUnvalidatedUpdateTick); -- cgit