summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Framework/LogParsing/LogParser.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-12-20 22:35:58 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-12-20 22:35:58 -0500
commit77002d3e9965d9afa843a95129c6acb5d1c4a283 (patch)
treeb4f4a338945cd3f2cc5881e46fb0dd2b075a79ce /src/SMAPI.Web/Framework/LogParsing/LogParser.cs
parent1c70736c00e6e70f46f539cb26b5fd253f4eff3b (diff)
parent5e2f6f565d6ef5330ea2e8c6a5e796f937289255 (diff)
downloadSMAPI-77002d3e9965d9afa843a95129c6acb5d1c4a283.tar.gz
SMAPI-77002d3e9965d9afa843a95129c6acb5d1c4a283.tar.bz2
SMAPI-77002d3e9965d9afa843a95129c6acb5d1c4a283.zip
Merge branch 'stardew-valley-1.5' into develop
# Conflicts: # docs/release-notes.md
Diffstat (limited to 'src/SMAPI.Web/Framework/LogParsing/LogParser.cs')
-rw-r--r--src/SMAPI.Web/Framework/LogParsing/LogParser.cs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/SMAPI.Web/Framework/LogParsing/LogParser.cs b/src/SMAPI.Web/Framework/LogParsing/LogParser.cs
index 227dcd89..f69d4b6f 100644
--- a/src/SMAPI.Web/Framework/LogParsing/LogParser.cs
+++ b/src/SMAPI.Web/Framework/LogParsing/LogParser.cs
@@ -14,7 +14,7 @@ namespace StardewModdingAPI.Web.Framework.LogParsing
** Fields
*********/
/// <summary>A regex pattern matching the start of a SMAPI message.</summary>
- private readonly Regex MessageHeaderPattern = new Regex(@"^\[(?<time>\d\d[:\.]\d\d[:\.]\d\d) (?<level>[a-z]+) +(?<modName>[^\]]+)\] ", RegexOptions.Compiled | RegexOptions.IgnoreCase);
+ private readonly Regex MessageHeaderPattern = new Regex(@"^\[(?<time>\d\d[:\.]\d\d[:\.]\d\d) (?<level>[a-z]+)(?: +screen_(?<screen>\d+))? +(?<modName>[^\]]+)\] ", RegexOptions.Compiled | RegexOptions.IgnoreCase);
/// <summary>A regex pattern matching SMAPI's initial platform info message.</summary>
private readonly Regex InfoLinePattern = new Regex(@"^SMAPI (?<apiVersion>.+) with Stardew Valley (?<gameVersion>.+) on (?<os>.+)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
@@ -304,9 +304,11 @@ namespace StardewModdingAPI.Web.Framework.LogParsing
builder.Clear();
}
+ var screenGroup = header.Groups["screen"];
builder.Start(
time: header.Groups["time"].Value,
level: Enum.Parse<LogLevel>(header.Groups["level"].Value, ignoreCase: true),
+ screenId: screenGroup.Success ? int.Parse(screenGroup.Value) : 0, // main player is always screen ID 0
mod: header.Groups["modName"].Value,
text: line.Substring(header.Length)
);