diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-03-30 19:43:10 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-03-30 19:43:10 -0400 |
commit | 7175e9f8ee24a88a41f453fad500a19b9bbebeba (patch) | |
tree | 1489c67c3509d5dc0865e39bca8a618410306003 | |
parent | df1e748629f7ed5f150daba6fd83f5cf576a97b7 (diff) | |
download | SMAPI-7175e9f8ee24a88a41f453fad500a19b9bbebeba.tar.gz SMAPI-7175e9f8ee24a88a41f453fad500a19b9bbebeba.tar.bz2 SMAPI-7175e9f8ee24a88a41f453fad500a19b9bbebeba.zip |
add upper version check (#258)
-rw-r--r-- | src/StardewModdingAPI/Constants.cs | 5 | ||||
-rw-r--r-- | src/StardewModdingAPI/Program.cs | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/StardewModdingAPI/Constants.cs b/src/StardewModdingAPI/Constants.cs index 3762269d..37fa4d31 100644 --- a/src/StardewModdingAPI/Constants.cs +++ b/src/StardewModdingAPI/Constants.cs @@ -36,7 +36,10 @@ namespace StardewModdingAPI public static ISemanticVersion ApiVersion { get; } = new SemanticVersion(1, 9, 0); /// <summary>The minimum supported version of Stardew Valley.</summary> - public static ISemanticVersion MinimumGameVersion { get; } = new SemanticVersion("1.1.1"); + public static ISemanticVersion MinimumGameVersion { get; } = new SemanticVersion("1.1"); + + /// <summary>The maximum supported version of Stardew Valley.</summary> + public static ISemanticVersion MaximumGameVersion { get; } = new SemanticVersion("1.1.1"); /// <summary>The path to the game folder.</summary> public static string ExecutionPath { get; } = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); diff --git a/src/StardewModdingAPI/Program.cs b/src/StardewModdingAPI/Program.cs index e11f411e..90839216 100644 --- a/src/StardewModdingAPI/Program.cs +++ b/src/StardewModdingAPI/Program.cs @@ -131,7 +131,13 @@ namespace StardewModdingAPI // verify version if (Constants.GameVersion.IsOlderThan(Constants.MinimumGameVersion)) { - this.Monitor.Log($"Oops! You're running Stardew Valley {Constants.GameDisplayVersion}, but the oldest supported version is {Constants.MinimumGameVersion}. Please update your game before using SMAPI. If you're on the Steam beta channel, note that the beta channel may not receive the latest updates.", LogLevel.Error); + this.Monitor.Log($"Oops! You're running Stardew Valley {Constants.GameDisplayVersion}, but the oldest supported version is {Constants.MinimumGameVersion}. Please update your game before using SMAPI. If you have the beta version on Steam, you may need to opt out to get the latest non-beta updates.", LogLevel.Error); + this.PressAnyKeyToExit(); + return; + } + if (Constants.MaximumGameVersion != null && Constants.GameVersion.IsNewerThan(Constants.MaximumGameVersion)) + { + this.Monitor.Log($"Oops! You're running Stardew Valley {Constants.GameDisplayVersion}, but this version of SMAPI is only compatible up to Stardew Valley {Constants.MaximumGameVersion}. Please check for a newer version of SMAPI.", LogLevel.Error); this.PressAnyKeyToExit(); return; } |