From 43a4194a5c23b5896f9b639673693a4a2a73ca8d Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 6 Jan 2017 14:59:55 -0500 Subject: remove unofficial patch links for officially-updated CJB mods --- src/StardewModdingAPI/StardewModdingAPI.data.json | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/StardewModdingAPI/StardewModdingAPI.data.json') diff --git a/src/StardewModdingAPI/StardewModdingAPI.data.json b/src/StardewModdingAPI/StardewModdingAPI.data.json index 49b45018..f350e8c5 100644 --- a/src/StardewModdingAPI/StardewModdingAPI.data.json +++ b/src/StardewModdingAPI/StardewModdingAPI.data.json @@ -27,7 +27,6 @@ This file contains advanced metadata for SMAPI. You shouldn't change this file. "Name": "CJB Cheats Menu", "Version": "1.12", "UpdateUrl": "http://www.nexusmods.com/stardewvalley/mods/4", - "UnofficialUpdateUrl": "http://community.playstarbound.com/threads/125031", "ForceCompatibleVersion": "^1.12-EntoPatch" }, { @@ -35,7 +34,6 @@ This file contains advanced metadata for SMAPI. You shouldn't change this file. "Name": "CJB Item Spawner", "Version": "1.5", "UpdateUrl": "http://www.nexusmods.com/stardewvalley/mods/93", - "UnofficialUpdateUrl": "http://community.playstarbound.com/threads/125031", "ForceCompatibleVersion": "^1.5-EntoPatch" } ] -- cgit From 40bc8f57c71d12d49bad24074cfe3279efe12850 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 14 Jan 2017 00:59:19 -0500 Subject: add support for incompatible mod version ranges --- release-notes.md | 3 +++ .../Framework/Models/IncompatibleMod.cs | 18 ++++++++++++------ src/StardewModdingAPI/Program.cs | 2 +- src/StardewModdingAPI/StardewModdingAPI.data.json | 10 +++++----- 4 files changed, 21 insertions(+), 12 deletions(-) (limited to 'src/StardewModdingAPI/StardewModdingAPI.data.json') diff --git a/release-notes.md b/release-notes.md index 6cedbc4f..6c667c31 100644 --- a/release-notes.md +++ b/release-notes.md @@ -8,6 +8,9 @@ For players: * Fixed issue where SMAPI couldn't be launched from Steam for some Linux players. * Updated list of incompatible mods. +For SMAPI developers: + * Added support for specifying a lower bound in mod incompatibility data. + ## 1.5 See [log](https://github.com/Pathoschild/SMAPI/compare/1.4...1.5). diff --git a/src/StardewModdingAPI/Framework/Models/IncompatibleMod.cs b/src/StardewModdingAPI/Framework/Models/IncompatibleMod.cs index 9bf06552..bcc62bb4 100644 --- a/src/StardewModdingAPI/Framework/Models/IncompatibleMod.cs +++ b/src/StardewModdingAPI/Framework/Models/IncompatibleMod.cs @@ -14,8 +14,11 @@ namespace StardewModdingAPI.Framework.Models /// The mod name. public string Name { get; set; } + /// The oldest incompatible mod version, or null for all past versions. + public string LowerVersion { get; set; } + /// The most recent incompatible mod version. - public string Version { get; set; } + public string UpperVersion { get; set; } /// The URL the user can check for an official updated version. public string UpdateUrl { get; set; } @@ -23,7 +26,7 @@ namespace StardewModdingAPI.Framework.Models /// The URL the user can check for an unofficial updated version. public string UnofficialUpdateUrl { get; set; } - /// A regular expression matching version strings to consider compatible, even if they technically precede . + /// A regular expression matching version strings to consider compatible, even if they technically precede . public string ForceCompatibleVersion { get; set; } @@ -34,14 +37,17 @@ namespace StardewModdingAPI.Framework.Models /// The current version of the matching mod. public bool IsCompatible(ISemanticVersion version) { - ISemanticVersion incompatibleVersion = new SemanticVersion(this.Version); + ISemanticVersion lowerVersion = this.LowerVersion != null ? new SemanticVersion(this.LowerVersion) : null; + ISemanticVersion upperVersion = new SemanticVersion(this.UpperVersion); - // allow newer versions - if (version.IsNewerThan(incompatibleVersion)) + // ignore versions not in range + if (lowerVersion != null && version.IsOlderThan(lowerVersion)) + return true; + if (version.IsNewerThan(upperVersion)) return true; // allow versions matching override return !string.IsNullOrWhiteSpace(this.ForceCompatibleVersion) && Regex.IsMatch(version.ToString(), this.ForceCompatibleVersion, RegexOptions.IgnoreCase); } } -} \ No newline at end of file +} diff --git a/src/StardewModdingAPI/Program.cs b/src/StardewModdingAPI/Program.cs index 58dbd87d..9d08c823 100644 --- a/src/StardewModdingAPI/Program.cs +++ b/src/StardewModdingAPI/Program.cs @@ -402,7 +402,7 @@ namespace StardewModdingAPI { if (!compatibility.IsCompatible(manifest.Version)) { - string warning = $"Skipped {compatibility.Name} ≤v{compatibility.Version} because this version is not compatible with the latest version of the game. Please check for a newer version of the mod here:"; + string warning = $"Skipped {compatibility.Name} {manifest.Version} because this version is not compatible with the latest version of the game. Please check for a newer version of the mod here:"; if (!string.IsNullOrWhiteSpace(compatibility.UpdateUrl)) warning += $"{Environment.NewLine}- official mod: {compatibility.UpdateUrl}"; if (!string.IsNullOrWhiteSpace(compatibility.UnofficialUpdateUrl)) diff --git a/src/StardewModdingAPI/StardewModdingAPI.data.json b/src/StardewModdingAPI/StardewModdingAPI.data.json index f350e8c5..464286af 100644 --- a/src/StardewModdingAPI/StardewModdingAPI.data.json +++ b/src/StardewModdingAPI/StardewModdingAPI.data.json @@ -9,15 +9,15 @@ This file contains advanced metadata for SMAPI. You shouldn't change this file. { "ID": "SPDSprinklersMod", "Name": "Better Sprinklers", - "Version": "2.1", + "UpperVersion": "2.1", "UpdateUrl": "http://www.nexusmods.com/stardewvalley/mods/41", "UnofficialUpdateUrl": "http://community.playstarbound.com/threads/125031", - "ForceCompatibleVersion": "^2.1-EntoPatch" + "ForceCompatibleVersion": "^2.1-EntoPatch" }, { "ID": "SPDChestLabel", "Name": "Chest Label System", - "Version": "1.5", + "UpperVersion": "1.5", "UpdateUrl": "http://www.nexusmods.com/stardewvalley/mods/242", "UnofficialUpdateUrl": "http://community.playstarbound.com/threads/125031", "ForceCompatibleVersion": "^1.5-EntoPatch" @@ -25,14 +25,14 @@ This file contains advanced metadata for SMAPI. You shouldn't change this file. { "ID": "CJBCheatsMenu", "Name": "CJB Cheats Menu", - "Version": "1.12", + "UpperVersion": "1.12", "UpdateUrl": "http://www.nexusmods.com/stardewvalley/mods/4", "ForceCompatibleVersion": "^1.12-EntoPatch" }, { "ID": "CJBItemSpawner", "Name": "CJB Item Spawner", - "Version": "1.5", + "UpperVersion": "1.5", "UpdateUrl": "http://www.nexusmods.com/stardewvalley/mods/93", "ForceCompatibleVersion": "^1.5-EntoPatch" } -- cgit From 8e8cda87fb45ee621b4381205db72b7d32a24401 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 14 Jan 2017 01:11:57 -0500 Subject: mark NPC Map Locations 1.43 incompatible due to update error --- src/StardewModdingAPI/StardewModdingAPI.data.json | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/StardewModdingAPI/StardewModdingAPI.data.json') diff --git a/src/StardewModdingAPI/StardewModdingAPI.data.json b/src/StardewModdingAPI/StardewModdingAPI.data.json index 464286af..5ac315a5 100644 --- a/src/StardewModdingAPI/StardewModdingAPI.data.json +++ b/src/StardewModdingAPI/StardewModdingAPI.data.json @@ -6,6 +6,7 @@ This file contains advanced metadata for SMAPI. You shouldn't change this file. */ [ + /* versions not compatible with Stardew Valley 1.1+ */ { "ID": "SPDSprinklersMod", "Name": "Better Sprinklers", @@ -35,5 +36,15 @@ This file contains advanced metadata for SMAPI. You shouldn't change this file. "UpperVersion": "1.5", "UpdateUrl": "http://www.nexusmods.com/stardewvalley/mods/93", "ForceCompatibleVersion": "^1.5-EntoPatch" + }, + + /* versions which crash the game */ + { + "ID": "NPCMapLocationsMod", + "Name": "NPC Map Locations", + "LowerVersion": "1.43", + "UpperVersion": "1.43", + "UpdateUrl": "http://www.nexusmods.com/stardewvalley/mods/239", + "ReasonPhrase": "this version has an update check error which crashes the game" } ] -- cgit From 5c8e7f5d9315da87ca9f6556ec9f759ed753d6e5 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 15 Jan 2017 18:20:50 -0500 Subject: mark NPC Locations Map 1.42 incompatible due to update-check bug --- src/StardewModdingAPI/StardewModdingAPI.data.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/StardewModdingAPI/StardewModdingAPI.data.json') diff --git a/src/StardewModdingAPI/StardewModdingAPI.data.json b/src/StardewModdingAPI/StardewModdingAPI.data.json index 5ac315a5..3295336f 100644 --- a/src/StardewModdingAPI/StardewModdingAPI.data.json +++ b/src/StardewModdingAPI/StardewModdingAPI.data.json @@ -42,7 +42,7 @@ This file contains advanced metadata for SMAPI. You shouldn't change this file. { "ID": "NPCMapLocationsMod", "Name": "NPC Map Locations", - "LowerVersion": "1.43", + "LowerVersion": "1.42", "UpperVersion": "1.43", "UpdateUrl": "http://www.nexusmods.com/stardewvalley/mods/239", "ReasonPhrase": "this version has an update check error which crashes the game" -- cgit