From b5536a52408d09b8d9871eb9ac753dc72ea7744f Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Mon, 2 Sep 2024 15:15:34 +0200 Subject: [PATCH 1/3] Adjust regex in log identifier to detect new versions of Purpur --- src/Log/Minecraft/Vanilla/Bukkit/Purpur/PurpurLog.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Log/Minecraft/Vanilla/Bukkit/Purpur/PurpurLog.php b/src/Log/Minecraft/Vanilla/Bukkit/Purpur/PurpurLog.php index 5385592..b20a096 100644 --- a/src/Log/Minecraft/Vanilla/Bukkit/Purpur/PurpurLog.php +++ b/src/Log/Minecraft/Vanilla/Bukkit/Purpur/PurpurLog.php @@ -11,7 +11,8 @@ */ abstract class PurpurLog extends PaperLog { - protected static string $logIdentifier = "(?:Purpur|CraftBukkit) version git\-Purpur"; + protected static string $logIdentifier = "(?:Purpur|CraftBukkit) version git\-Purpur" + . "|This server is running Purpur version"; /** * @return string From a4ca177d5e6897b3d1ff7c0a7e04c4487dd31a63 Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Mon, 2 Sep 2024 15:15:55 +0200 Subject: [PATCH 2/3] Add logs and tests for Purpur 1.20.6 --- .../Vanilla/Bukkit/Purpur/purpur-1-20-6.json | 515 ++++++++++++++++++ .../Vanilla/Bukkit/Purpur/purpur-1-20-6.log | 44 ++ test/tests/Logs/AutoLogsTest.php | 10 + 3 files changed, 569 insertions(+) create mode 100644 test/data/Vanilla/Bukkit/Purpur/purpur-1-20-6.json create mode 100644 test/data/Vanilla/Bukkit/Purpur/purpur-1-20-6.log diff --git a/test/data/Vanilla/Bukkit/Purpur/purpur-1-20-6.json b/test/data/Vanilla/Bukkit/Purpur/purpur-1-20-6.json new file mode 100644 index 0000000..7af38b3 --- /dev/null +++ b/test/data/Vanilla/Bukkit/Purpur/purpur-1-20-6.json @@ -0,0 +1,515 @@ +{ + "id": "purpur\/server", + "name": "Purpur", + "type": "Server Log", + "version": "1.20.6", + "title": "Purpur 1.20.6 Server Log", + "entries": [ + { + "level": 6, + "time": null, + "prefix": "[15:09:49] [Paper Plugin Remapper Thread - 0\/INFO]:", + "lines": [ + { + "number": 1, + "content": "[15:09:49] [Paper Plugin Remapper Thread - 0\/INFO]: [ReobfServer] Remapping server..." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:09:54] [Paper Plugin Remapper Thread - 0\/INFO]:", + "lines": [ + { + "number": 2, + "content": "[15:09:54] [Paper Plugin Remapper Thread - 0\/INFO]: [ReobfServer] Done remapping server in 4649ms." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:09:54] [Paper Plugin Remapper Thread - 2\/INFO]:", + "lines": [ + { + "number": 3, + "content": "[15:09:54] [Paper Plugin Remapper Thread - 2\/INFO]: [PluginRemapper] Remapping plugin 'cache\/spark.jar'..." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:09:54] [Paper Plugin Remapper Thread - 2\/INFO]:", + "lines": [ + { + "number": 4, + "content": "[15:09:54] [Paper Plugin Remapper Thread - 2\/INFO]: [PluginRemapper] Done remapping plugin 'cache\/spark.jar' in 851ms." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:09:58] [ServerMain\/INFO]:", + "lines": [ + { + "number": 5, + "content": "[15:09:58] [ServerMain\/INFO]: Environment: Environment[sessionHost=https:\/\/sessionserver.mojang.com, servicesHost=https:\/\/api.minecraftservices.com, name=PROD]" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:09:58] [ServerMain\/INFO]:", + "lines": [ + { + "number": 6, + "content": "[15:09:58] [ServerMain\/INFO]: Found new data pack file\/bukkit, loading it automatically" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:09:58] [ServerMain\/INFO]:", + "lines": [ + { + "number": 7, + "content": "[15:09:58] [ServerMain\/INFO]: Found new data pack paper, loading it automatically" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:09:58] [ServerMain\/INFO]:", + "lines": [ + { + "number": 8, + "content": "[15:09:58] [ServerMain\/INFO]: No existing world data, creating new world" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:09:59] [ServerMain\/INFO]:", + "lines": [ + { + "number": 9, + "content": "[15:09:59] [ServerMain\/INFO]: Loaded 1175 recipes" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:09:59] [ServerMain\/INFO]:", + "lines": [ + { + "number": 10, + "content": "[15:09:59] [ServerMain\/INFO]: Loaded 1276 advancements" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:09:59] [Server thread\/INFO]:", + "lines": [ + { + "number": 11, + "content": "[15:09:59] [Server thread\/INFO]: Starting minecraft server version 1.20.6" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:09:59] [Server thread\/INFO]:", + "lines": [ + { + "number": 12, + "content": "[15:09:59] [Server thread\/INFO]: Loading properties" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:09:59] [Server thread\/INFO]:", + "lines": [ + { + "number": 13, + "content": "[15:09:59] [Server thread\/INFO]: This server is running Purpur version 1.20.6-2233-ver\/1.20.6@0d6766e (2024-06-18T04:01:10Z) (Implementing API version 1.20.6-R0.1-SNAPSHOT)" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:10:00] [Server thread\/INFO]:", + "lines": [ + { + "number": 14, + "content": "[15:10:00] [Server thread\/INFO]: Server Ping Player Sample Count: 12" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:10:00] [Server thread\/INFO]:", + "lines": [ + { + "number": 15, + "content": "[15:10:00] [Server thread\/INFO]: Using 4 threads for Netty based IO" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:10:00] [Server thread\/INFO]:", + "lines": [ + { + "number": 16, + "content": "[15:10:00] [Server thread\/INFO]: [ChunkTaskScheduler] Chunk system is using 1 I\/O threads, 1 worker threads, and gen parallelism of 1 threads" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:10:01] [Server thread\/INFO]:", + "lines": [ + { + "number": 17, + "content": "[15:10:01] [Server thread\/INFO]: Default game type: SURVIVAL" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:10:01] [Server thread\/INFO]:", + "lines": [ + { + "number": 18, + "content": "[15:10:01] [Server thread\/INFO]: Generating keypair" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:10:01] [Server thread\/INFO]:", + "lines": [ + { + "number": 19, + "content": "[15:10:01] [Server thread\/INFO]: Starting Minecraft server on *:49877" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:10:01] [Server thread\/INFO]:", + "lines": [ + { + "number": 20, + "content": "[15:10:01] [Server thread\/INFO]: Using epoll channel type" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:10:01] [Server thread\/INFO]:", + "lines": [ + { + "number": 21, + "content": "[15:10:01] [Server thread\/INFO]: Paper: Using libdeflate (Linux x86_64) compression from Velocity." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:10:01] [Server thread\/INFO]:", + "lines": [ + { + "number": 22, + "content": "[15:10:01] [Server thread\/INFO]: Paper: Using OpenSSL 3.0.x (Linux x86_64) cipher from Velocity." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:10:01] [Server thread\/INFO]:", + "lines": [ + { + "number": 23, + "content": "[15:10:01] [Server thread\/INFO]: [spark] Loading server plugin spark v1.10.99" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:10:01] [Server thread\/INFO]:", + "lines": [ + { + "number": 24, + "content": "[15:10:01] [Server thread\/INFO]: Preparing level \"world\"" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:10:16] [Server thread\/INFO]:", + "lines": [ + { + "number": 25, + "content": "[15:10:16] [Server thread\/INFO]: Preparing start region for dimension minecraft:overworld" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:10:25] [Server thread\/INFO]:", + "lines": [ + { + "number": 26, + "content": "[15:10:25] [Server thread\/INFO]: Time elapsed: 8459 ms" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:10:25] [Server thread\/INFO]:", + "lines": [ + { + "number": 27, + "content": "[15:10:25] [Server thread\/INFO]: Preparing start region for dimension minecraft:the_nether" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:10:27] [Server thread\/INFO]:", + "lines": [ + { + "number": 28, + "content": "[15:10:27] [Server thread\/INFO]: Time elapsed: 1994 ms" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:10:27] [Server thread\/INFO]:", + "lines": [ + { + "number": 29, + "content": "[15:10:27] [Server thread\/INFO]: Preparing start region for dimension minecraft:the_end" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:10:27] [Server thread\/INFO]:", + "lines": [ + { + "number": 30, + "content": "[15:10:27] [Server thread\/INFO]: Time elapsed: 601 ms" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:10:27] [Server thread\/INFO]:", + "lines": [ + { + "number": 31, + "content": "[15:10:27] [Server thread\/INFO]: [spark] Enabling spark v1.10.99" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:10:28] [Server thread\/INFO]:", + "lines": [ + { + "number": 32, + "content": "[15:10:28] [Server thread\/INFO]: [spark] Using Paper ServerTickStartEvent for tick monitoring" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:10:28] [Server thread\/INFO]:", + "lines": [ + { + "number": 33, + "content": "[15:10:28] [Server thread\/INFO]: [spark] Starting background profiler..." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:10:28] [Server thread\/INFO]:", + "lines": [ + { + "number": 34, + "content": "[15:10:28] [Server thread\/INFO]: Starting GS4 status listener" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:10:28] [Server thread\/INFO]:", + "lines": [ + { + "number": 35, + "content": "[15:10:28] [Server thread\/INFO]: Thread Query Listener started" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:10:28] [Query Listener #1\/INFO]:", + "lines": [ + { + "number": 36, + "content": "[15:10:28] [Query Listener #1\/INFO]: Query running on 0.0.0.0:9898" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:10:28] [Server thread\/INFO]:", + "lines": [ + { + "number": 37, + "content": "[15:10:28] [Server thread\/INFO]: JMX monitoring enabled" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:10:28] [Server thread\/INFO]:", + "lines": [ + { + "number": 38, + "content": "[15:10:28] [Server thread\/INFO]: Running delayed init tasks" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:10:28] [Server thread\/INFO]:", + "lines": [ + { + "number": 39, + "content": "[15:10:28] [Server thread\/INFO]: Done (29.040s)! For help, type \"help\"" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:10:28] [Server thread\/INFO]:", + "lines": [ + { + "number": 40, + "content": "[15:10:28] [Server thread\/INFO]: *************************************************************************************" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:10:28] [Server thread\/INFO]:", + "lines": [ + { + "number": 41, + "content": "[15:10:28] [Server thread\/INFO]: This is the first time you're starting this server." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:10:28] [Server thread\/INFO]:", + "lines": [ + { + "number": 42, + "content": "[15:10:28] [Server thread\/INFO]: It's recommended you read our 'Getting Started' documentation for guidance." + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:10:28] [Server thread\/INFO]:", + "lines": [ + { + "number": 43, + "content": "[15:10:28] [Server thread\/INFO]: View this and more helpful information here: https:\/\/docs.papermc.io\/paper\/next-steps" + } + ] + }, + { + "level": 6, + "time": null, + "prefix": "[15:10:28] [Server thread\/INFO]:", + "lines": [ + { + "number": 44, + "content": "[15:10:28] [Server thread\/INFO]: *************************************************************************************" + } + ] + } + ], + "analysis": { + "problems": [], + "information": [ + { + "message": "Minecraft version: 1.20.6", + "counter": 1, + "entry": { + "level": 6, + "time": null, + "prefix": "[15:09:59] [Server thread\/INFO]:", + "lines": [ + { + "number": 11, + "content": "[15:09:59] [Server thread\/INFO]: Starting minecraft server version 1.20.6" + } + ] + }, + "label": "Minecraft version", + "value": "1.20.6" + } + ] + } +} \ No newline at end of file diff --git a/test/data/Vanilla/Bukkit/Purpur/purpur-1-20-6.log b/test/data/Vanilla/Bukkit/Purpur/purpur-1-20-6.log new file mode 100644 index 0000000..da010bc --- /dev/null +++ b/test/data/Vanilla/Bukkit/Purpur/purpur-1-20-6.log @@ -0,0 +1,44 @@ +[15:09:49] [Paper Plugin Remapper Thread - 0/INFO]: [ReobfServer] Remapping server... +[15:09:54] [Paper Plugin Remapper Thread - 0/INFO]: [ReobfServer] Done remapping server in 4649ms. +[15:09:54] [Paper Plugin Remapper Thread - 2/INFO]: [PluginRemapper] Remapping plugin 'cache/spark.jar'... +[15:09:54] [Paper Plugin Remapper Thread - 2/INFO]: [PluginRemapper] Done remapping plugin 'cache/spark.jar' in 851ms. +[15:09:58] [ServerMain/INFO]: Environment: Environment[sessionHost=https://sessionserver.mojang.com, servicesHost=https://api.minecraftservices.com, name=PROD] +[15:09:58] [ServerMain/INFO]: Found new data pack file/bukkit, loading it automatically +[15:09:58] [ServerMain/INFO]: Found new data pack paper, loading it automatically +[15:09:58] [ServerMain/INFO]: No existing world data, creating new world +[15:09:59] [ServerMain/INFO]: Loaded 1175 recipes +[15:09:59] [ServerMain/INFO]: Loaded 1276 advancements +[15:09:59] [Server thread/INFO]: Starting minecraft server version 1.20.6 +[15:09:59] [Server thread/INFO]: Loading properties +[15:09:59] [Server thread/INFO]: This server is running Purpur version 1.20.6-2233-ver/1.20.6@0d6766e (2024-06-18T04:01:10Z) (Implementing API version 1.20.6-R0.1-SNAPSHOT) +[15:10:00] [Server thread/INFO]: Server Ping Player Sample Count: 12 +[15:10:00] [Server thread/INFO]: Using 4 threads for Netty based IO +[15:10:00] [Server thread/INFO]: [ChunkTaskScheduler] Chunk system is using 1 I/O threads, 1 worker threads, and gen parallelism of 1 threads +[15:10:01] [Server thread/INFO]: Default game type: SURVIVAL +[15:10:01] [Server thread/INFO]: Generating keypair +[15:10:01] [Server thread/INFO]: Starting Minecraft server on *:49877 +[15:10:01] [Server thread/INFO]: Using epoll channel type +[15:10:01] [Server thread/INFO]: Paper: Using libdeflate (Linux x86_64) compression from Velocity. +[15:10:01] [Server thread/INFO]: Paper: Using OpenSSL 3.0.x (Linux x86_64) cipher from Velocity. +[15:10:01] [Server thread/INFO]: [spark] Loading server plugin spark v1.10.99 +[15:10:01] [Server thread/INFO]: Preparing level "world" +[15:10:16] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld +[15:10:25] [Server thread/INFO]: Time elapsed: 8459 ms +[15:10:25] [Server thread/INFO]: Preparing start region for dimension minecraft:the_nether +[15:10:27] [Server thread/INFO]: Time elapsed: 1994 ms +[15:10:27] [Server thread/INFO]: Preparing start region for dimension minecraft:the_end +[15:10:27] [Server thread/INFO]: Time elapsed: 601 ms +[15:10:27] [Server thread/INFO]: [spark] Enabling spark v1.10.99 +[15:10:28] [Server thread/INFO]: [spark] Using Paper ServerTickStartEvent for tick monitoring +[15:10:28] [Server thread/INFO]: [spark] Starting background profiler... +[15:10:28] [Server thread/INFO]: Starting GS4 status listener +[15:10:28] [Server thread/INFO]: Thread Query Listener started +[15:10:28] [Query Listener #1/INFO]: Query running on 0.0.0.0:9898 +[15:10:28] [Server thread/INFO]: JMX monitoring enabled +[15:10:28] [Server thread/INFO]: Running delayed init tasks +[15:10:28] [Server thread/INFO]: Done (29.040s)! For help, type "help" +[15:10:28] [Server thread/INFO]: ************************************************************************************* +[15:10:28] [Server thread/INFO]: This is the first time you're starting this server. +[15:10:28] [Server thread/INFO]: It's recommended you read our 'Getting Started' documentation for guidance. +[15:10:28] [Server thread/INFO]: View this and more helpful information here: https://docs.papermc.io/paper/next-steps +[15:10:28] [Server thread/INFO]: ************************************************************************************* \ No newline at end of file diff --git a/test/tests/Logs/AutoLogsTest.php b/test/tests/Logs/AutoLogsTest.php index f1d416b..61a0aeb 100644 --- a/test/tests/Logs/AutoLogsTest.php +++ b/test/tests/Logs/AutoLogsTest.php @@ -534,6 +534,16 @@ public function test_paper_version_downgrade(): void $this->assertStringEqualsFile($log->getExpectedPath(), $log->getOutput(), $log->getLogPath()); } + /** + * @return void + * @throws Exception + */ + public function test_purpur_1_20_6(): void + { + $log = new TestLog('Vanilla/Bukkit/Purpur/purpur-1-20-6.log'); + $this->assertStringEqualsFile($log->getExpectedPath(), $log->getOutput(), $log->getLogPath()); + } + /** * @return void * @throws Exception From 5e7b91bd438361a748d09a021d913a2d40f42970 Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Mon, 2 Sep 2024 15:16:55 +0200 Subject: [PATCH 3/3] Rename purpur-1192 to purpur-1-19-2 --- .../Purpur/{purpur-1192.json => purpur-1-19-2.json} | 0 .../Bukkit/Purpur/{purpur-1192.log => purpur-1-19-2.log} | 0 test/tests/Logs/AutoLogsTest.php | 8 ++++---- 3 files changed, 4 insertions(+), 4 deletions(-) rename test/data/Vanilla/Bukkit/Purpur/{purpur-1192.json => purpur-1-19-2.json} (100%) rename test/data/Vanilla/Bukkit/Purpur/{purpur-1192.log => purpur-1-19-2.log} (100%) diff --git a/test/data/Vanilla/Bukkit/Purpur/purpur-1192.json b/test/data/Vanilla/Bukkit/Purpur/purpur-1-19-2.json similarity index 100% rename from test/data/Vanilla/Bukkit/Purpur/purpur-1192.json rename to test/data/Vanilla/Bukkit/Purpur/purpur-1-19-2.json diff --git a/test/data/Vanilla/Bukkit/Purpur/purpur-1192.log b/test/data/Vanilla/Bukkit/Purpur/purpur-1-19-2.log similarity index 100% rename from test/data/Vanilla/Bukkit/Purpur/purpur-1192.log rename to test/data/Vanilla/Bukkit/Purpur/purpur-1-19-2.log diff --git a/test/tests/Logs/AutoLogsTest.php b/test/tests/Logs/AutoLogsTest.php index 61a0aeb..9f5d744 100644 --- a/test/tests/Logs/AutoLogsTest.php +++ b/test/tests/Logs/AutoLogsTest.php @@ -538,9 +538,9 @@ public function test_paper_version_downgrade(): void * @return void * @throws Exception */ - public function test_purpur_1_20_6(): void + public function test_purpur_1_19_2(): void { - $log = new TestLog('Vanilla/Bukkit/Purpur/purpur-1-20-6.log'); + $log = new TestLog('Vanilla/Bukkit/Purpur/purpur-1-19-2.log'); $this->assertStringEqualsFile($log->getExpectedPath(), $log->getOutput(), $log->getLogPath()); } @@ -548,9 +548,9 @@ public function test_purpur_1_20_6(): void * @return void * @throws Exception */ - public function test_purpur_1192(): void + public function test_purpur_1_20_6(): void { - $log = new TestLog('Vanilla/Bukkit/Purpur/purpur-1192.log'); + $log = new TestLog('Vanilla/Bukkit/Purpur/purpur-1-20-6.log'); $this->assertStringEqualsFile($log->getExpectedPath(), $log->getOutput(), $log->getLogPath()); }