From 9543971d2598f4d375374f427dfc17e615d4e67a Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 7 Mar 2019 18:11:47 -0500 Subject: update for compatibility wiki page changes --- src/StardewModdingAPI.Toolkit/Framework/Clients/Wiki/WikiClient.cs | 4 +++- src/StardewModdingAPI.Toolkit/Framework/Clients/Wiki/WikiModEntry.cs | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src/StardewModdingAPI.Toolkit/Framework') diff --git a/src/StardewModdingAPI.Toolkit/Framework/Clients/Wiki/WikiClient.cs b/src/StardewModdingAPI.Toolkit/Framework/Clients/Wiki/WikiClient.cs index d3a25845..ac279d88 100644 --- a/src/StardewModdingAPI.Toolkit/Framework/Clients/Wiki/WikiClient.cs +++ b/src/StardewModdingAPI.Toolkit/Framework/Clients/Wiki/WikiClient.cs @@ -39,7 +39,7 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.Wiki .WithArguments(new { action = "parse", - page = "Modding:SMAPI_compatibility", + page = "Modding:Mod_compatibility", format = "json" }) .As(); @@ -98,6 +98,7 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.Wiki string customSourceUrl = this.GetAttribute(node, "data-custom-source"); string customUrl = this.GetAttribute(node, "data-url"); string anchor = this.GetAttribute(node, "id"); + string contentPackFor = this.GetAttribute(node, "data-content-pack-for"); // parse stable compatibility WikiCompatibilityInfo compatibility = new WikiCompatibilityInfo @@ -142,6 +143,7 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.Wiki GitHubRepo = githubRepo, CustomSourceUrl = customSourceUrl, CustomUrl = customUrl, + ContentPackFor = contentPackFor, Compatibility = compatibility, BetaCompatibility = betaCompatibility, Smapi3Status = smapi3Status, diff --git a/src/StardewModdingAPI.Toolkit/Framework/Clients/Wiki/WikiModEntry.cs b/src/StardewModdingAPI.Toolkit/Framework/Clients/Wiki/WikiModEntry.cs index b71269fe..35d43758 100644 --- a/src/StardewModdingAPI.Toolkit/Framework/Clients/Wiki/WikiModEntry.cs +++ b/src/StardewModdingAPI.Toolkit/Framework/Clients/Wiki/WikiModEntry.cs @@ -33,6 +33,9 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.Wiki /// The custom mod page URL (if applicable). public string CustomUrl { get; set; } + /// The name of the mod which loads this content pack, if applicable. + public string ContentPackFor { get; set; } + /// The mod's compatibility with the latest stable version of the game. public WikiCompatibilityInfo Compatibility { get; set; } -- cgit From c57405aee06ca77933eadbcbcb741be085002046 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 7 Mar 2019 18:12:02 -0500 Subject: update compatibility list --- .../wwwroot/StardewModdingAPI.metadata.json | 141 +++++++++++---------- .../Framework/ModData/ModDataModel.cs | 9 +- 2 files changed, 74 insertions(+), 76 deletions(-) (limited to 'src/StardewModdingAPI.Toolkit/Framework') diff --git a/src/SMAPI.Web/wwwroot/StardewModdingAPI.metadata.json b/src/SMAPI.Web/wwwroot/StardewModdingAPI.metadata.json index 818ff9fe..1de7e70c 100644 --- a/src/SMAPI.Web/wwwroot/StardewModdingAPI.metadata.json +++ b/src/SMAPI.Web/wwwroot/StardewModdingAPI.metadata.json @@ -81,7 +81,8 @@ "JSON Assets": { "ID": "spacechase0.JsonAssets", - "Default | UpdateKey": "Nexus:1720" + "Default | UpdateKey": "Nexus:1720", + "1.3.1 | Status": "AssumeBroken" // causes runtime crashes }, "Mail Framework": { @@ -133,7 +134,7 @@ } }, - "Basic Sprinklers Improved": { + "Basic Sprinkler Improved": { "ID": "lrsk_sdvm_bsi.0117171308", "MapRemoteVersions": { "1.0.2": "1.0.1-release" } // manifest not updated }, @@ -143,27 +144,11 @@ "MapLocalVersions": { "1.0.1": "1.0.2" } }, - "Birthday Mail": { - "ID": "KathrynHazuka.BirthdayMail", - "FormerIDs": "005e02dc-d900-425c-9c68-1ff55c5a295d", // changed in 1.2.3-pathoschild-update - "MapRemoteVersions": { "1.3.1": "1.3" } // manifest not updated - }, - - "Casks Anywhere": { - "ID": "CasksAnywhere", - "MapLocalVersions": { "1.1-alpha": "1.1" } - }, - "Chefs Closet": { "ID": "Duder.ChefsCloset", "MapLocalVersions": { "1.3-1": "1.3" } }, - "Cobalt": { - "ID": "spacechase0.Cobalt", - "MapRemoteVersions": { "1.1.3": "1.1.2" } // not updated in manifest - }, - "Configurable Machines": { "ID": "21da6619-dc03-4660-9794-8e5b498f5b97", "MapLocalVersions": { "1.2-beta": "1.2" } @@ -174,11 +159,6 @@ "MapRemoteVersions": { "1.1": "1.0" } // not updated in manifest }, - "Customizable Cart Redux": { - "ID": "KoihimeNakamura.CCR", - "MapLocalVersions": { "1.1-20170917": "1.1" } - }, - "Custom Linens": { "ID": "Mevima.CustomLinens", "MapRemoteVersions": { "1.1": "1.0" } // manifest not updated @@ -194,41 +174,11 @@ "MapLocalVersions": { "1.1": "1.1.1" } }, - "Hunger Mod (skn)": { - "ID": "skn.HungerMod", - "MapRemoteVersions": { "1.2.1": "1.0" } // manifest not updated - }, - - "Idle Pause": { - "ID": "Veleek.IdlePause", - "MapRemoteVersions": { "1.2": "1.1" } // manifest not updated - }, - - "Item Auto Stacker": { - "ID": "cat.autostacker", - "MapRemoteVersions": { "1.0.1": "1.0" } // manifest not updated - }, - - "Move Faster": { - "ID": "shuaiz.MoveFasterMod", - "~1.0.1 | Status": "AssumeBroken" // doesn't do anything as of SDV 1.2.33 (bad Harmony patch?) - }, - "Multiple Sprites and Portraits On Rotation (File Loading)": { "ID": "FileLoading", "MapLocalVersions": { "1.1": "1.12" } }, - "Night Owl": { - "ID": "Omegasis.NightOwl", - "MapLocalVersions": { "2.1": "1.3" } // 1.3 had wrong version in manifest - }, - - "Point-and-Plant": { - "ID": "jwdred.PointAndPlant", - "MapRemoteVersions": { "1.0.3": "1.0.2" } // manifest not updated - }, - "Relationship Status": { "ID": "relationshipstatus", "MapRemoteVersions": { "1.0.5": "1.0.4" } // not updated in manifest @@ -239,12 +189,6 @@ "MapLocalVersions": { "1.1.2-release": "1.1.2" } }, - "Shop Expander": { - "ID": "Entoarox.ShopExpander", - "FormerIDs": "EntoaroxShopExpander", // changed in 1.5.2 - "MapRemoteVersions": { "1.6.0b": "1.6.0" } - }, - "Showcase Mod": { "ID": "Igorious.Showcase", "MapLocalVersions": { "0.9-500": "0.9" } @@ -256,16 +200,6 @@ "MapLocalVersions": { "0.0": "1.4" } }, - "Solar Eclipse Event": { - "ID": "KoihimeNakamura.SolarEclipseEvent", - "MapLocalVersions": { "1.3.1-20180131": "1.3.1" } - }, - - "Time Reminder": { - "ID": "KoihimeNakamura.TimeReminder", - "MapLocalVersions": { "1.0-20170314": "1.0.2" } - }, - /********* ** Obsolete @@ -294,6 +228,67 @@ "~ | StatusReasonPhrase": "debug mode was removed in SMAPI 1.0." }, + /********* + ** Broke in SDV 1.3.36 + *********/ + "2cute FarmCave": { + "ID": "taintedwheat.2CuteFarmCave", + "Default | UpdateKey": "Nexus:843", + "~2.0 | Status": "AssumeBroken" // references deleted Content/Mine.xnb + }, + + "Ace's Expanded Caves - Default Cave": { + "ID": "Acerbicon.AECdefault", + "Default | UpdateKey": "Nexus:2131", + "~1.2.2 | Status": "AssumeBroken" // references deleted Content/Mine.xnb + }, + + "Ace's Expanded Caves - Desert Cave": { + "ID": "Acerbicon.AECdesert", + "Default | UpdateKey": "Nexus:2131", + "~1.2.2 | Status": "AssumeBroken" // references deleted Content/Mine.xnb + }, + + "Ace's Expanded Caves - Ice Cave": { + "ID": "Acerbicon.AECice", + "Default | UpdateKey": "Nexus:2131", + "~1.2.2 | Status": "AssumeBroken" // references deleted Content/Mine.xnb + }, + + "Ace's Expanded Caves - Lava Cave": { + "ID": "Acerbicon.AEClava", + "Default | UpdateKey": "Nexus:2131", + "~1.2.2 | Status": "AssumeBroken" // references deleted Content/Mine.xnb + }, + + "Ace's Expanded Caves - Slime Cave": { + "ID": "Acerbicon.AECslime", + "Default | UpdateKey": "Nexus:2131", + "~1.2.2 | Status": "AssumeBroken" // references deleted Content/Mine.xnb + }, + + "Green Pastures Farm": { + "ID": "bugbuddy.GreenPasturesFarm", + "Default | UpdateKey": "Nexus:2326", + "~1.0 | Status": "AssumeBroken" // references deleted Content/weapons.xnb + }, + + "Immersive Farm 2": { + "ID": "zander.immersivefarm2", + "~2.0.1 | Status": "AssumeBroken" // references deleted Content/Mine.xnb + }, + + "Karmylla's Immersive Map Edits": { + "ID": "Karmylla.ImmersiveMapEdits", + "Default | UpdateKey": "Nexus:1149", + "~2.4 | Status": "AssumeBroken" // references deleted Content/weapons.xnb + }, + + "Secret Gardens Greenhouse": { + "ID": "jessebot.secretgardens", + "Default | UpdateKey": "Nexus:3067", + "~2.0.1 | Status": "AssumeBroken" // references deleted Content/Mine.xnb + }, /********* ** Broke circa SDV 1.3 @@ -420,6 +415,14 @@ "Yet Another Harvest With Scythe Mod": { "ID": "bcmpinc.HarvestWithScythe", "~0.6 | Status": "AssumeBroken" // breaks newer versions of bcmpinc mods (per bcmpinc's request) + }, + + /********* + ** Broke circa SDV 1.2 + *********/ + "Move Faster": { + "ID": "shuaiz.MoveFasterMod", + "~1.0.1 | Status": "AssumeBroken" // doesn't do anything as of SDV 1.2.33 (bad Harmony patch?) } } } diff --git a/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataModel.cs b/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataModel.cs index e2b3ec1d..d6f32132 100644 --- a/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataModel.cs +++ b/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataModel.cs @@ -20,13 +20,8 @@ namespace StardewModdingAPI.Toolkit.Framework.ModData /// /// This uses a custom format which uniquely identifies a mod across multiple versions and /// supports matching other fields if no ID was specified. This doesn't include the latest - /// ID, if any. Format rules: - /// 1. If the mod's ID changed over time, multiple variants can be separated by the - /// | character. - /// 2. Each variant can take one of two forms: - /// - A simple string matching the mod's UniqueID value. - /// - A JSON structure containing any of four manifest fields (ID, Name, Author, and - /// EntryDll) to match. + /// ID, if any. If the mod's ID changed over time, multiple variants can be separated by the + /// | character. /// public string FormerIDs { get; set; } -- cgit From 0d762faf603aac417a382ec680aaabdf7248493b Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 16 Mar 2019 22:17:58 -0400 Subject: add support for suppressing warnings in mod DB --- docs/release-notes.md | 9 ++++-- src/SMAPI/Framework/IModMetadata.cs | 4 +++ src/SMAPI/Framework/ModLoading/AssemblyLoader.cs | 1 + src/SMAPI/Framework/ModLoading/ModMetadata.cs | 9 ++++++ src/SMAPI/Framework/ModLoading/ModWarning.cs | 37 ---------------------- src/SMAPI/Framework/SCore.cs | 4 ++- src/SMAPI/StardewModdingAPI.csproj | 1 - .../Framework/ModData/ModDataModel.cs | 3 ++ .../Framework/ModData/ModDataRecord.cs | 4 +++ .../Framework/ModData/ModWarning.cs | 36 +++++++++++++++++++++ 10 files changed, 67 insertions(+), 41 deletions(-) delete mode 100644 src/SMAPI/Framework/ModLoading/ModWarning.cs create mode 100644 src/StardewModdingAPI.Toolkit/Framework/ModData/ModWarning.cs (limited to 'src/StardewModdingAPI.Toolkit/Framework') diff --git a/docs/release-notes.md b/docs/release-notes.md index bc3a4420..8f835497 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -2,17 +2,22 @@ ## Upcoming release These changes have not been released yet. +* For players: + * Updated game version check for the upcoming Stardew Valley 1.4. + * Updated compatibility list. + * For the web UI: * The log parser now hides some messages by default, like the mod list. * Fixed log parser column resize bug. +* For SMAPI developers: + * Added support for suppressing false-positive warnings for specific mods. + ## 2.11 Released 01 March 2019 for Stardew Valley 1.3.36. * For players: * Updated for Stardew Valley 1.3.36. - * Updated game version check for the upcoming Stardew Valley 1.4. - * Updated compatibility list. * For modders: * Bumped all deprecation levels to _pending removal_. diff --git a/src/SMAPI/Framework/IModMetadata.cs b/src/SMAPI/Framework/IModMetadata.cs index 7ada7dea..38514959 100644 --- a/src/SMAPI/Framework/IModMetadata.cs +++ b/src/SMAPI/Framework/IModMetadata.cs @@ -98,5 +98,9 @@ namespace StardewModdingAPI.Framework /// Whether the mod has at least one valid update key set. bool HasValidUpdateKeys(); + + /// Get whether the mod has a given warning and it hasn't been suppressed in the . + /// The warning to check. + bool HasUnsuppressWarning(ModWarning warning); } } diff --git a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs index 5e0571a0..878b3148 100644 --- a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs +++ b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs @@ -8,6 +8,7 @@ using Mono.Cecil.Cil; using StardewModdingAPI.Framework.Exceptions; using StardewModdingAPI.Internal; using StardewModdingAPI.Metadata; +using StardewModdingAPI.Toolkit.Framework.ModData; namespace StardewModdingAPI.Framework.ModLoading { diff --git a/src/SMAPI/Framework/ModLoading/ModMetadata.cs b/src/SMAPI/Framework/ModLoading/ModMetadata.cs index 0cb62a75..4ff021b7 100644 --- a/src/SMAPI/Framework/ModLoading/ModMetadata.cs +++ b/src/SMAPI/Framework/ModLoading/ModMetadata.cs @@ -179,5 +179,14 @@ namespace StardewModdingAPI.Framework.ModLoading { return this.GetUpdateKeys(validOnly: true).Any(); } + + /// Get whether the mod has a given warning and it hasn't been suppressed in the . + /// The warning to check. + public bool HasUnsuppressWarning(ModWarning warning) + { + return + this.Warnings.HasFlag(warning) + && (this.DataRecord?.DataRecord == null || !this.DataRecord.DataRecord.SuppressWarnings.HasFlag(warning)); + } } } diff --git a/src/SMAPI/Framework/ModLoading/ModWarning.cs b/src/SMAPI/Framework/ModLoading/ModWarning.cs deleted file mode 100644 index e643cb05..00000000 --- a/src/SMAPI/Framework/ModLoading/ModWarning.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using StardewModdingAPI.Events; - -namespace StardewModdingAPI.Framework.ModLoading -{ - /// Indicates a detected non-error mod issue. - [Flags] - internal enum ModWarning - { - /// No issues detected. - None = 0, - - /// SMAPI detected incompatible code in the mod, but was configured to load it anyway. - BrokenCodeLoaded = 1, - - /// The mod affects the save serializer in a way that may make saves unloadable without the mod. - ChangesSaveSerialiser = 2, - - /// The mod patches the game in a way that may impact stability. - PatchesGame = 4, - - /// The mod uses the dynamic keyword which won't work on Linux/Mac. - UsesDynamic = 8, - - /// The mod references or which may impact stability. - UsesUnvalidatedUpdateTick = 16, - - /// The mod has no update keys set. - NoUpdateKeys = 32, - - /// Uses .NET APIs for filesystem access. - AccessesFilesystem = 64, - - /// Uses .NET APIs for shell or process access. - AccessesShell = 128 - } -} diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index e0347eb2..9ffa46a5 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -1107,7 +1107,9 @@ namespace StardewModdingAPI.Framework // issue block format logic void LogWarningGroup(ModWarning warning, LogLevel logLevel, string heading, params string[] blurb) { - IModMetadata[] matches = modsWithWarnings.Where(p => p.Warnings.HasFlag(warning)).ToArray(); + IModMetadata[] matches = modsWithWarnings + .Where(mod => mod.HasUnsuppressWarning(warning)) + .ToArray(); if (!matches.Any()) return; diff --git a/src/SMAPI/StardewModdingAPI.csproj b/src/SMAPI/StardewModdingAPI.csproj index 6692bc02..b6562eca 100644 --- a/src/SMAPI/StardewModdingAPI.csproj +++ b/src/SMAPI/StardewModdingAPI.csproj @@ -228,7 +228,6 @@ - diff --git a/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataModel.cs b/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataModel.cs index d6f32132..18039762 100644 --- a/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataModel.cs +++ b/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataModel.cs @@ -31,6 +31,9 @@ namespace StardewModdingAPI.Toolkit.Framework.ModData /// Maps remote versions to a semantic version for update checks. public IDictionary MapRemoteVersions { get; set; } = new Dictionary(); + /// The mod warnings to suppress, even if they'd normally be shown. + public ModWarning SuppressWarnings { get; set; } + /// This field stores properties that aren't mapped to another field before they're parsed into . [JsonExtensionData] public IDictionary ExtensionData { get; set; } diff --git a/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataRecord.cs b/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataRecord.cs index 3949f7dc..794ad2e4 100644 --- a/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataRecord.cs +++ b/src/StardewModdingAPI.Toolkit/Framework/ModData/ModDataRecord.cs @@ -19,6 +19,9 @@ namespace StardewModdingAPI.Toolkit.Framework.ModData /// The former mod IDs (if any). public string[] FormerIDs { get; } + /// The mod warnings to suppress, even if they'd normally be shown. + public ModWarning SuppressWarnings { get; set; } + /// Maps local versions to a semantic version for update checks. public IDictionary MapLocalVersions { get; } @@ -40,6 +43,7 @@ namespace StardewModdingAPI.Toolkit.Framework.ModData this.DisplayName = displayName; this.ID = model.ID; this.FormerIDs = model.GetFormerIDs().ToArray(); + this.SuppressWarnings = model.SuppressWarnings; this.MapLocalVersions = new Dictionary(model.MapLocalVersions, StringComparer.InvariantCultureIgnoreCase); this.MapRemoteVersions = new Dictionary(model.MapRemoteVersions, StringComparer.InvariantCultureIgnoreCase); this.Fields = model.GetFields().ToArray(); diff --git a/src/StardewModdingAPI.Toolkit/Framework/ModData/ModWarning.cs b/src/StardewModdingAPI.Toolkit/Framework/ModData/ModWarning.cs new file mode 100644 index 00000000..d61c427f --- /dev/null +++ b/src/StardewModdingAPI.Toolkit/Framework/ModData/ModWarning.cs @@ -0,0 +1,36 @@ +using System; + +namespace StardewModdingAPI.Toolkit.Framework.ModData +{ + /// Indicates a detected non-error mod issue. + [Flags] + public enum ModWarning + { + /// No issues detected. + None = 0, + + /// SMAPI detected incompatible code in the mod, but was configured to load it anyway. + BrokenCodeLoaded = 1, + + /// The mod affects the save serializer in a way that may make saves unloadable without the mod. + ChangesSaveSerialiser = 2, + + /// The mod patches the game in a way that may impact stability. + PatchesGame = 4, + + /// The mod uses the dynamic keyword which won't work on Linux/Mac. + UsesDynamic = 8, + + /// The mod references specialised 'unvalided update tick' events which may impact stability. + UsesUnvalidatedUpdateTick = 16, + + /// The mod has no update keys set. + NoUpdateKeys = 32, + + /// Uses .NET APIs for filesystem access. + AccessesFilesystem = 64, + + /// Uses .NET APIs for shell or process access. + AccessesShell = 128 + } +} -- cgit