From 03c3ab3711c18f6b2bedfd02932b47bf368e1b82 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 22 Feb 2020 10:39:54 -0500 Subject: update SMAPI/game version mapping, add older versions --- src/SMAPI/Constants.cs | 53 ++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 10 deletions(-) (limited to 'src/SMAPI') diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs index 201d3166..443ca7a6 100644 --- a/src/SMAPI/Constants.cs +++ b/src/SMAPI/Constants.cs @@ -115,26 +115,59 @@ namespace StardewModdingAPI /// Returns the compatible SMAPI version, or null if none was found. internal static ISemanticVersion GetCompatibleApiVersion(ISemanticVersion version) { + // This covers all officially supported public game updates. It might seem like version + // ranges would be better, but the given SMAPI versions may not be compatible with + // intermediate unlisted versions (e.g. private beta updates). + // + // Nonstandard versions are normalized by GameVersion (e.g. 1.07 => 1.0.7). switch (version.ToString()) { + case "1.4.1": + case "1.4.0": + return new SemanticVersion("3.0.1"); + case "1.3.36": - return new SemanticVersion(2, 11, 2); + return new SemanticVersion("2.11.2"); - case "1.3.32": case "1.3.33": - return new SemanticVersion(2, 10, 2); + case "1.3.32": + return new SemanticVersion("2.10.2"); case "1.3.28": - return new SemanticVersion(2, 7, 0); + return new SemanticVersion("2.7.0"); - case "1.2.30": - case "1.2.31": - case "1.2.32": case "1.2.33": - return new SemanticVersion(2, 5, 5); - } + case "1.2.32": + case "1.2.31": + case "1.2.30": + return new SemanticVersion("2.5.5"); + + case "1.2.29": + case "1.2.28": + case "1.2.27": + case "1.2.26": + return new SemanticVersion("1.13.1"); + + case "1.1.1": + case "1.1.0": + return new SemanticVersion("1.9.0"); + + case "1.0.7.1": + case "1.0.7": + case "1.0.6": + case "1.0.5.2": + case "1.0.5.1": + case "1.0.5": + case "1.0.4": + case "1.0.3": + case "1.0.2": + case "1.0.1": + case "1.0.0": + return new SemanticVersion("0.40.0"); - return null; + default: + return null; + } } /// Get metadata for mapping assemblies to the current platform. -- cgit