From ff342d0ee7b3a4068268ae8b774038baa9b52f70 Mon Sep 17 00:00:00 2001 From: Matthias Neid Date: Mon, 17 Jun 2024 14:54:44 +0200 Subject: [PATCH] added network protocol error reports, add general reports for common parts with crash reports --- lang/en.json | 1 + .../MinecraftCrashReportAnalyser.php | 25 - .../CrashReport/FabricCrashReportAnalyser.php | 2 +- .../CrashReport/ForgeCrashReportAnalyser.php | 2 +- .../MinecraftCrashReportAnalyser.php | 22 + .../NeoForgeCrashReportAnalyser.php | 2 +- .../CrashReport/QuiltCrashReportAnalyser.php | 2 +- .../Report/MinecraftReportAnalyser.php | 16 + ...raftNetworkProtocolErrorReportAnalyser.php | 10 + src/Detective/Detective.php | 3 + src/Log/Minecraft/MinecraftLog.php | 2 + .../Vanilla/Fabric/FabricCrashReportLog.php | 4 +- .../Vanilla/Forge/ForgeCrashReportLog.php | 4 +- .../NeoForge/NeoForgeCrashReportLog.php | 4 +- .../Vanilla/Quilt/QuiltCrashReportLog.php | 5 +- .../Vanilla/VanillaCrashReportLog.php | 2 +- .../Vanilla/VanillaCrashReportTrait.php | 11 +- .../VanillaNetworkProtocolErrorReportLog.php | 20 + ...VanillaNetworkProtocolErrorReportTrait.php | 18 + .../Minecraft/Vanilla/VanillaReportLog.php | 10 + .../Minecraft/Vanilla/VanillaReportTrait.php | 16 + src/Log/Type/CrashReportLogTypeInterface.php | 2 +- ...orkProtocolErrorReportLogTypeInterface.php | 13 + src/Log/Type/ReportLogTypeInterface.php | 13 + .../{CrashReportLevel.php => ReportLevel.php} | 22 +- ...CrashReportParser.php => ReportParser.php} | 6 +- ...vanilla-network-protocol-error-report.json | 1170 +++++++++++++++++ .../vanilla-network-protocol-error-report.log | 102 ++ test/tests/Logs/AutoLogsTest.php | 20 + 29 files changed, 1466 insertions(+), 63 deletions(-) delete mode 100644 src/Analyser/CrashReport/MinecraftCrashReportAnalyser.php rename src/Analyser/{ => Report}/CrashReport/FabricCrashReportAnalyser.php (87%) rename src/Analyser/{ => Report}/CrashReport/ForgeCrashReportAnalyser.php (87%) create mode 100644 src/Analyser/Report/CrashReport/MinecraftCrashReportAnalyser.php rename src/Analyser/{ => Report}/CrashReport/NeoForgeCrashReportAnalyser.php (83%) rename src/Analyser/{ => Report}/CrashReport/QuiltCrashReportAnalyser.php (74%) create mode 100644 src/Analyser/Report/MinecraftReportAnalyser.php create mode 100644 src/Analyser/Report/NetworkProtocolErrorReport/MinecraftNetworkProtocolErrorReportAnalyser.php create mode 100644 src/Log/Minecraft/Vanilla/VanillaNetworkProtocolErrorReportLog.php create mode 100644 src/Log/Minecraft/Vanilla/VanillaNetworkProtocolErrorReportTrait.php create mode 100644 src/Log/Minecraft/Vanilla/VanillaReportLog.php create mode 100644 src/Log/Minecraft/Vanilla/VanillaReportTrait.php create mode 100644 src/Log/Type/NetworkProtocolErrorReportLogTypeInterface.php create mode 100644 src/Log/Type/ReportLogTypeInterface.php rename src/Parser/{CrashReportLevel.php => ReportLevel.php} (59%) rename src/Parser/{CrashReportParser.php => ReportParser.php} (87%) create mode 100644 test/data/Vanilla/vanilla-network-protocol-error-report.json create mode 100644 test/data/Vanilla/vanilla-network-protocol-error-report.log diff --git a/lang/en.json b/lang/en.json index 7af52d2c..54e7b1af 100644 --- a/lang/en.json +++ b/lang/en.json @@ -83,6 +83,7 @@ "type-proxy": "Proxy Log", "type-content": "Content Log", "type-crash-report": "Crash Report", + "type-network-protocol-error-report": "Network Protocol Error Report", "type-unknown": "Unknown Log", "forge-language-provider-version-problem": "The mod '{{mod-file}}' requires '{{required-version}}', but '{{found-version}}' is installed." } diff --git a/src/Analyser/CrashReport/MinecraftCrashReportAnalyser.php b/src/Analyser/CrashReport/MinecraftCrashReportAnalyser.php deleted file mode 100644 index a37a0ce6..00000000 --- a/src/Analyser/CrashReport/MinecraftCrashReportAnalyser.php +++ /dev/null @@ -1,25 +0,0 @@ -addPossibleInsightClass(VanillaVersionInformation::class); - $this->addPossibleInsightClass(TickingEntityProblem::class); - $this->addPossibleInsightClass(TickingBlockEntityProblem::class); - $this->addPossibleInsightClass(JavaVersionInformation::class); - } -} \ No newline at end of file diff --git a/src/Analyser/CrashReport/FabricCrashReportAnalyser.php b/src/Analyser/Report/CrashReport/FabricCrashReportAnalyser.php similarity index 87% rename from src/Analyser/CrashReport/FabricCrashReportAnalyser.php rename to src/Analyser/Report/CrashReport/FabricCrashReportAnalyser.php index 4f0b6729..32337d30 100644 --- a/src/Analyser/CrashReport/FabricCrashReportAnalyser.php +++ b/src/Analyser/Report/CrashReport/FabricCrashReportAnalyser.php @@ -1,6 +1,6 @@ addPossibleInsightClass(TickingEntityProblem::class); + $this->addPossibleInsightClass(TickingBlockEntityProblem::class); + } +} \ No newline at end of file diff --git a/src/Analyser/CrashReport/NeoForgeCrashReportAnalyser.php b/src/Analyser/Report/CrashReport/NeoForgeCrashReportAnalyser.php similarity index 83% rename from src/Analyser/CrashReport/NeoForgeCrashReportAnalyser.php rename to src/Analyser/Report/CrashReport/NeoForgeCrashReportAnalyser.php index 480a0408..0b6dbf93 100644 --- a/src/Analyser/CrashReport/NeoForgeCrashReportAnalyser.php +++ b/src/Analyser/Report/CrashReport/NeoForgeCrashReportAnalyser.php @@ -1,6 +1,6 @@ addPossibleInsightClass(VanillaVersionInformation::class); + $this->addPossibleInsightClass(JavaVersionInformation::class); + } +} \ No newline at end of file diff --git a/src/Analyser/Report/NetworkProtocolErrorReport/MinecraftNetworkProtocolErrorReportAnalyser.php b/src/Analyser/Report/NetworkProtocolErrorReport/MinecraftNetworkProtocolErrorReportAnalyser.php new file mode 100644 index 00000000..b500a044 --- /dev/null +++ b/src/Analyser/Report/NetworkProtocolErrorReport/MinecraftNetworkProtocolErrorReportAnalyser.php @@ -0,0 +1,10 @@ + "client", $this instanceof ProxyLogTypeInterface => "proxy", $this instanceof CrashReportLogTypeInterface => "crash-report", + $this instanceof NetworkProtocolErrorReportLogTypeInterface => "network-protocol-error-report", $this instanceof ContentLogTypeInterface => "content", default => null }; diff --git a/src/Log/Minecraft/Vanilla/Fabric/FabricCrashReportLog.php b/src/Log/Minecraft/Vanilla/Fabric/FabricCrashReportLog.php index fd176c0b..436c73d5 100644 --- a/src/Log/Minecraft/Vanilla/Fabric/FabricCrashReportLog.php +++ b/src/Log/Minecraft/Vanilla/Fabric/FabricCrashReportLog.php @@ -4,8 +4,8 @@ use Aternos\Codex\Detective\DetectorInterface; use Aternos\Codex\Detective\SinglePatternDetector; -use Aternos\Codex\Minecraft\Analyser\CrashReport\FabricCrashReportAnalyser; -use Aternos\Codex\Minecraft\Analyser\CrashReport\MinecraftCrashReportAnalyser; +use Aternos\Codex\Minecraft\Analyser\Report\CrashReport\FabricCrashReportAnalyser; +use Aternos\Codex\Minecraft\Analyser\Report\CrashReport\MinecraftCrashReportAnalyser; use Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\VanillaCrashReportTrait; use Aternos\Codex\Minecraft\Log\Type\CrashReportLogTypeInterface; diff --git a/src/Log/Minecraft/Vanilla/Forge/ForgeCrashReportLog.php b/src/Log/Minecraft/Vanilla/Forge/ForgeCrashReportLog.php index 0bec677c..f21d0dfb 100644 --- a/src/Log/Minecraft/Vanilla/Forge/ForgeCrashReportLog.php +++ b/src/Log/Minecraft/Vanilla/Forge/ForgeCrashReportLog.php @@ -4,8 +4,8 @@ use Aternos\Codex\Detective\DetectorInterface; use Aternos\Codex\Detective\SinglePatternDetector; -use Aternos\Codex\Minecraft\Analyser\CrashReport\ForgeCrashReportAnalyser; -use Aternos\Codex\Minecraft\Analyser\CrashReport\MinecraftCrashReportAnalyser; +use Aternos\Codex\Minecraft\Analyser\Report\CrashReport\ForgeCrashReportAnalyser; +use Aternos\Codex\Minecraft\Analyser\Report\CrashReport\MinecraftCrashReportAnalyser; use Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\VanillaCrashReportTrait; use Aternos\Codex\Minecraft\Log\Type\CrashReportLogTypeInterface; diff --git a/src/Log/Minecraft/Vanilla/NeoForge/NeoForgeCrashReportLog.php b/src/Log/Minecraft/Vanilla/NeoForge/NeoForgeCrashReportLog.php index 55494f4e..3dd6c9c2 100644 --- a/src/Log/Minecraft/Vanilla/NeoForge/NeoForgeCrashReportLog.php +++ b/src/Log/Minecraft/Vanilla/NeoForge/NeoForgeCrashReportLog.php @@ -4,8 +4,8 @@ use Aternos\Codex\Detective\DetectorInterface; use Aternos\Codex\Detective\SinglePatternDetector; -use Aternos\Codex\Minecraft\Analyser\CrashReport\MinecraftCrashReportAnalyser; -use Aternos\Codex\Minecraft\Analyser\CrashReport\NeoForgeCrashReportAnalyser; +use Aternos\Codex\Minecraft\Analyser\Report\CrashReport\MinecraftCrashReportAnalyser; +use Aternos\Codex\Minecraft\Analyser\Report\CrashReport\NeoForgeCrashReportAnalyser; use Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\VanillaCrashReportTrait; use Aternos\Codex\Minecraft\Log\Type\CrashReportLogTypeInterface; diff --git a/src/Log/Minecraft/Vanilla/Quilt/QuiltCrashReportLog.php b/src/Log/Minecraft/Vanilla/Quilt/QuiltCrashReportLog.php index ab5d4a65..9ee7be51 100644 --- a/src/Log/Minecraft/Vanilla/Quilt/QuiltCrashReportLog.php +++ b/src/Log/Minecraft/Vanilla/Quilt/QuiltCrashReportLog.php @@ -4,9 +4,8 @@ use Aternos\Codex\Detective\DetectorInterface; use Aternos\Codex\Detective\SinglePatternDetector; -use Aternos\Codex\Minecraft\Analyser\CrashReport\MinecraftCrashReportAnalyser; -use Aternos\Codex\Minecraft\Analyser\CrashReport\QuiltCrashReportAnalyser; -use Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\Quilt\QuiltLog; +use Aternos\Codex\Minecraft\Analyser\Report\CrashReport\MinecraftCrashReportAnalyser; +use Aternos\Codex\Minecraft\Analyser\Report\CrashReport\QuiltCrashReportAnalyser; use Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\VanillaCrashReportTrait; use Aternos\Codex\Minecraft\Log\Type\CrashReportLogTypeInterface; diff --git a/src/Log/Minecraft/Vanilla/VanillaCrashReportLog.php b/src/Log/Minecraft/Vanilla/VanillaCrashReportLog.php index f856bb28..afb72af2 100644 --- a/src/Log/Minecraft/Vanilla/VanillaCrashReportLog.php +++ b/src/Log/Minecraft/Vanilla/VanillaCrashReportLog.php @@ -11,7 +11,7 @@ * * @package Aternos\Codex\Minecraft\Log\Minecraft\Vanilla */ -class VanillaCrashReportLog extends VanillaLog implements CrashReportLogTypeInterface +class VanillaCrashReportLog extends VanillaReportLog implements CrashReportLogTypeInterface { use VanillaCrashReportTrait; diff --git a/src/Log/Minecraft/Vanilla/VanillaCrashReportTrait.php b/src/Log/Minecraft/Vanilla/VanillaCrashReportTrait.php index ac3ec7d4..38721449 100644 --- a/src/Log/Minecraft/Vanilla/VanillaCrashReportTrait.php +++ b/src/Log/Minecraft/Vanilla/VanillaCrashReportTrait.php @@ -2,18 +2,11 @@ namespace Aternos\Codex\Minecraft\Log\Minecraft\Vanilla; -use Aternos\Codex\Minecraft\Analyser\CrashReport\MinecraftCrashReportAnalyser; -use Aternos\Codex\Minecraft\Parser\CrashReportParser; +use Aternos\Codex\Minecraft\Analyser\Report\CrashReport\MinecraftCrashReportAnalyser; trait VanillaCrashReportTrait { - /** - * @return CrashReportParser - */ - public static function getDefaultParser(): CrashReportParser - { - return new CrashReportParser(); - } + use VanillaReportTrait; /** * @return MinecraftCrashReportAnalyser diff --git a/src/Log/Minecraft/Vanilla/VanillaNetworkProtocolErrorReportLog.php b/src/Log/Minecraft/Vanilla/VanillaNetworkProtocolErrorReportLog.php new file mode 100644 index 00000000..f931f769 --- /dev/null +++ b/src/Log/Minecraft/Vanilla/VanillaNetworkProtocolErrorReportLog.php @@ -0,0 +1,20 @@ +setPattern("/---- Minecraft Network Protocol Error Report ----/")]; + } +} \ No newline at end of file diff --git a/src/Log/Minecraft/Vanilla/VanillaNetworkProtocolErrorReportTrait.php b/src/Log/Minecraft/Vanilla/VanillaNetworkProtocolErrorReportTrait.php new file mode 100644 index 00000000..5fc9e520 --- /dev/null +++ b/src/Log/Minecraft/Vanilla/VanillaNetworkProtocolErrorReportTrait.php @@ -0,0 +1,18 @@ + CrashReportLevel::WARNING, - "title" => CrashReportLevel::TITLE, - "comment" => CrashReportLevel::COMMENT, - "stacktrace" => CrashReportLevel::STACKTRACE, - default => CrashReportLevel::INFO + "warning" => ReportLevel::WARNING, + "title" => ReportLevel::TITLE, + "comment" => ReportLevel::COMMENT, + "stacktrace" => ReportLevel::STACKTRACE, + default => ReportLevel::INFO }; } @@ -37,11 +37,11 @@ public static function fromString(string $level): LevelInterface public function asString(): string { return match ($this) { - CrashReportLevel::WARNING => "warning", - CrashReportLevel::TITLE => "title", - CrashReportLevel::COMMENT => "comment", - CrashReportLevel::STACKTRACE => "stacktrace", - CrashReportLevel::INFO => "info" + ReportLevel::WARNING => "warning", + ReportLevel::TITLE => "title", + ReportLevel::COMMENT => "comment", + ReportLevel::STACKTRACE => "stacktrace", + ReportLevel::INFO => "info" }; } diff --git a/src/Parser/CrashReportParser.php b/src/Parser/ReportParser.php similarity index 87% rename from src/Parser/CrashReportParser.php rename to src/Parser/ReportParser.php index be62e057..eddc0025 100644 --- a/src/Parser/CrashReportParser.php +++ b/src/Parser/ReportParser.php @@ -10,7 +10,7 @@ * * @package Aternos\Codex\Minecraft\Parser */ -class CrashReportParser extends \Aternos\Codex\Parser\Parser +class ReportParser extends \Aternos\Codex\Parser\Parser { const LEVEL_INFO = "info"; const LEVEL_WARNING = "warn"; @@ -42,13 +42,13 @@ public function parse(): void foreach (static::PATTERN as $level => $patterns) { foreach ($patterns as $pattern) { if (preg_match($pattern, $lineString, $matches)) { - $entry->setLevel(CrashReportLevel::fromString($level)); + $entry->setLevel(ReportLevel::fromString($level)); if (isset($matches[1])) { $entry->setPrefix($matches[1]); } continue 3; } - $entry->setLevel(CrashReportLevel::fromString(static::DEFAULT_LEVEL)); + $entry->setLevel(ReportLevel::fromString(static::DEFAULT_LEVEL)); } } } diff --git a/test/data/Vanilla/vanilla-network-protocol-error-report.json b/test/data/Vanilla/vanilla-network-protocol-error-report.json new file mode 100644 index 00000000..dfdccf8f --- /dev/null +++ b/test/data/Vanilla/vanilla-network-protocol-error-report.json @@ -0,0 +1,1170 @@ +{ + "id": "vanilla\/network-protocol-error-report", + "name": "Vanilla", + "type": "Network Protocol Error Report", + "version": "1.21", + "title": "Vanilla 1.21 Network Protocol Error Report", + "entries": [ + { + "level": 8, + "time": null, + "prefix": null, + "lines": [ + { + "number": 1, + "content": "---- Minecraft Network Protocol Error Report ----" + } + ] + }, + { + "level": 9, + "time": null, + "prefix": null, + "lines": [ + { + "number": 2, + "content": "\/\/ I heard pigeons are more reliable" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": null, + "lines": [ + { + "number": 3, + "content": "" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "Time:", + "lines": [ + { + "number": 4, + "content": "Time: 2024-06-13 22:01:09" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "Description:", + "lines": [ + { + "number": 5, + "content": "Description: Packet handling error" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": null, + "lines": [ + { + "number": 6, + "content": "" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 7, + "content": "java.lang.IllegalStateException: Failed to load registries due to above errors" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 8, + "content": "\tat akm.a(SourceFile:181)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 9, + "content": "\tat akm.a(SourceFile:155)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 10, + "content": "\tat fzs$a.a(SourceFile:49)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 11, + "content": "\tat fzs.a(SourceFile:59)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 12, + "content": "\tat fzd.a(SourceFile:117)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 13, + "content": "\tat fzd.a(SourceFile:105)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 14, + "content": "\tat fzd.a(SourceFile:117)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 15, + "content": "\tat abd.a(SourceFile:22)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 16, + "content": "\tat abd.a(SourceFile:8)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 17, + "content": "\tat zj.a(SourceFile:27)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 18, + "content": "\tat bph.d(SourceFile:162)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 19, + "content": "\tat bpl.d(SourceFile:23)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 20, + "content": "\tat bph.B(SourceFile:136)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 21, + "content": "\tat bph.bB(SourceFile:121)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 22, + "content": "\tat fgo.c(SourceFile:1240)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 23, + "content": "\tat fgo.f(SourceFile:882)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 24, + "content": "\tat net.minecraft.client.main.Main.main(SourceFile:256)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 25, + "content": "\tat org.prismlauncher.launcher.impl.StandardLauncher.launch(StandardLauncher.java:100)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 26, + "content": "\tat org.prismlauncher.EntryPoint.listen(EntryPoint.java:129)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 27, + "content": "\tat org.prismlauncher.EntryPoint.main(EntryPoint.java:70)" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": null, + "lines": [ + { + "number": 28, + "content": "" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": null, + "lines": [ + { + "number": 29, + "content": "" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": null, + "lines": [ + { + "number": 30, + "content": "A detailed walkthrough of the error, its code path and all known details is as follows:" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": null, + "lines": [ + { + "number": 31, + "content": "---------------------------------------------------------------------------------------" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": null, + "lines": [ + { + "number": 32, + "content": "" + } + ] + }, + { + "level": 8, + "time": null, + "prefix": null, + "lines": [ + { + "number": 33, + "content": "-- Head --" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "Thread:", + "lines": [ + { + "number": 34, + "content": "Thread: Render thread" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "Stacktrace:", + "lines": [ + { + "number": 35, + "content": "Stacktrace:" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 36, + "content": "\tat akm.a(SourceFile:181)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 37, + "content": "\tat akm.a(SourceFile:155)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 38, + "content": "\tat fzs$a.a(SourceFile:49)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 39, + "content": "\tat fzs.a(SourceFile:59)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 40, + "content": "\tat fzd.a(SourceFile:117)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 41, + "content": "\tat fzd.a(SourceFile:105)" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": null, + "lines": [ + { + "number": 42, + "content": "" + } + ] + }, + { + "level": 8, + "time": null, + "prefix": null, + "lines": [ + { + "number": 43, + "content": "-- Incoming Packet --" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "Details:", + "lines": [ + { + "number": 44, + "content": "Details:" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tType:", + "lines": [ + { + "number": 45, + "content": "\tType: clientbound\/minecraft:finish_configuration" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tIs Terminal:", + "lines": [ + { + "number": 46, + "content": "\tIs Terminal: true" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tIs Skippable:", + "lines": [ + { + "number": 47, + "content": "\tIs Skippable: false" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "Stacktrace:", + "lines": [ + { + "number": 48, + "content": "Stacktrace:" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 49, + "content": "\tat zj.a(SourceFile:56)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 50, + "content": "\tat fzc.a(SourceFile:136)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 51, + "content": "\tat fzc.a(SourceFile:113)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 52, + "content": "\tat zj.a(SourceFile:32)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 53, + "content": "\tat bph.d(SourceFile:162)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 54, + "content": "\tat bpl.d(SourceFile:23)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 55, + "content": "\tat bph.B(SourceFile:136)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 56, + "content": "\tat bph.bB(SourceFile:121)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 57, + "content": "\tat fgo.c(SourceFile:1240)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 58, + "content": "\tat fgo.f(SourceFile:882)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 59, + "content": "\tat net.minecraft.client.main.Main.main(SourceFile:256)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 60, + "content": "\tat org.prismlauncher.launcher.impl.StandardLauncher.launch(StandardLauncher.java:100)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 61, + "content": "\tat org.prismlauncher.EntryPoint.listen(EntryPoint.java:129)" + } + ] + }, + { + "level": 10, + "time": null, + "prefix": null, + "lines": [ + { + "number": 62, + "content": "\tat org.prismlauncher.EntryPoint.main(EntryPoint.java:70)" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": null, + "lines": [ + { + "number": 63, + "content": "" + } + ] + }, + { + "level": 8, + "time": null, + "prefix": null, + "lines": [ + { + "number": 64, + "content": "-- Connection --" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "Details:", + "lines": [ + { + "number": 65, + "content": "Details:" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tProtocol:", + "lines": [ + { + "number": 66, + "content": "\tProtocol: configuration" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tFlow:", + "lines": [ + { + "number": 67, + "content": "\tFlow: CLIENTBOUND" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tServer type:", + "lines": [ + { + "number": 68, + "content": "\tServer type: OTHER" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tServer brand:", + "lines": [ + { + "number": 69, + "content": "\tServer brand: ~~NULL~~" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": null, + "lines": [ + { + "number": 70, + "content": "" + } + ] + }, + { + "level": 8, + "time": null, + "prefix": null, + "lines": [ + { + "number": 71, + "content": "-- System Details --" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "Details:", + "lines": [ + { + "number": 72, + "content": "Details:" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tMinecraft Version:", + "lines": [ + { + "number": 73, + "content": "\tMinecraft Version: 1.21" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tMinecraft Version ID:", + "lines": [ + { + "number": 74, + "content": "\tMinecraft Version ID: 1.21" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tOperating System:", + "lines": [ + { + "number": 75, + "content": "\tOperating System: Linux (amd64) version 6.8.11-300.fc40.x86_64" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tJava Version:", + "lines": [ + { + "number": 76, + "content": "\tJava Version: 21.0.3, Red Hat, Inc." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tJava VM Version:", + "lines": [ + { + "number": 77, + "content": "\tJava VM Version: OpenJDK 64-Bit Server VM (mixed mode, sharing), Red Hat, Inc." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tMemory:", + "lines": [ + { + "number": 78, + "content": "\tMemory: 120736888 bytes (115 MiB) \/ 538968064 bytes (514 MiB) up to 4294967296 bytes (4096 MiB)" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tCPUs:", + "lines": [ + { + "number": 79, + "content": "\tCPUs: 20" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tProcessor Vendor:", + "lines": [ + { + "number": 80, + "content": "\tProcessor Vendor: GenuineIntel" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tProcessor Name:", + "lines": [ + { + "number": 81, + "content": "\tProcessor Name: 12th Gen Intel(R) Core(TM) i9-12900HK" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tIdentifier:", + "lines": [ + { + "number": 82, + "content": "\tIdentifier: Intel64 Family 6 Model 154 Stepping 3" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tMicroarchitecture:", + "lines": [ + { + "number": 83, + "content": "\tMicroarchitecture: Alder Lake" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tFrequency (GHz):", + "lines": [ + { + "number": 84, + "content": "\tFrequency (GHz): -0.00" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tNumber of physical packages:", + "lines": [ + { + "number": 85, + "content": "\tNumber of physical packages: 1" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tNumber of physical CPUs:", + "lines": [ + { + "number": 86, + "content": "\tNumber of physical CPUs: 14" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tNumber of logical CPUs:", + "lines": [ + { + "number": 87, + "content": "\tNumber of logical CPUs: 20" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tGraphics card #0 name:", + "lines": [ + { + "number": 88, + "content": "\tGraphics card #0 name: Alder Lake-P GT2 [Iris Xe Graphics]" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tGraphics card #0 vendor:", + "lines": [ + { + "number": 89, + "content": "\tGraphics card #0 vendor: Intel Corporation (0x8086)" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tGraphics card #0 VRAM (MiB):", + "lines": [ + { + "number": 90, + "content": "\tGraphics card #0 VRAM (MiB): 256.00" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tGraphics card #0 deviceId:", + "lines": [ + { + "number": 91, + "content": "\tGraphics card #0 deviceId: 0x46a6" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tGraphics card #0 versionInfo:", + "lines": [ + { + "number": 92, + "content": "\tGraphics card #0 versionInfo: unknown" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tVirtual memory max (MiB):", + "lines": [ + { + "number": 93, + "content": "\tVirtual memory max (MiB): 40174.53" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tVirtual memory used (MiB):", + "lines": [ + { + "number": 94, + "content": "\tVirtual memory used (MiB): 8875.37" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tSwap memory total (MiB):", + "lines": [ + { + "number": 95, + "content": "\tSwap memory total (MiB): 8192.00" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tSwap memory used (MiB):", + "lines": [ + { + "number": 96, + "content": "\tSwap memory used (MiB): 0.00" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": null, + "lines": [ + { + "number": 97, + "content": "\tSpace in storage for jna.tmpdir (MiB): " + } + ] + }, + { + "level": 6, + "time": null, + "prefix": null, + "lines": [ + { + "number": 98, + "content": "\tSpace in storage for org.lwjgl.system.SharedLibraryExtractPath (MiB): " + } + ] + }, + { + "level": 6, + "time": null, + "prefix": null, + "lines": [ + { + "number": 99, + "content": "\tSpace in storage for io.netty.native.workdir (MiB): " + } + ] + }, + { + "level": 6, + "time": null, + "prefix": null, + "lines": [ + { + "number": 100, + "content": "\tSpace in storage for java.io.tmpdir (MiB): available: 31952.13, total: 31982.54" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tSpace in storage for workdir (MiB):", + "lines": [ + { + "number": 101, + "content": "\tSpace in storage for workdir (MiB): available: 818970.75, total: 975121.00" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "\tJVM Flags:", + "lines": [ + { + "number": 102, + "content": "\tJVM Flags: 2 total; -Xms512m -Xmx4096m" + } + ] + } + ], + "analysis": { + "problems": [], + "information": [ + { + "message": "Minecraft version: 1.21", + "counter": 1, + "entry": { + "level": 6, + "time": null, + "prefix": "\tMinecraft Version:", + "lines": [ + { + "number": 73, + "content": "\tMinecraft Version: 1.21" + } + ] + }, + "label": "Minecraft version", + "value": "1.21" + }, + { + "message": "Java version: 21.0.3", + "counter": 1, + "entry": { + "level": 6, + "time": null, + "prefix": "\tJava Version:", + "lines": [ + { + "number": 76, + "content": "\tJava Version: 21.0.3, Red Hat, Inc." + } + ] + }, + "label": "Java version", + "value": "21.0.3" + } + ] + } +} \ No newline at end of file diff --git a/test/data/Vanilla/vanilla-network-protocol-error-report.log b/test/data/Vanilla/vanilla-network-protocol-error-report.log new file mode 100644 index 00000000..4413a264 --- /dev/null +++ b/test/data/Vanilla/vanilla-network-protocol-error-report.log @@ -0,0 +1,102 @@ +---- Minecraft Network Protocol Error Report ---- +// I heard pigeons are more reliable + +Time: 2024-06-13 22:01:09 +Description: Packet handling error + +java.lang.IllegalStateException: Failed to load registries due to above errors + at akm.a(SourceFile:181) + at akm.a(SourceFile:155) + at fzs$a.a(SourceFile:49) + at fzs.a(SourceFile:59) + at fzd.a(SourceFile:117) + at fzd.a(SourceFile:105) + at fzd.a(SourceFile:117) + at abd.a(SourceFile:22) + at abd.a(SourceFile:8) + at zj.a(SourceFile:27) + at bph.d(SourceFile:162) + at bpl.d(SourceFile:23) + at bph.B(SourceFile:136) + at bph.bB(SourceFile:121) + at fgo.c(SourceFile:1240) + at fgo.f(SourceFile:882) + at net.minecraft.client.main.Main.main(SourceFile:256) + at org.prismlauncher.launcher.impl.StandardLauncher.launch(StandardLauncher.java:100) + at org.prismlauncher.EntryPoint.listen(EntryPoint.java:129) + at org.prismlauncher.EntryPoint.main(EntryPoint.java:70) + + +A detailed walkthrough of the error, its code path and all known details is as follows: +--------------------------------------------------------------------------------------- + +-- Head -- +Thread: Render thread +Stacktrace: + at akm.a(SourceFile:181) + at akm.a(SourceFile:155) + at fzs$a.a(SourceFile:49) + at fzs.a(SourceFile:59) + at fzd.a(SourceFile:117) + at fzd.a(SourceFile:105) + +-- Incoming Packet -- +Details: + Type: clientbound/minecraft:finish_configuration + Is Terminal: true + Is Skippable: false +Stacktrace: + at zj.a(SourceFile:56) + at fzc.a(SourceFile:136) + at fzc.a(SourceFile:113) + at zj.a(SourceFile:32) + at bph.d(SourceFile:162) + at bpl.d(SourceFile:23) + at bph.B(SourceFile:136) + at bph.bB(SourceFile:121) + at fgo.c(SourceFile:1240) + at fgo.f(SourceFile:882) + at net.minecraft.client.main.Main.main(SourceFile:256) + at org.prismlauncher.launcher.impl.StandardLauncher.launch(StandardLauncher.java:100) + at org.prismlauncher.EntryPoint.listen(EntryPoint.java:129) + at org.prismlauncher.EntryPoint.main(EntryPoint.java:70) + +-- Connection -- +Details: + Protocol: configuration + Flow: CLIENTBOUND + Server type: OTHER + Server brand: ~~NULL~~ + +-- System Details -- +Details: + Minecraft Version: 1.21 + Minecraft Version ID: 1.21 + Operating System: Linux (amd64) version 6.8.11-300.fc40.x86_64 + Java Version: 21.0.3, Red Hat, Inc. + Java VM Version: OpenJDK 64-Bit Server VM (mixed mode, sharing), Red Hat, Inc. + Memory: 120736888 bytes (115 MiB) / 538968064 bytes (514 MiB) up to 4294967296 bytes (4096 MiB) + CPUs: 20 + Processor Vendor: GenuineIntel + Processor Name: 12th Gen Intel(R) Core(TM) i9-12900HK + Identifier: Intel64 Family 6 Model 154 Stepping 3 + Microarchitecture: Alder Lake + Frequency (GHz): -0.00 + Number of physical packages: 1 + Number of physical CPUs: 14 + Number of logical CPUs: 20 + Graphics card #0 name: Alder Lake-P GT2 [Iris Xe Graphics] + Graphics card #0 vendor: Intel Corporation (0x8086) + Graphics card #0 VRAM (MiB): 256.00 + Graphics card #0 deviceId: 0x46a6 + Graphics card #0 versionInfo: unknown + Virtual memory max (MiB): 40174.53 + Virtual memory used (MiB): 8875.37 + Swap memory total (MiB): 8192.00 + Swap memory used (MiB): 0.00 + Space in storage for jna.tmpdir (MiB): + Space in storage for org.lwjgl.system.SharedLibraryExtractPath (MiB): + Space in storage for io.netty.native.workdir (MiB): + Space in storage for java.io.tmpdir (MiB): available: 31952.13, total: 31982.54 + Space in storage for workdir (MiB): available: 818970.75, total: 975121.00 + JVM Flags: 2 total; -Xms512m -Xmx4096m \ No newline at end of file diff --git a/test/tests/Logs/AutoLogsTest.php b/test/tests/Logs/AutoLogsTest.php index 43b446a0..0ad8832a 100644 --- a/test/tests/Logs/AutoLogsTest.php +++ b/test/tests/Logs/AutoLogsTest.php @@ -1254,6 +1254,16 @@ public function test_neoforge_1_20_4_client(): void $this->assertStringEqualsFile($log->getExpectedPath(), $log->getOutput(), $log->getLogPath()); } + /** + * @return void + * @throws Exception + */ + public function test_neoforge_1_20_4_server_early(): void + { + $log = new TestLog('Vanilla/NeoForge/neoforge-1-20-4-server-early.log'); + $this->assertStringEqualsFile($log->getExpectedPath(), $log->getOutput(), $log->getLogPath()); + } + /** * @return void * @throws Exception @@ -1374,6 +1384,16 @@ public function test_vanilla_malformed_encoding(): void $this->assertStringEqualsFile($log->getExpectedPath(), $log->getOutput(), $log->getLogPath()); } + /** + * @return void + * @throws Exception + */ + public function test_vanilla_network_protocol_error_report(): void + { + $log = new TestLog('Vanilla/vanilla-network-protocol-error-report.log'); + $this->assertStringEqualsFile($log->getExpectedPath(), $log->getOutput(), $log->getLogPath()); + } + /** * @return void * @throws Exception