diff options
Diffstat (limited to 'src/SMAPI.Web/Framework/LogParsing')
-rw-r--r-- | src/SMAPI.Web/Framework/LogParsing/LogParser.cs | 9 | ||||
-rw-r--r-- | src/SMAPI.Web/Framework/LogParsing/Models/ParsedLog.cs | 3 |
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; } |