summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-12-02 22:48:00 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-12-02 22:48:00 -0500
commitd34f369d35290bca96cc7225d9765d1a8a66fa8b (patch)
tree141bc6b30760bf5745b7adb9ce60f0cf6c8fa720 /src/SMAPI/Framework
parenta3f21685049cabf2d824c8060dc0b1de47e9449e (diff)
parent1128451acf56cf479864047c0bb8bb18e232fa00 (diff)
downloadSMAPI-d34f369d35290bca96cc7225d9765d1a8a66fa8b.tar.gz
SMAPI-d34f369d35290bca96cc7225d9765d1a8a66fa8b.tar.bz2
SMAPI-d34f369d35290bca96cc7225d9765d1a8a66fa8b.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI/Framework')
-rw-r--r--src/SMAPI/Framework/GameVersion.cs20
-rw-r--r--src/SMAPI/Framework/ModLoading/ModResolver.cs2
-rw-r--r--src/SMAPI/Framework/Models/SConfig.cs2
-rw-r--r--src/SMAPI/Framework/SCore.cs4
4 files changed, 21 insertions, 7 deletions
diff --git a/src/SMAPI/Framework/GameVersion.cs b/src/SMAPI/Framework/GameVersion.cs
index cd88895c..29cfbc39 100644
--- a/src/SMAPI/Framework/GameVersion.cs
+++ b/src/SMAPI/Framework/GameVersion.cs
@@ -52,20 +52,34 @@ namespace StardewModdingAPI.Framework
/// <param name="gameVersion">The game version string.</param>
private static string GetSemanticVersionString(string gameVersion)
{
- return GameVersion.VersionMap.TryGetValue(gameVersion, out string semanticVersion)
- ? semanticVersion
- : gameVersion;
+ // mapped version
+ if (GameVersion.VersionMap.TryGetValue(gameVersion, out string semanticVersion))
+ return semanticVersion;
+
+ // special case: four-part versions
+ string[] parts = gameVersion.Split('.');
+ if (parts.Length == 4)
+ return $"{parts[0]}.{parts[1]}.{parts[2]}+{parts[3]}";
+
+ return gameVersion;
}
/// <summary>Convert a semantic version string to the equivalent game version string.</summary>
/// <param name="semanticVersion">The semantic version string.</param>
private static string GetGameVersionString(string semanticVersion)
{
+ // mapped versions
foreach (var mapping in GameVersion.VersionMap)
{
if (mapping.Value.Equals(semanticVersion, StringComparison.InvariantCultureIgnoreCase))
return mapping.Key;
}
+
+ // special case: four-part versions
+ string[] parts = semanticVersion.Split('.', '+');
+ if (parts.Length == 4)
+ return $"{parts[0]}.{parts[1]}.{parts[2]}.{parts[3]}";
+
return semanticVersion;
}
}
diff --git a/src/SMAPI/Framework/ModLoading/ModResolver.cs b/src/SMAPI/Framework/ModLoading/ModResolver.cs
index 5ea21710..e73bc47d 100644
--- a/src/SMAPI/Framework/ModLoading/ModResolver.cs
+++ b/src/SMAPI/Framework/ModLoading/ModResolver.cs
@@ -87,7 +87,7 @@ namespace StardewModdingAPI.Framework.ModLoading
updateUrls.Add(mod.DataRecord.AlternativeUrl);
// default update URL
- updateUrls.Add("https://mods.smapi.io");
+ updateUrls.Add("https://smapi.io/mods");
// build error
string error = $"{reasonPhrase}. Please check for a ";
diff --git a/src/SMAPI/Framework/Models/SConfig.cs b/src/SMAPI/Framework/Models/SConfig.cs
index b778af5d..53939f8c 100644
--- a/src/SMAPI/Framework/Models/SConfig.cs
+++ b/src/SMAPI/Framework/Models/SConfig.cs
@@ -23,7 +23,7 @@ namespace StardewModdingAPI.Framework.Models
#endif
[nameof(UseBetaChannel)] = Constants.ApiVersion.IsPrerelease(),
[nameof(GitHubProjectName)] = "Pathoschild/SMAPI",
- [nameof(WebApiBaseUrl)] = "https://api.smapi.io",
+ [nameof(WebApiBaseUrl)] = "https://smapi.io/api/",
[nameof(VerboseLogging)] = false,
[nameof(LogNetworkTraffic)] = false,
[nameof(DumpMetadata)] = false
diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs
index afb82679..f1873391 100644
--- a/src/SMAPI/Framework/SCore.cs
+++ b/src/SMAPI/Framework/SCore.cs
@@ -299,7 +299,7 @@ namespace StardewModdingAPI.Framework
if (File.Exists(Constants.FatalCrashMarker))
{
this.Monitor.Log("The game crashed last time you played. That can be due to bugs in the game, but if it happens repeatedly you can ask for help here: https://community.playstarbound.com/threads/108375/.", LogLevel.Error);
- this.Monitor.Log("If you ask for help, make sure to share your SMAPI log: https://log.smapi.io.", LogLevel.Error);
+ this.Monitor.Log("If you ask for help, make sure to share your SMAPI log: https://smapi.io/log.", LogLevel.Error);
this.Monitor.Log("Press any key to delete the crash data and continue playing.", LogLevel.Info);
Console.ReadKey();
File.Delete(Constants.FatalCrashLog);
@@ -962,7 +962,7 @@ namespace StardewModdingAPI.Framework
}
catch (IncompatibleInstructionException) // details already in trace logs
{
- string[] updateUrls = new[] { modDatabase.GetModPageUrlFor(manifest.UniqueID), "https://mods.smapi.io" }.Where(p => p != null).ToArray();
+ string[] updateUrls = new[] { modDatabase.GetModPageUrlFor(manifest.UniqueID), "https://smapi.io/mods" }.Where(p => p != null).ToArray();
errorReasonPhrase = $"it's no longer compatible. Please check for a new version at {string.Join(" or ", updateUrls)}";
return false;
}