diff --git a/loginspect/LogInspect/LogInspect/Modules/LogCommandModule.cs b/loginspect/LogInspect/LogInspect/Modules/LogCommandModule.cs index 2a65ae4..0f8537f 100644 --- a/loginspect/LogInspect/LogInspect/Modules/LogCommandModule.cs +++ b/loginspect/LogInspect/LogInspect/Modules/LogCommandModule.cs @@ -136,7 +136,12 @@ private string GeneratePageOne(string[] lines, int stacktraceAmount) { minecraftVersion = versionLines[0].Split("]").Last().Split(": ").Last(); - timeCreated = lines[0].Split("]").First().Replace("[", "").Trim(); + var timeCreatedMatch = LatestLogTimeCreatedRegex().Match(lines[0]); + + if (timeCreatedMatch.Success) + { + timeCreated = timeCreatedMatch.Value; + } } else { @@ -146,8 +151,7 @@ private string GeneratePageOne(string[] lines, int stacktraceAmount) { minecraftVersion = versionLines[0].Split("--version, ").Last().Split(", ").First(); - var secondLine = lines[1]; - timeCreated = secondLine.Split(",").First(); + timeCreated = lines[4].Split("]").First().Replace("[", "").Trim(); } } @@ -205,4 +209,7 @@ private string GeneratePageOne(string[] lines, int stacktraceAmount) return string.Join("\n", newLines); } + + [GeneratedRegex(@"\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}")] + private static partial Regex LatestLogTimeCreatedRegex(); } \ No newline at end of file