summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Framework/LogParsing
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-10-09 16:59:05 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-10-09 16:59:05 -0400
commit9a15da5a173e5e218c16e2e4ef0af0c98968e1cb (patch)
tree0601c05b5fce5d648b92237878df8eb2cae1be7f /src/SMAPI.Web/Framework/LogParsing
parent42ff20cd92a3a28faca8de0c309396efa147f0e2 (diff)
downloadSMAPI-9a15da5a173e5e218c16e2e4ef0af0c98968e1cb.tar.gz
SMAPI-9a15da5a173e5e218c16e2e4ef0af0c98968e1cb.tar.bz2
SMAPI-9a15da5a173e5e218c16e2e4ef0af0c98968e1cb.zip
add 'strict mode' release with deprecated APIs stripped out
Diffstat (limited to 'src/SMAPI.Web/Framework/LogParsing')
-rw-r--r--src/SMAPI.Web/Framework/LogParsing/LogParser.cs9
-rw-r--r--src/SMAPI.Web/Framework/LogParsing/Models/ParsedLog.cs3
2 files changed, 11 insertions, 1 deletions
diff --git a/src/SMAPI.Web/Framework/LogParsing/LogParser.cs b/src/SMAPI.Web/Framework/LogParsing/LogParser.cs
index 18ba754c..5e0dedf3 100644
--- a/src/SMAPI.Web/Framework/LogParsing/LogParser.cs
+++ b/src/SMAPI.Web/Framework/LogParsing/LogParser.cs
@@ -199,8 +199,15 @@ namespace StardewModdingAPI.Web.Framework.LogParsing
log.ApiVersion = match.Groups["apiVersion"].Value;
log.GameVersion = match.Groups["gameVersion"].Value;
log.OperatingSystem = match.Groups["os"].Value;
- smapiMod.OverrideVersion(log.ApiVersion);
+ const string strictModeSuffix = " (strict mode)";
+ if (log.ApiVersion.EndsWith(strictModeSuffix))
+ {
+ log.IsStrictMode = true;
+ log.ApiVersion = log.ApiVersion[..^strictModeSuffix.Length];
+ }
+
+ smapiMod.OverrideVersion(log.ApiVersion);
log.ApiVersionParsed = smapiMod.GetParsedVersion();
}
diff --git a/src/SMAPI.Web/Framework/LogParsing/Models/ParsedLog.cs b/src/SMAPI.Web/Framework/LogParsing/Models/ParsedLog.cs
index 3f649199..cda0f653 100644
--- a/src/SMAPI.Web/Framework/LogParsing/Models/ParsedLog.cs
+++ b/src/SMAPI.Web/Framework/LogParsing/Models/ParsedLog.cs
@@ -25,6 +25,9 @@ namespace StardewModdingAPI.Web.Framework.LogParsing.Models
/****
** Log data
****/
+ /// <summary>Whether SMAPI is running in strict mode, which disables all deprecated APIs.</summary>
+ public bool IsStrictMode { get; set; }
+
/// <summary>The SMAPI version.</summary>
public string? ApiVersion { get; set; }