From 9cf9135a27e0f77de772738cfcf2e62c26a802c6 Mon Sep 17 00:00:00 2001 From: Julian Date: Wed, 11 May 2022 16:50:16 +0200 Subject: [PATCH 01/12] add other bukkit error for missing dependencies --- src/Analyser/BukkitAnalyser.php | 2 + .../Bukkit/PluginDependenciesProblem.php | 112 ++++ .../bukkit/paper-plugin-dependency-1-18-2.log | 34 + .../Bukkit/PaperPluginDependency1182Test.php | 632 ++++++++++++++++++ 4 files changed, 780 insertions(+) create mode 100644 src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php create mode 100644 test/data/bukkit/paper-plugin-dependency-1-18-2.log create mode 100644 test/tests/auto/Bukkit/PaperPluginDependency1182Test.php diff --git a/src/Analyser/BukkitAnalyser.php b/src/Analyser/BukkitAnalyser.php index 22ab6661..f12fe88c 100644 --- a/src/Analyser/BukkitAnalyser.php +++ b/src/Analyser/BukkitAnalyser.php @@ -8,6 +8,7 @@ use Aternos\Codex\Minecraft\Analysis\Problem\Bukkit\Plugin\MultiverseLoadProblem; use Aternos\Codex\Minecraft\Analysis\Problem\Bukkit\Plugin\PermissionsExConfigProblem; use Aternos\Codex\Minecraft\Analysis\Problem\Bukkit\PluginCommandExceptionProblem; +use Aternos\Codex\Minecraft\Analysis\Problem\Bukkit\PluginDependenciesProblem; use Aternos\Codex\Minecraft\Analysis\Problem\Bukkit\PluginDependencyProblem; use Aternos\Codex\Minecraft\Analysis\Problem\Bukkit\PluginDisablingProblem; use Aternos\Codex\Minecraft\Analysis\Problem\Bukkit\PluginEnablingProblem; @@ -46,6 +47,7 @@ public static function getInsightClasses(): array AuthMeShutdownProblem::class, PermissionsExConfigProblem::class, MultiverseLoadProblem::class, + PluginDependenciesProblem::class, ]; } } \ No newline at end of file diff --git a/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php b/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php new file mode 100644 index 00000000..012e1fea --- /dev/null +++ b/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php @@ -0,0 +1,112 @@ +pluginPath; + } + + /** + * @return string + */ + public function getPluginName() + { + return $this->pluginName; + } + + /** + * @return string + */ + public function getDependencyPluginNames(): string + { + $result = []; + foreach ($this->dependencyPluginNames as $name) { + $result[] = "'$name'"; + } + return implode(", ", $result); + } + + /** + * Get a human readable message + * + * @return string + */ + public function getMessage(): string + { + return Translator::getInstance()->getTranslation("plugin-dependencies-problem", [ + "plugin-name" => $this->getPluginName(), + "dependency-plugin-names" => $this->getDependencyPluginNames() + ]); + } + + /** + * Get an array of possible patterns + * + * The array key of the pattern will be passed to setMatches() + * + * @return array + */ + public static function getPatterns(): array + { + return ['/Could not load \'(plugins[\/\\\]((?!\.jar).*)\.jar)\' in folder \'[^\']+\'\norg\.bukkit\.plugin\.UnknownDependencyException\: (?:(\w+)\n|Unknown\/missing dependency plugins: \[([\w ,]+))\]/']; + } + + /** + * Apply the matches from the pattern + * + * @param array $matches + * @param $patternKey + */ + public function setMatches(array $matches, $patternKey): void + { + $this->pluginPath = $matches[1]; + $this->pluginName = $matches[2]; + $this->dependencyPluginNames = preg_split("/, ?/", $matches[3]); + + foreach ($this->dependencyPluginNames as $name) { + $this->addSolution((new PluginInstallSolution())->setPluginName($name)); + } + $this->addSolution((new FileDeleteSolution())->setRelativePath($this->getPluginPath())); + } + + /** + * @param static $insight + * @return bool + */ + public function isEqual($insight): bool + { + return $this->getPluginName() === $insight->getPluginName() + && $this->getPluginPath() === $insight->getPluginPath() + && $this->getDependencyPluginNames() === $insight->getDependencyPluginNames(); + } +} \ No newline at end of file diff --git a/test/data/bukkit/paper-plugin-dependency-1-18-2.log b/test/data/bukkit/paper-plugin-dependency-1-18-2.log new file mode 100644 index 00000000..7082913e --- /dev/null +++ b/test/data/bukkit/paper-plugin-dependency-1-18-2.log @@ -0,0 +1,34 @@ +[08:29:59] [ServerMain/INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', servicesHost='https://api.minecraftservices.com', name='PROD' +[08:30:08] [Worker-Main-1/INFO]: Loaded 7 recipes +[08:30:12] [Server thread/INFO]: Starting minecraft server version 1.18.2 +[08:30:12] [Server thread/INFO]: Loading properties +[08:30:12] [Server thread/INFO]: This server is running Paper version git-Paper-333 (MC: 1.18.2) (Implementing API version 1.18.2-R0.1-SNAPSHOT) (Git: 9fd870d) +[08:30:12] [Server thread/INFO]: Server Ping Player Sample Count: 12 +[08:30:12] [Server thread/INFO]: Using 4 threads for Netty based IO +[08:30:13] [Server thread/INFO]: Default game type: SURVIVAL +[08:30:13] [Server thread/INFO]: Generating keypair +[08:30:13] [Server thread/INFO]: Starting Minecraft server on *:32699 +[08:30:13] [Server thread/INFO]: Using epoll channel type +[08:30:13] [Server thread/INFO]: Paper: Using libdeflate (Linux x86_64) compression from Velocity. +[08:30:13] [Server thread/INFO]: Paper: Using OpenSSL 1.1.x (Linux x86_64) cipher from Velocity. +[08:30:13] [Server thread/ERROR]: Could not load 'plugins/ViaBackwards-4.2.1.jar' in folder 'plugins' +org.bukkit.plugin.UnknownDependencyException: Unknown/missing dependency plugins: [ViaVersion]. Please download and install these plugins to run 'ViaBackwards'. + at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:291) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?] + at org.bukkit.craftbukkit.v1_18_R2.CraftServer.loadPlugins(CraftServer.java:418) ~[paper-1.18.2.jar:git-Paper-333] + at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:288) ~[paper-1.18.2.jar:git-Paper-333] + at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1163) ~[paper-1.18.2.jar:git-Paper-333] + at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.18.2.jar:git-Paper-333] + at java.lang.Thread.run(Thread.java:833) ~[?:?] +[08:30:13] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it +[08:30:13] [Server thread/INFO]: Preparing level "world" +[08:30:24] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld +[08:30:26] [Worker-Main-1/INFO]: Preparing spawn area: 0% +[08:30:26] [Worker-Main-1/INFO]: Preparing spawn area: 99% +[08:30:36] [Server thread/INFO]: Time elapsed: 937 ms +[08:30:36] [Server thread/INFO]: Starting GS4 status listener +[08:30:36] [Query Listener #1/INFO]: Query running on 0.0.0.0:9898 +[08:30:36] [Server thread/INFO]: Thread Query Listener started +[08:30:36] [Server thread/INFO]: JMX monitoring enabled +[08:30:36] [Server thread/INFO]: Running delayed init tasks +[08:30:36] [Server thread/INFO]: Done (24.549s)! For help, type "help" +[08:30:36] [Server thread/INFO]: Timings Reset \ No newline at end of file diff --git a/test/tests/auto/Bukkit/PaperPluginDependency1182Test.php b/test/tests/auto/Bukkit/PaperPluginDependency1182Test.php new file mode 100644 index 00000000..c4fc8b33 --- /dev/null +++ b/test/tests/auto/Bukkit/PaperPluginDependency1182Test.php @@ -0,0 +1,632 @@ +setLogFile($logFile); + $log = $detective->detect(); + $log->parse(); + $analysis = $log->analyse(); + + $expectedLog = 'Aternos\Codex\Minecraft\Log\PaperLog Object +( + [entries:protected] => Array + ( + [0] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:29:59] [ServerMain/INFO]: Environment: authHost=\'https://authserver.mojang.com\', accountsHost=\'https://api.mojang.com\', sessionHost=\'https://sessionserver.mojang.com\', servicesHost=\'https://api.minecraftservices.com\', name=\'PROD\' + [number:protected] => 1 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:29:59] [ServerMain/INFO]: + ) + + [1] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:08] [Worker-Main-1/INFO]: Loaded 7 recipes + [number:protected] => 2 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:08] [Worker-Main-1/INFO]: + ) + + [2] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:12] [Server thread/INFO]: Starting minecraft server version 1.18.2 + [number:protected] => 3 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:12] [Server thread/INFO]: + ) + + [3] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:12] [Server thread/INFO]: Loading properties + [number:protected] => 4 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:12] [Server thread/INFO]: + ) + + [4] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:12] [Server thread/INFO]: This server is running Paper version git-Paper-333 (MC: 1.18.2) (Implementing API version 1.18.2-R0.1-SNAPSHOT) (Git: 9fd870d) + [number:protected] => 5 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:12] [Server thread/INFO]: + ) + + [5] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:12] [Server thread/INFO]: Server Ping Player Sample Count: 12 + [number:protected] => 6 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:12] [Server thread/INFO]: + ) + + [6] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:12] [Server thread/INFO]: Using 4 threads for Netty based IO + [number:protected] => 7 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:12] [Server thread/INFO]: + ) + + [7] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:13] [Server thread/INFO]: Default game type: SURVIVAL + [number:protected] => 8 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:13] [Server thread/INFO]: + ) + + [8] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:13] [Server thread/INFO]: Generating keypair + [number:protected] => 9 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:13] [Server thread/INFO]: + ) + + [9] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:13] [Server thread/INFO]: Starting Minecraft server on *:32699 + [number:protected] => 10 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:13] [Server thread/INFO]: + ) + + [10] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:13] [Server thread/INFO]: Using epoll channel type + [number:protected] => 11 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:13] [Server thread/INFO]: + ) + + [11] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:13] [Server thread/INFO]: Paper: Using libdeflate (Linux x86_64) compression from Velocity. + [number:protected] => 12 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:13] [Server thread/INFO]: + ) + + [12] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:13] [Server thread/INFO]: Paper: Using OpenSSL 1.1.x (Linux x86_64) cipher from Velocity. + [number:protected] => 13 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:13] [Server thread/INFO]: + ) + + [13] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:13] [Server thread/ERROR]: Could not load \'plugins/ViaBackwards-4.2.1.jar\' in folder \'plugins\' + [number:protected] => 14 + ) + + [1] => Aternos\Codex\Log\Line Object + ( + [text:protected] => org.bukkit.plugin.UnknownDependencyException: Unknown/missing dependency plugins: [ViaVersion]. Please download and install these plugins to run \'ViaBackwards\'. + [number:protected] => 15 + ) + + [2] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:291) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?] + [number:protected] => 16 + ) + + [3] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at org.bukkit.craftbukkit.v1_18_R2.CraftServer.loadPlugins(CraftServer.java:418) ~[paper-1.18.2.jar:git-Paper-333] + [number:protected] => 17 + ) + + [4] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:288) ~[paper-1.18.2.jar:git-Paper-333] + [number:protected] => 18 + ) + + [5] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1163) ~[paper-1.18.2.jar:git-Paper-333] + [number:protected] => 19 + ) + + [6] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.18.2.jar:git-Paper-333] + [number:protected] => 20 + ) + + [7] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at java.lang.Thread.run(Thread.java:833) ~[?:?] + [number:protected] => 21 + ) + + ) + + [level:protected] => ERROR + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:13] [Server thread/ERROR]: + ) + + [14] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:13] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it + [number:protected] => 22 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:13] [Server thread/INFO]: + ) + + [15] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:13] [Server thread/INFO]: Preparing level "world" + [number:protected] => 23 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:13] [Server thread/INFO]: + ) + + [16] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:24] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld + [number:protected] => 24 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:24] [Server thread/INFO]: + ) + + [17] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:26] [Worker-Main-1/INFO]: Preparing spawn area: 0% + [number:protected] => 25 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:26] [Worker-Main-1/INFO]: + ) + + [18] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:26] [Worker-Main-1/INFO]: Preparing spawn area: 99% + [number:protected] => 26 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:26] [Worker-Main-1/INFO]: + ) + + [19] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:36] [Server thread/INFO]: Time elapsed: 937 ms + [number:protected] => 27 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:36] [Server thread/INFO]: + ) + + [20] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:36] [Server thread/INFO]: Starting GS4 status listener + [number:protected] => 28 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:36] [Server thread/INFO]: + ) + + [21] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:36] [Query Listener #1/INFO]: Query running on 0.0.0.0:9898 + [number:protected] => 29 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:36] [Query Listener #1/INFO]: + ) + + [22] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:36] [Server thread/INFO]: Thread Query Listener started + [number:protected] => 30 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:36] [Server thread/INFO]: + ) + + [23] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:36] [Server thread/INFO]: JMX monitoring enabled + [number:protected] => 31 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:36] [Server thread/INFO]: + ) + + [24] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:36] [Server thread/INFO]: Running delayed init tasks + [number:protected] => 32 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:36] [Server thread/INFO]: + ) + + [25] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:36] [Server thread/INFO]: Done (24.549s)! For help, type "help" + [number:protected] => 33 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:36] [Server thread/INFO]: + ) + + [26] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:36] [Server thread/INFO]: Timings Reset + [number:protected] => 34 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:36] [Server thread/INFO]: + ) + + ) + + [iterator:protected] => 27 + [logFile:protected] => Aternos\Codex\Log\File\PathLogFile Object + ( + [content:protected] => [08:29:59] [ServerMain/INFO]: Environment: authHost=\'https://authserver.mojang.com\', accountsHost=\'https://api.mojang.com\', sessionHost=\'https://sessionserver.mojang.com\', servicesHost=\'https://api.minecraftservices.com\', name=\'PROD\' +[08:30:08] [Worker-Main-1/INFO]: Loaded 7 recipes +[08:30:12] [Server thread/INFO]: Starting minecraft server version 1.18.2 +[08:30:12] [Server thread/INFO]: Loading properties +[08:30:12] [Server thread/INFO]: This server is running Paper version git-Paper-333 (MC: 1.18.2) (Implementing API version 1.18.2-R0.1-SNAPSHOT) (Git: 9fd870d) +[08:30:12] [Server thread/INFO]: Server Ping Player Sample Count: 12 +[08:30:12] [Server thread/INFO]: Using 4 threads for Netty based IO +[08:30:13] [Server thread/INFO]: Default game type: SURVIVAL +[08:30:13] [Server thread/INFO]: Generating keypair +[08:30:13] [Server thread/INFO]: Starting Minecraft server on *:32699 +[08:30:13] [Server thread/INFO]: Using epoll channel type +[08:30:13] [Server thread/INFO]: Paper: Using libdeflate (Linux x86_64) compression from Velocity. +[08:30:13] [Server thread/INFO]: Paper: Using OpenSSL 1.1.x (Linux x86_64) cipher from Velocity. +[08:30:13] [Server thread/ERROR]: Could not load \'plugins/ViaBackwards-4.2.1.jar\' in folder \'plugins\' +org.bukkit.plugin.UnknownDependencyException: Unknown/missing dependency plugins: [ViaVersion]. Please download and install these plugins to run \'ViaBackwards\'. + at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:291) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?] + at org.bukkit.craftbukkit.v1_18_R2.CraftServer.loadPlugins(CraftServer.java:418) ~[paper-1.18.2.jar:git-Paper-333] + at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:288) ~[paper-1.18.2.jar:git-Paper-333] + at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1163) ~[paper-1.18.2.jar:git-Paper-333] + at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.18.2.jar:git-Paper-333] + at java.lang.Thread.run(Thread.java:833) ~[?:?] +[08:30:13] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it +[08:30:13] [Server thread/INFO]: Preparing level "world" +[08:30:24] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld +[08:30:26] [Worker-Main-1/INFO]: Preparing spawn area: 0% +[08:30:26] [Worker-Main-1/INFO]: Preparing spawn area: 99% +[08:30:36] [Server thread/INFO]: Time elapsed: 937 ms +[08:30:36] [Server thread/INFO]: Starting GS4 status listener +[08:30:36] [Query Listener #1/INFO]: Query running on 0.0.0.0:9898 +[08:30:36] [Server thread/INFO]: Thread Query Listener started +[08:30:36] [Server thread/INFO]: JMX monitoring enabled +[08:30:36] [Server thread/INFO]: Running delayed init tasks +[08:30:36] [Server thread/INFO]: Done (24.549s)! For help, type "help" +[08:30:36] [Server thread/INFO]: Timings Reset + ) + +) +'; + + $expectedAnalysis = 'Aternos\Codex\Analysis\Analysis Object +( + [insights:protected] => Array + ( + [0] => Aternos\Codex\Minecraft\Analysis\Information\Vanilla\VanillaVersionInformation Object + ( + [entry:protected] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:12] [Server thread/INFO]: Starting minecraft server version 1.18.2 + [number:protected] => 3 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:12] [Server thread/INFO]: + ) + + [counter:protected] => 1 + [label:protected] => Minecraft version + [value:protected] => 1.18.2 + ) + + ) + + [iterator:protected] => 0 +) +'; + + $this->assertEquals($expectedLog, print_r($log, true)); + $this->assertEquals($expectedAnalysis, print_r($analysis, true)); + + $this->assertEquals("Minecraft version: 1.18.2", $analysis[0]->getMessage()); + + } +} \ No newline at end of file From 3d148ad9442bfc5a736c32ef63e5cc9e1473f879 Mon Sep 17 00:00:00 2001 From: Julian Date: Wed, 11 May 2022 16:51:36 +0200 Subject: [PATCH 02/12] add language variable, update test --- lang/en.json | 1 + .../Bukkit/PaperPluginDependency1182Test.php | 94 ++++++++++++++++++- 2 files changed, 94 insertions(+), 1 deletion(-) diff --git a/lang/en.json b/lang/en.json index 9d3d1ee4..df0a34a9 100644 --- a/lang/en.json +++ b/lang/en.json @@ -12,6 +12,7 @@ "pex-config-problem": "The configuration of the plugin 'PermissionsEx' is invalid.", "ambiguous-plugin-name-problem": "There are multiple plugin files for the plugin name '{{plugin-name}}': '{{first-plugin-path}}' and '{{second-plugin-path}}'.", "plugin-dependency-problem": "The plugin '{{plugin-name}}' is missing the required the plugin '{{dependency-plugin-name}}'.", + "plugin-dependencies-problem": "The plugin '{{plugin-name}}' is missing the required the plugins '{{dependency-plugin-names}}'.", "plugin-disabling-problem": "The plugin '{{plugin-name}}' could not be disabled.", "plugin-enabling-problem": "The plugin '{{plugin-name}}' could not be enabled.", "plugin-runtime-problem": "The plugin '{{plugin-name}}' has a problem while running.", diff --git a/test/tests/auto/Bukkit/PaperPluginDependency1182Test.php b/test/tests/auto/Bukkit/PaperPluginDependency1182Test.php index c4fc8b33..19f5dd89 100644 --- a/test/tests/auto/Bukkit/PaperPluginDependency1182Test.php +++ b/test/tests/auto/Bukkit/PaperPluginDependency1182Test.php @@ -617,9 +617,97 @@ public function testParseAndAnalyse(): void [value:protected] => 1.18.2 ) + [1] => Aternos\Codex\Minecraft\Analysis\Problem\Bukkit\PluginDependenciesProblem Object + ( + [entry:protected] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:13] [Server thread/ERROR]: Could not load \'plugins/ViaBackwards-4.2.1.jar\' in folder \'plugins\' + [number:protected] => 14 + ) + + [1] => Aternos\Codex\Log\Line Object + ( + [text:protected] => org.bukkit.plugin.UnknownDependencyException: Unknown/missing dependency plugins: [ViaVersion]. Please download and install these plugins to run \'ViaBackwards\'. + [number:protected] => 15 + ) + + [2] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:291) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?] + [number:protected] => 16 + ) + + [3] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at org.bukkit.craftbukkit.v1_18_R2.CraftServer.loadPlugins(CraftServer.java:418) ~[paper-1.18.2.jar:git-Paper-333] + [number:protected] => 17 + ) + + [4] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:288) ~[paper-1.18.2.jar:git-Paper-333] + [number:protected] => 18 + ) + + [5] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1163) ~[paper-1.18.2.jar:git-Paper-333] + [number:protected] => 19 + ) + + [6] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.18.2.jar:git-Paper-333] + [number:protected] => 20 + ) + + [7] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at java.lang.Thread.run(Thread.java:833) ~[?:?] + [number:protected] => 21 + ) + + ) + + [level:protected] => ERROR + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:13] [Server thread/ERROR]: + ) + + [counter:protected] => 1 + [solutions:protected] => Array + ( + [0] => Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginInstallSolution Object + ( + [pluginName:protected] => + ) + + [1] => Aternos\Codex\Minecraft\Analysis\Solution\File\FileDeleteSolution Object + ( + [path:protected] => plugins/ViaBackwards-4.2.1.jar + [relativePath:protected] => 1 + ) + + ) + + [iterator:protected] => 0 + [pluginPath:protected] => plugins/ViaBackwards-4.2.1.jar + [pluginName:protected] => ViaBackwards-4.2.1 + [dependencyPluginNames:protected] => Array + ( + [0] => + ) + + ) + ) - [iterator:protected] => 0 + [iterator:protected] => 1 ) '; @@ -628,5 +716,9 @@ public function testParseAndAnalyse(): void $this->assertEquals("Minecraft version: 1.18.2", $analysis[0]->getMessage()); + $this->assertEquals("The plugin 'ViaBackwards-4.2.1' is missing the required the plugins ''''.", $analysis[1]->getMessage()); + $this->assertEquals("Install the plugin ''.", $analysis[1][0]->getMessage()); + $this->assertEquals("Delete the file 'plugins/ViaBackwards-4.2.1.jar'.", $analysis[1][1]->getMessage()); + } } \ No newline at end of file From 30392b4063d2320b18937a1a001821c54b1a92a3 Mon Sep 17 00:00:00 2001 From: Julian Date: Wed, 11 May 2022 16:54:13 +0200 Subject: [PATCH 03/12] remove unused capture group --- src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php | 2 +- test/tests/auto/Bukkit/PaperPluginDependency1182Test.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php b/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php index 012e1fea..87178ccf 100644 --- a/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php @@ -78,7 +78,7 @@ public function getMessage(): string */ public static function getPatterns(): array { - return ['/Could not load \'(plugins[\/\\\]((?!\.jar).*)\.jar)\' in folder \'[^\']+\'\norg\.bukkit\.plugin\.UnknownDependencyException\: (?:(\w+)\n|Unknown\/missing dependency plugins: \[([\w ,]+))\]/']; + return ['/Could not load \'(plugins[\/\\\]((?!\.jar).*)\.jar)\' in folder \'[^\']+\'\norg\.bukkit\.plugin\.UnknownDependencyException\: Unknown\/missing dependency plugins: \[([\w ,]+)\]/']; } /** diff --git a/test/tests/auto/Bukkit/PaperPluginDependency1182Test.php b/test/tests/auto/Bukkit/PaperPluginDependency1182Test.php index 19f5dd89..3051ae44 100644 --- a/test/tests/auto/Bukkit/PaperPluginDependency1182Test.php +++ b/test/tests/auto/Bukkit/PaperPluginDependency1182Test.php @@ -684,7 +684,7 @@ public function testParseAndAnalyse(): void ( [0] => Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginInstallSolution Object ( - [pluginName:protected] => + [pluginName:protected] => ViaVersion ) [1] => Aternos\Codex\Minecraft\Analysis\Solution\File\FileDeleteSolution Object @@ -700,7 +700,7 @@ public function testParseAndAnalyse(): void [pluginName:protected] => ViaBackwards-4.2.1 [dependencyPluginNames:protected] => Array ( - [0] => + [0] => ViaVersion ) ) @@ -716,8 +716,8 @@ public function testParseAndAnalyse(): void $this->assertEquals("Minecraft version: 1.18.2", $analysis[0]->getMessage()); - $this->assertEquals("The plugin 'ViaBackwards-4.2.1' is missing the required the plugins ''''.", $analysis[1]->getMessage()); - $this->assertEquals("Install the plugin ''.", $analysis[1][0]->getMessage()); + $this->assertEquals("The plugin 'ViaBackwards-4.2.1' is missing the required the plugins ''ViaVersion''.", $analysis[1]->getMessage()); + $this->assertEquals("Install the plugin 'ViaVersion'.", $analysis[1][0]->getMessage()); $this->assertEquals("Delete the file 'plugins/ViaBackwards-4.2.1.jar'.", $analysis[1][1]->getMessage()); } From 548fef109f449e02c800e491456feff3c6d0ba13 Mon Sep 17 00:00:00 2001 From: Julian Date: Wed, 11 May 2022 20:14:51 +0200 Subject: [PATCH 04/12] remove additional the --- lang/en.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/en.json b/lang/en.json index df0a34a9..bd5b73b1 100644 --- a/lang/en.json +++ b/lang/en.json @@ -11,8 +11,8 @@ "authme-shutdown-problem": "The plugin 'AuthMe' fails to load and shuts the server down.", "pex-config-problem": "The configuration of the plugin 'PermissionsEx' is invalid.", "ambiguous-plugin-name-problem": "There are multiple plugin files for the plugin name '{{plugin-name}}': '{{first-plugin-path}}' and '{{second-plugin-path}}'.", - "plugin-dependency-problem": "The plugin '{{plugin-name}}' is missing the required the plugin '{{dependency-plugin-name}}'.", - "plugin-dependencies-problem": "The plugin '{{plugin-name}}' is missing the required the plugins '{{dependency-plugin-names}}'.", + "plugin-dependency-problem": "The plugin '{{plugin-name}}' is missing the required plugin '{{dependency-plugin-name}}'.", + "plugin-dependencies-problem": "The plugin '{{plugin-name}}' is missing the required plugins '{{dependency-plugin-names}}'.", "plugin-disabling-problem": "The plugin '{{plugin-name}}' could not be disabled.", "plugin-enabling-problem": "The plugin '{{plugin-name}}' could not be enabled.", "plugin-runtime-problem": "The plugin '{{plugin-name}}' has a problem while running.", From bc0cdb27c697c113147285ace0d1e602a82c2f91 Mon Sep 17 00:00:00 2001 From: Julian Date: Wed, 11 May 2022 20:15:55 +0200 Subject: [PATCH 05/12] don't use template strings --- src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php b/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php index 87178ccf..e0bc8d84 100644 --- a/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php @@ -51,7 +51,7 @@ public function getDependencyPluginNames(): string { $result = []; foreach ($this->dependencyPluginNames as $name) { - $result[] = "'$name'"; + $result[] = "'". $name ."'"; } return implode(", ", $result); } From a926b2c09a87ba208104a8526078f0f58ead3f63 Mon Sep 17 00:00:00 2001 From: Julian Date: Wed, 11 May 2022 20:18:03 +0200 Subject: [PATCH 06/12] compare arrays --- src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php b/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php index e0bc8d84..65e609a2 100644 --- a/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php @@ -107,6 +107,6 @@ public function isEqual($insight): bool { return $this->getPluginName() === $insight->getPluginName() && $this->getPluginPath() === $insight->getPluginPath() - && $this->getDependencyPluginNames() === $insight->getDependencyPluginNames(); + && $this->dependencyPluginNames == $insight->dependencyPluginNames; } } \ No newline at end of file From e8fb1725b3f0df40a002c264b5c6070a1988f803 Mon Sep 17 00:00:00 2001 From: Julian Date: Wed, 11 May 2022 20:19:56 +0200 Subject: [PATCH 07/12] update tests --- test/tests/auto/Bukkit/PaperPluginDependency1161Test.php | 2 +- test/tests/auto/Bukkit/PaperPluginDependency1182Test.php | 2 +- test/tests/auto/Bukkit/Plugin/SpigotAuthmeShutdownTest.php | 2 +- .../auto/Bukkit/Plugin/SpigotPermissionsexConfigTest.php | 2 +- test/tests/auto/Bukkit/SpigotPluginDependencyTest.php | 4 ++-- test/tests/auto/Magma/MagmaPluginDependencyTest.php | 4 ++-- .../auto/Pocketmine/PocketmineIncompatibleProtocolTest.php | 2 +- test/tests/auto/Pocketmine/PocketminePluginDependencyTest.php | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/tests/auto/Bukkit/PaperPluginDependency1161Test.php b/test/tests/auto/Bukkit/PaperPluginDependency1161Test.php index ece9d4f4..7c861cb3 100644 --- a/test/tests/auto/Bukkit/PaperPluginDependency1161Test.php +++ b/test/tests/auto/Bukkit/PaperPluginDependency1161Test.php @@ -807,7 +807,7 @@ public function testParseAndAnalyse(): void $this->assertEquals("Minecraft version: 1.16.1", $analysis[0]->getMessage()); - $this->assertEquals("The plugin 'LuckPermsChat-2.0.2' is missing the required the plugin 'LuckPerms'.", $analysis[1]->getMessage()); + $this->assertEquals("The plugin 'LuckPermsChat-2.0.2' is missing the required plugin 'LuckPerms'.", $analysis[1]->getMessage()); $this->assertEquals("Install the plugin 'LuckPerms'.", $analysis[1][0]->getMessage()); $this->assertEquals("Delete the file 'plugins/LuckPermsChat-2.0.2.jar'.", $analysis[1][1]->getMessage()); diff --git a/test/tests/auto/Bukkit/PaperPluginDependency1182Test.php b/test/tests/auto/Bukkit/PaperPluginDependency1182Test.php index 3051ae44..064e6514 100644 --- a/test/tests/auto/Bukkit/PaperPluginDependency1182Test.php +++ b/test/tests/auto/Bukkit/PaperPluginDependency1182Test.php @@ -716,7 +716,7 @@ public function testParseAndAnalyse(): void $this->assertEquals("Minecraft version: 1.18.2", $analysis[0]->getMessage()); - $this->assertEquals("The plugin 'ViaBackwards-4.2.1' is missing the required the plugins ''ViaVersion''.", $analysis[1]->getMessage()); + $this->assertEquals("The plugin 'ViaBackwards-4.2.1' is missing the required plugins ''ViaVersion''.", $analysis[1]->getMessage()); $this->assertEquals("Install the plugin 'ViaVersion'.", $analysis[1][0]->getMessage()); $this->assertEquals("Delete the file 'plugins/ViaBackwards-4.2.1.jar'.", $analysis[1][1]->getMessage()); diff --git a/test/tests/auto/Bukkit/Plugin/SpigotAuthmeShutdownTest.php b/test/tests/auto/Bukkit/Plugin/SpigotAuthmeShutdownTest.php index fe953c2a..a0db163e 100644 --- a/test/tests/auto/Bukkit/Plugin/SpigotAuthmeShutdownTest.php +++ b/test/tests/auto/Bukkit/Plugin/SpigotAuthmeShutdownTest.php @@ -10650,7 +10650,7 @@ public function testParseAndAnalyse(): void $this->assertEquals("Minecraft version: 1.12", $analysis[0]->getMessage()); - $this->assertEquals("The plugin 'AnvilLogin' is missing the required the plugin 'Languagy'.", $analysis[1]->getMessage()); + $this->assertEquals("The plugin 'AnvilLogin' is missing the required plugin 'Languagy'.", $analysis[1]->getMessage()); $this->assertEquals("Install the plugin 'Languagy'.", $analysis[1][0]->getMessage()); $this->assertEquals("Delete the file 'plugins/AnvilLogin.jar'.", $analysis[1][1]->getMessage()); diff --git a/test/tests/auto/Bukkit/Plugin/SpigotPermissionsexConfigTest.php b/test/tests/auto/Bukkit/Plugin/SpigotPermissionsexConfigTest.php index bf0c8b68..7105fd74 100644 --- a/test/tests/auto/Bukkit/Plugin/SpigotPermissionsexConfigTest.php +++ b/test/tests/auto/Bukkit/Plugin/SpigotPermissionsexConfigTest.php @@ -27690,7 +27690,7 @@ public function testParseAndAnalyse(): void $this->assertEquals("Install a different version of the plugin 'SlashServer'.", $analysis[8][0]->getMessage()); $this->assertEquals("Delete the file 'plugins/SlashServer.jar'.", $analysis[8][1]->getMessage()); - $this->assertEquals("The plugin 'AreaShop' is missing the required the plugin 'WorldGuard'.", $analysis[9]->getMessage()); + $this->assertEquals("The plugin 'AreaShop' is missing the required plugin 'WorldGuard'.", $analysis[9]->getMessage()); $this->assertEquals("Install the plugin 'WorldGuard'.", $analysis[9][0]->getMessage()); $this->assertEquals("Delete the file 'plugins/AreaShop.jar'.", $analysis[9][1]->getMessage()); diff --git a/test/tests/auto/Bukkit/SpigotPluginDependencyTest.php b/test/tests/auto/Bukkit/SpigotPluginDependencyTest.php index 51684d67..84be5f6d 100644 --- a/test/tests/auto/Bukkit/SpigotPluginDependencyTest.php +++ b/test/tests/auto/Bukkit/SpigotPluginDependencyTest.php @@ -598,11 +598,11 @@ public function testParseAndAnalyse(): void $this->assertEquals("Minecraft version: 1.8.8", $analysis[0]->getMessage()); - $this->assertEquals("The plugin 'FactionsShop' is missing the required the plugin 'Vault'.", $analysis[1]->getMessage()); + $this->assertEquals("The plugin 'FactionsShop' is missing the required plugin 'Vault'.", $analysis[1]->getMessage()); $this->assertEquals("Install the plugin 'Vault'.", $analysis[1][0]->getMessage()); $this->assertEquals("Delete the file 'plugins/FactionsShop.jar'.", $analysis[1][1]->getMessage()); - $this->assertEquals("The plugin 'BasicTab' is missing the required the plugin 'ProtocolLib'.", $analysis[2]->getMessage()); + $this->assertEquals("The plugin 'BasicTab' is missing the required plugin 'ProtocolLib'.", $analysis[2]->getMessage()); $this->assertEquals("Install the plugin 'ProtocolLib'.", $analysis[2][0]->getMessage()); $this->assertEquals("Delete the file 'plugins/BasicTab.jar'.", $analysis[2][1]->getMessage()); diff --git a/test/tests/auto/Magma/MagmaPluginDependencyTest.php b/test/tests/auto/Magma/MagmaPluginDependencyTest.php index 7d722e49..502c8cce 100644 --- a/test/tests/auto/Magma/MagmaPluginDependencyTest.php +++ b/test/tests/auto/Magma/MagmaPluginDependencyTest.php @@ -671,11 +671,11 @@ public function testParseAndAnalyse(): void $this->assertEquals("Forge version: 14.23.5.2814", $analysis[2]->getMessage()); - $this->assertEquals("The plugin 'FactionsShop' is missing the required the plugin 'Vault'.", $analysis[3]->getMessage()); + $this->assertEquals("The plugin 'FactionsShop' is missing the required plugin 'Vault'.", $analysis[3]->getMessage()); $this->assertEquals("Install the plugin 'Vault'.", $analysis[3][0]->getMessage()); $this->assertEquals("Delete the file 'plugins/FactionsShop.jar'.", $analysis[3][1]->getMessage()); - $this->assertEquals("The plugin 'BasicTab' is missing the required the plugin 'ProtocolLib'.", $analysis[4]->getMessage()); + $this->assertEquals("The plugin 'BasicTab' is missing the required plugin 'ProtocolLib'.", $analysis[4]->getMessage()); $this->assertEquals("Install the plugin 'ProtocolLib'.", $analysis[4][0]->getMessage()); $this->assertEquals("Delete the file 'plugins/BasicTab.jar'.", $analysis[4][1]->getMessage()); diff --git a/test/tests/auto/Pocketmine/PocketmineIncompatibleProtocolTest.php b/test/tests/auto/Pocketmine/PocketmineIncompatibleProtocolTest.php index 46d0a778..70b99b2a 100644 --- a/test/tests/auto/Pocketmine/PocketmineIncompatibleProtocolTest.php +++ b/test/tests/auto/Pocketmine/PocketmineIncompatibleProtocolTest.php @@ -3749,7 +3749,7 @@ public function testParseAndAnalyse(): void $this->assertEquals("Install a different version of the plugin 'Mineflow'.", $analysis[6][0]->getMessage()); $this->assertEquals("Remove the plugin 'Mineflow'.", $analysis[6][1]->getMessage()); - $this->assertEquals("The plugin 'QuestPlugin' is missing the required the plugin 'Slapper'.", $analysis[7]->getMessage()); + $this->assertEquals("The plugin 'QuestPlugin' is missing the required plugin 'Slapper'.", $analysis[7]->getMessage()); $this->assertEquals("Install the plugin 'Slapper'.", $analysis[7][0]->getMessage()); $this->assertEquals("Remove the plugin 'QuestPlugin'.", $analysis[7][1]->getMessage()); diff --git a/test/tests/auto/Pocketmine/PocketminePluginDependencyTest.php b/test/tests/auto/Pocketmine/PocketminePluginDependencyTest.php index a241a255..d19f9001 100644 --- a/test/tests/auto/Pocketmine/PocketminePluginDependencyTest.php +++ b/test/tests/auto/Pocketmine/PocketminePluginDependencyTest.php @@ -513,7 +513,7 @@ public function testParseAndAnalyse(): void $this->assertEquals("Pocketmine version: 3.7.0", $analysis[1]->getMessage()); - $this->assertEquals("The plugin 'BankNotes' is missing the required the plugin 'EconomyAPI'.", $analysis[2]->getMessage()); + $this->assertEquals("The plugin 'BankNotes' is missing the required plugin 'EconomyAPI'.", $analysis[2]->getMessage()); $this->assertEquals("Install the plugin 'EconomyAPI'.", $analysis[2][0]->getMessage()); $this->assertEquals("Remove the plugin 'BankNotes'.", $analysis[2][1]->getMessage()); From 32a37e5dc6f763386ff158e005fb4f6eaa18bc8f Mon Sep 17 00:00:00 2001 From: Julian Date: Wed, 11 May 2022 21:39:44 +0200 Subject: [PATCH 08/12] test case with two dependencies --- lang/en.json | 2 +- .../bukkit/paper-multiple-dependencies.log | 36 + .../Bukkit/PaperMultipleDependenciesTest.php | 769 ++++++++++++++++++ .../Bukkit/PaperPluginDependency1182Test.php | 2 +- 4 files changed, 807 insertions(+), 2 deletions(-) create mode 100644 test/data/bukkit/paper-multiple-dependencies.log create mode 100644 test/tests/auto/Bukkit/PaperMultipleDependenciesTest.php diff --git a/lang/en.json b/lang/en.json index bd5b73b1..62f967b1 100644 --- a/lang/en.json +++ b/lang/en.json @@ -12,7 +12,7 @@ "pex-config-problem": "The configuration of the plugin 'PermissionsEx' is invalid.", "ambiguous-plugin-name-problem": "There are multiple plugin files for the plugin name '{{plugin-name}}': '{{first-plugin-path}}' and '{{second-plugin-path}}'.", "plugin-dependency-problem": "The plugin '{{plugin-name}}' is missing the required plugin '{{dependency-plugin-name}}'.", - "plugin-dependencies-problem": "The plugin '{{plugin-name}}' is missing the required plugins '{{dependency-plugin-names}}'.", + "plugin-dependencies-problem": "The plugin '{{plugin-name}}' is missing the required plugins {{dependency-plugin-names}}.", "plugin-disabling-problem": "The plugin '{{plugin-name}}' could not be disabled.", "plugin-enabling-problem": "The plugin '{{plugin-name}}' could not be enabled.", "plugin-runtime-problem": "The plugin '{{plugin-name}}' has a problem while running.", diff --git a/test/data/bukkit/paper-multiple-dependencies.log b/test/data/bukkit/paper-multiple-dependencies.log new file mode 100644 index 00000000..e3045160 --- /dev/null +++ b/test/data/bukkit/paper-multiple-dependencies.log @@ -0,0 +1,36 @@ +[14:22:43] [ServerMain/INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', servicesHost='https://api.minecraftservices.com', name='PROD' +[14:22:45] [Worker-Main-1/INFO]: Loaded 7 recipes +[14:22:46] [Server thread/INFO]: Starting minecraft server version 1.18.2 +[14:22:46] [Server thread/INFO]: Loading properties +[14:22:46] [Server thread/INFO]: This server is running Paper version git-Paper-333 (MC: 1.18.2) (Implementing API version 1.18.2-R0.1-SNAPSHOT) (Git: 9fd870d) +[14:22:46] [Server thread/INFO]: Server Ping Player Sample Count: 12 +[14:22:46] [Server thread/INFO]: Using 4 threads for Netty based IO +[14:22:46] [Server thread/INFO]: Default game type: SURVIVAL +[14:22:46] [Server thread/INFO]: Generating keypair +[14:22:46] [Server thread/INFO]: Starting Minecraft server on *:23728 +[14:22:46] [Server thread/INFO]: Using epoll channel type +[14:22:46] [Server thread/INFO]: Paper: Using libdeflate (Linux x86_64) compression from Velocity. +[14:22:46] [Server thread/INFO]: Paper: Using OpenSSL 1.1.x (Linux x86_64) cipher from Velocity. +[14:22:46] [Server thread/ERROR]: Could not load 'plugins/mclogs-bukkit-2.3.1.jar' in folder 'plugins' +org.bukkit.plugin.UnknownDependencyException: Unknown/missing dependency plugins: [example2, example1]. Please download and install these plugins to run 'Mclogs'. + at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:291) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?] + at org.bukkit.craftbukkit.v1_18_R2.CraftServer.loadPlugins(CraftServer.java:418) ~[paper-1.18.2.jar:git-Paper-333] + at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:288) ~[paper-1.18.2.jar:git-Paper-333] + at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1163) ~[paper-1.18.2.jar:git-Paper-333] + at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.18.2.jar:git-Paper-333] + at java.lang.Thread.run(Thread.java:833) ~[?:?] +[14:22:46] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it +[14:22:46] [Server thread/INFO]: Preparing level "world" +[14:22:52] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld +[14:22:53] [Server thread/INFO]: Time elapsed: 243 ms +[14:22:53] [Server thread/INFO]: Preparing start region for dimension minecraft:the_nether +[14:22:53] [Server thread/INFO]: Time elapsed: 153 ms +[14:22:53] [Server thread/INFO]: Preparing start region for dimension minecraft:the_end +[14:22:53] [Server thread/INFO]: Time elapsed: 193 ms +[14:22:53] [Server thread/INFO]: Starting GS4 status listener +[14:22:53] [Server thread/INFO]: Thread Query Listener started +[14:22:53] [Query Listener #1/INFO]: Query running on 0.0.0.0:9898 +[14:22:53] [Server thread/INFO]: JMX monitoring enabled +[14:22:53] [Server thread/INFO]: Running delayed init tasks +[14:22:53] [Server thread/INFO]: Done (7.061s)! For help, type "help" +[14:22:53] [Server thread/INFO]: Timings Reset \ No newline at end of file diff --git a/test/tests/auto/Bukkit/PaperMultipleDependenciesTest.php b/test/tests/auto/Bukkit/PaperMultipleDependenciesTest.php new file mode 100644 index 00000000..05b5748b --- /dev/null +++ b/test/tests/auto/Bukkit/PaperMultipleDependenciesTest.php @@ -0,0 +1,769 @@ +setLogFile($logFile); + $log = $detective->detect(); + $log->parse(); + $analysis = $log->analyse(); + + $expectedLog = 'Aternos\Codex\Minecraft\Log\PaperLog Object +( + [entries:protected] => Array + ( + [0] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [14:22:43] [ServerMain/INFO]: Environment: authHost=\'https://authserver.mojang.com\', accountsHost=\'https://api.mojang.com\', sessionHost=\'https://sessionserver.mojang.com\', servicesHost=\'https://api.minecraftservices.com\', name=\'PROD\' + [number:protected] => 1 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [14:22:43] [ServerMain/INFO]: + ) + + [1] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [14:22:45] [Worker-Main-1/INFO]: Loaded 7 recipes + [number:protected] => 2 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [14:22:45] [Worker-Main-1/INFO]: + ) + + [2] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [14:22:46] [Server thread/INFO]: Starting minecraft server version 1.18.2 + [number:protected] => 3 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [14:22:46] [Server thread/INFO]: + ) + + [3] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [14:22:46] [Server thread/INFO]: Loading properties + [number:protected] => 4 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [14:22:46] [Server thread/INFO]: + ) + + [4] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [14:22:46] [Server thread/INFO]: This server is running Paper version git-Paper-333 (MC: 1.18.2) (Implementing API version 1.18.2-R0.1-SNAPSHOT) (Git: 9fd870d) + [number:protected] => 5 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [14:22:46] [Server thread/INFO]: + ) + + [5] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [14:22:46] [Server thread/INFO]: Server Ping Player Sample Count: 12 + [number:protected] => 6 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [14:22:46] [Server thread/INFO]: + ) + + [6] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [14:22:46] [Server thread/INFO]: Using 4 threads for Netty based IO + [number:protected] => 7 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [14:22:46] [Server thread/INFO]: + ) + + [7] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [14:22:46] [Server thread/INFO]: Default game type: SURVIVAL + [number:protected] => 8 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [14:22:46] [Server thread/INFO]: + ) + + [8] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [14:22:46] [Server thread/INFO]: Generating keypair + [number:protected] => 9 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [14:22:46] [Server thread/INFO]: + ) + + [9] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [14:22:46] [Server thread/INFO]: Starting Minecraft server on *:23728 + [number:protected] => 10 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [14:22:46] [Server thread/INFO]: + ) + + [10] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [14:22:46] [Server thread/INFO]: Using epoll channel type + [number:protected] => 11 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [14:22:46] [Server thread/INFO]: + ) + + [11] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [14:22:46] [Server thread/INFO]: Paper: Using libdeflate (Linux x86_64) compression from Velocity. + [number:protected] => 12 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [14:22:46] [Server thread/INFO]: + ) + + [12] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [14:22:46] [Server thread/INFO]: Paper: Using OpenSSL 1.1.x (Linux x86_64) cipher from Velocity. + [number:protected] => 13 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [14:22:46] [Server thread/INFO]: + ) + + [13] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [14:22:46] [Server thread/ERROR]: Could not load \'plugins/mclogs-bukkit-2.3.1.jar\' in folder \'plugins\' + [number:protected] => 14 + ) + + [1] => Aternos\Codex\Log\Line Object + ( + [text:protected] => org.bukkit.plugin.UnknownDependencyException: Unknown/missing dependency plugins: [example2, example1]. Please download and install these plugins to run \'Mclogs\'. + [number:protected] => 15 + ) + + [2] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:291) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?] + [number:protected] => 16 + ) + + [3] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at org.bukkit.craftbukkit.v1_18_R2.CraftServer.loadPlugins(CraftServer.java:418) ~[paper-1.18.2.jar:git-Paper-333] + [number:protected] => 17 + ) + + [4] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:288) ~[paper-1.18.2.jar:git-Paper-333] + [number:protected] => 18 + ) + + [5] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1163) ~[paper-1.18.2.jar:git-Paper-333] + [number:protected] => 19 + ) + + [6] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.18.2.jar:git-Paper-333] + [number:protected] => 20 + ) + + [7] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at java.lang.Thread.run(Thread.java:833) ~[?:?] + [number:protected] => 21 + ) + + ) + + [level:protected] => ERROR + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [14:22:46] [Server thread/ERROR]: + ) + + [14] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [14:22:46] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it + [number:protected] => 22 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [14:22:46] [Server thread/INFO]: + ) + + [15] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [14:22:46] [Server thread/INFO]: Preparing level "world" + [number:protected] => 23 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [14:22:46] [Server thread/INFO]: + ) + + [16] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [14:22:52] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld + [number:protected] => 24 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [14:22:52] [Server thread/INFO]: + ) + + [17] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [14:22:53] [Server thread/INFO]: Time elapsed: 243 ms + [number:protected] => 25 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [14:22:53] [Server thread/INFO]: + ) + + [18] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [14:22:53] [Server thread/INFO]: Preparing start region for dimension minecraft:the_nether + [number:protected] => 26 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [14:22:53] [Server thread/INFO]: + ) + + [19] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [14:22:53] [Server thread/INFO]: Time elapsed: 153 ms + [number:protected] => 27 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [14:22:53] [Server thread/INFO]: + ) + + [20] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [14:22:53] [Server thread/INFO]: Preparing start region for dimension minecraft:the_end + [number:protected] => 28 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [14:22:53] [Server thread/INFO]: + ) + + [21] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [14:22:53] [Server thread/INFO]: Time elapsed: 193 ms + [number:protected] => 29 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [14:22:53] [Server thread/INFO]: + ) + + [22] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [14:22:53] [Server thread/INFO]: Starting GS4 status listener + [number:protected] => 30 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [14:22:53] [Server thread/INFO]: + ) + + [23] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [14:22:53] [Server thread/INFO]: Thread Query Listener started + [number:protected] => 31 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [14:22:53] [Server thread/INFO]: + ) + + [24] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [14:22:53] [Query Listener #1/INFO]: Query running on 0.0.0.0:9898 + [number:protected] => 32 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [14:22:53] [Query Listener #1/INFO]: + ) + + [25] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [14:22:53] [Server thread/INFO]: JMX monitoring enabled + [number:protected] => 33 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [14:22:53] [Server thread/INFO]: + ) + + [26] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [14:22:53] [Server thread/INFO]: Running delayed init tasks + [number:protected] => 34 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [14:22:53] [Server thread/INFO]: + ) + + [27] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [14:22:53] [Server thread/INFO]: Done (7.061s)! For help, type "help" + [number:protected] => 35 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [14:22:53] [Server thread/INFO]: + ) + + [28] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [14:22:53] [Server thread/INFO]: Timings Reset + [number:protected] => 36 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [14:22:53] [Server thread/INFO]: + ) + + ) + + [iterator:protected] => 29 + [logFile:protected] => Aternos\Codex\Log\File\PathLogFile Object + ( + [content:protected] => [14:22:43] [ServerMain/INFO]: Environment: authHost=\'https://authserver.mojang.com\', accountsHost=\'https://api.mojang.com\', sessionHost=\'https://sessionserver.mojang.com\', servicesHost=\'https://api.minecraftservices.com\', name=\'PROD\' +[14:22:45] [Worker-Main-1/INFO]: Loaded 7 recipes +[14:22:46] [Server thread/INFO]: Starting minecraft server version 1.18.2 +[14:22:46] [Server thread/INFO]: Loading properties +[14:22:46] [Server thread/INFO]: This server is running Paper version git-Paper-333 (MC: 1.18.2) (Implementing API version 1.18.2-R0.1-SNAPSHOT) (Git: 9fd870d) +[14:22:46] [Server thread/INFO]: Server Ping Player Sample Count: 12 +[14:22:46] [Server thread/INFO]: Using 4 threads for Netty based IO +[14:22:46] [Server thread/INFO]: Default game type: SURVIVAL +[14:22:46] [Server thread/INFO]: Generating keypair +[14:22:46] [Server thread/INFO]: Starting Minecraft server on *:23728 +[14:22:46] [Server thread/INFO]: Using epoll channel type +[14:22:46] [Server thread/INFO]: Paper: Using libdeflate (Linux x86_64) compression from Velocity. +[14:22:46] [Server thread/INFO]: Paper: Using OpenSSL 1.1.x (Linux x86_64) cipher from Velocity. +[14:22:46] [Server thread/ERROR]: Could not load \'plugins/mclogs-bukkit-2.3.1.jar\' in folder \'plugins\' +org.bukkit.plugin.UnknownDependencyException: Unknown/missing dependency plugins: [example2, example1]. Please download and install these plugins to run \'Mclogs\'. + at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:291) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?] + at org.bukkit.craftbukkit.v1_18_R2.CraftServer.loadPlugins(CraftServer.java:418) ~[paper-1.18.2.jar:git-Paper-333] + at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:288) ~[paper-1.18.2.jar:git-Paper-333] + at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1163) ~[paper-1.18.2.jar:git-Paper-333] + at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.18.2.jar:git-Paper-333] + at java.lang.Thread.run(Thread.java:833) ~[?:?] +[14:22:46] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it +[14:22:46] [Server thread/INFO]: Preparing level "world" +[14:22:52] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld +[14:22:53] [Server thread/INFO]: Time elapsed: 243 ms +[14:22:53] [Server thread/INFO]: Preparing start region for dimension minecraft:the_nether +[14:22:53] [Server thread/INFO]: Time elapsed: 153 ms +[14:22:53] [Server thread/INFO]: Preparing start region for dimension minecraft:the_end +[14:22:53] [Server thread/INFO]: Time elapsed: 193 ms +[14:22:53] [Server thread/INFO]: Starting GS4 status listener +[14:22:53] [Server thread/INFO]: Thread Query Listener started +[14:22:53] [Query Listener #1/INFO]: Query running on 0.0.0.0:9898 +[14:22:53] [Server thread/INFO]: JMX monitoring enabled +[14:22:53] [Server thread/INFO]: Running delayed init tasks +[14:22:53] [Server thread/INFO]: Done (7.061s)! For help, type "help" +[14:22:53] [Server thread/INFO]: Timings Reset + ) + +) +'; + + $expectedAnalysis = 'Aternos\Codex\Analysis\Analysis Object +( + [insights:protected] => Array + ( + [0] => Aternos\Codex\Minecraft\Analysis\Information\Vanilla\VanillaVersionInformation Object + ( + [entry:protected] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [14:22:46] [Server thread/INFO]: Starting minecraft server version 1.18.2 + [number:protected] => 3 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [14:22:46] [Server thread/INFO]: + ) + + [counter:protected] => 1 + [label:protected] => Minecraft version + [value:protected] => 1.18.2 + ) + + [1] => Aternos\Codex\Minecraft\Analysis\Problem\Bukkit\PluginDependenciesProblem Object + ( + [entry:protected] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [14:22:46] [Server thread/ERROR]: Could not load \'plugins/mclogs-bukkit-2.3.1.jar\' in folder \'plugins\' + [number:protected] => 14 + ) + + [1] => Aternos\Codex\Log\Line Object + ( + [text:protected] => org.bukkit.plugin.UnknownDependencyException: Unknown/missing dependency plugins: [example2, example1]. Please download and install these plugins to run \'Mclogs\'. + [number:protected] => 15 + ) + + [2] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:291) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?] + [number:protected] => 16 + ) + + [3] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at org.bukkit.craftbukkit.v1_18_R2.CraftServer.loadPlugins(CraftServer.java:418) ~[paper-1.18.2.jar:git-Paper-333] + [number:protected] => 17 + ) + + [4] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:288) ~[paper-1.18.2.jar:git-Paper-333] + [number:protected] => 18 + ) + + [5] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1163) ~[paper-1.18.2.jar:git-Paper-333] + [number:protected] => 19 + ) + + [6] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.18.2.jar:git-Paper-333] + [number:protected] => 20 + ) + + [7] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at java.lang.Thread.run(Thread.java:833) ~[?:?] + [number:protected] => 21 + ) + + ) + + [level:protected] => ERROR + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [14:22:46] [Server thread/ERROR]: + ) + + [counter:protected] => 1 + [solutions:protected] => Array + ( + [0] => Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginInstallSolution Object + ( + [pluginName:protected] => example2 + ) + + [1] => Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginInstallSolution Object + ( + [pluginName:protected] => example1 + ) + + [2] => Aternos\Codex\Minecraft\Analysis\Solution\File\FileDeleteSolution Object + ( + [path:protected] => plugins/mclogs-bukkit-2.3.1.jar + [relativePath:protected] => 1 + ) + + ) + + [iterator:protected] => 0 + [pluginPath:protected] => plugins/mclogs-bukkit-2.3.1.jar + [pluginName:protected] => mclogs-bukkit-2.3.1 + [dependencyPluginNames:protected] => Array + ( + [0] => example2 + [1] => example1 + ) + + ) + + ) + + [iterator:protected] => 1 +) +'; + + $this->assertEquals($expectedLog, print_r($log, true)); + $this->assertEquals($expectedAnalysis, print_r($analysis, true)); + + $this->assertEquals("Minecraft version: 1.18.2", $analysis[0]->getMessage()); + + $this->assertEquals("The plugin 'mclogs-bukkit-2.3.1' is missing the required plugins 'example2', 'example1'.", $analysis[1]->getMessage()); + $this->assertEquals("Install the plugin 'example2'.", $analysis[1][0]->getMessage()); + $this->assertEquals("Install the plugin 'example1'.", $analysis[1][1]->getMessage()); + $this->assertEquals("Delete the file 'plugins/mclogs-bukkit-2.3.1.jar'.", $analysis[1][2]->getMessage()); + + } +} \ No newline at end of file diff --git a/test/tests/auto/Bukkit/PaperPluginDependency1182Test.php b/test/tests/auto/Bukkit/PaperPluginDependency1182Test.php index 064e6514..cd10d398 100644 --- a/test/tests/auto/Bukkit/PaperPluginDependency1182Test.php +++ b/test/tests/auto/Bukkit/PaperPluginDependency1182Test.php @@ -716,7 +716,7 @@ public function testParseAndAnalyse(): void $this->assertEquals("Minecraft version: 1.18.2", $analysis[0]->getMessage()); - $this->assertEquals("The plugin 'ViaBackwards-4.2.1' is missing the required plugins ''ViaVersion''.", $analysis[1]->getMessage()); + $this->assertEquals("The plugin 'ViaBackwards-4.2.1' is missing the required plugins 'ViaVersion'.", $analysis[1]->getMessage()); $this->assertEquals("Install the plugin 'ViaVersion'.", $analysis[1][0]->getMessage()); $this->assertEquals("Delete the file 'plugins/ViaBackwards-4.2.1.jar'.", $analysis[1][1]->getMessage()); From 52a2abd20562c76fedc4bc70ad6e41410928f4bd Mon Sep 17 00:00:00 2001 From: Julian Date: Fri, 20 May 2022 19:16:49 +0200 Subject: [PATCH 09/12] better comparison --- .../Bukkit/PluginDependenciesProblem.php | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php b/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php index 65e609a2..9a170f09 100644 --- a/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php @@ -44,6 +44,15 @@ public function getPluginName() return $this->pluginName; } + /** + * get a list of missing dependencies + * @return string[] + */ + public function getDependencyPlugins(): array + { + return $this->dependencyPluginNames; + } + /** * @return string */ @@ -105,8 +114,20 @@ public function setMatches(array $matches, $patternKey): void */ public function isEqual($insight): bool { - return $this->getPluginName() === $insight->getPluginName() - && $this->getPluginPath() === $insight->getPluginPath() - && $this->dependencyPluginNames == $insight->dependencyPluginNames; + if ($this->getPluginName() !== $insight->getPluginName() || $this->getPluginPath() !== $insight->getPluginPath()) { + return false; + } + + $dependencies = $insight->getDependencyPluginNames(); + foreach ($this->getDependencyPlugins() as $plugin) { + if (!in_array($plugin, $dependencies)) { + return false; + } + $dependencies = array_filter($dependencies, function ($value) use ($plugin) { + return $value !== $plugin; + }); + } + + return sizeof($dependencies) === 0; } } \ No newline at end of file From f1c88ed81bd787e34de389a836da96b2ba8ec352 Mon Sep 17 00:00:00 2001 From: Julian Date: Mon, 30 May 2022 15:46:19 +0200 Subject: [PATCH 10/12] suggestions --- .../Problem/Bukkit/PluginDependenciesProblem.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php b/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php index 9a170f09..4c7d9e72 100644 --- a/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php @@ -118,16 +118,10 @@ public function isEqual($insight): bool return false; } - $dependencies = $insight->getDependencyPluginNames(); - foreach ($this->getDependencyPlugins() as $plugin) { - if (!in_array($plugin, $dependencies)) { - return false; - } - $dependencies = array_filter($dependencies, function ($value) use ($plugin) { - return $value !== $plugin; - }); - } - - return sizeof($dependencies) === 0; + $dependencies = $insight->getDependencyPlugins(); + sort($dependencies); + $ownDependencies = $this->getDependencyPlugins(); + sort($ownDependencies); + return $dependencies === $ownDependencies; } } \ No newline at end of file From 252ac5e18837e2587da03ab187ffd678dc74019d Mon Sep 17 00:00:00 2001 From: Julian Date: Mon, 30 May 2022 15:49:19 +0200 Subject: [PATCH 11/12] test case with identical errors --- ...per-plugin-dependency-1-18-2-duplicate.log | 42 + ...PaperPluginDependency1182DuplicateTest.php | 792 ++++++++++++++++++ 2 files changed, 834 insertions(+) create mode 100644 test/data/bukkit/paper-plugin-dependency-1-18-2-duplicate.log create mode 100644 test/tests/auto/Bukkit/PaperPluginDependency1182DuplicateTest.php diff --git a/test/data/bukkit/paper-plugin-dependency-1-18-2-duplicate.log b/test/data/bukkit/paper-plugin-dependency-1-18-2-duplicate.log new file mode 100644 index 00000000..aabc0443 --- /dev/null +++ b/test/data/bukkit/paper-plugin-dependency-1-18-2-duplicate.log @@ -0,0 +1,42 @@ +[08:29:59] [ServerMain/INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', servicesHost='https://api.minecraftservices.com', name='PROD' +[08:30:08] [Worker-Main-1/INFO]: Loaded 7 recipes +[08:30:12] [Server thread/INFO]: Starting minecraft server version 1.18.2 +[08:30:12] [Server thread/INFO]: Loading properties +[08:30:12] [Server thread/INFO]: This server is running Paper version git-Paper-333 (MC: 1.18.2) (Implementing API version 1.18.2-R0.1-SNAPSHOT) (Git: 9fd870d) +[08:30:12] [Server thread/INFO]: Server Ping Player Sample Count: 12 +[08:30:12] [Server thread/INFO]: Using 4 threads for Netty based IO +[08:30:13] [Server thread/INFO]: Default game type: SURVIVAL +[08:30:13] [Server thread/INFO]: Generating keypair +[08:30:13] [Server thread/INFO]: Starting Minecraft server on *:32699 +[08:30:13] [Server thread/INFO]: Using epoll channel type +[08:30:13] [Server thread/INFO]: Paper: Using libdeflate (Linux x86_64) compression from Velocity. +[08:30:13] [Server thread/INFO]: Paper: Using OpenSSL 1.1.x (Linux x86_64) cipher from Velocity. +[08:30:13] [Server thread/ERROR]: Could not load 'plugins/ViaBackwards-4.2.1.jar' in folder 'plugins' +org.bukkit.plugin.UnknownDependencyException: Unknown/missing dependency plugins: [ViaVersion]. Please download and install these plugins to run 'ViaBackwards'. + at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:291) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?] + at org.bukkit.craftbukkit.v1_18_R2.CraftServer.loadPlugins(CraftServer.java:418) ~[paper-1.18.2.jar:git-Paper-333] + at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:288) ~[paper-1.18.2.jar:git-Paper-333] + at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1163) ~[paper-1.18.2.jar:git-Paper-333] + at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.18.2.jar:git-Paper-333] + at java.lang.Thread.run(Thread.java:833) ~[?:?] +[08:30:13] [Server thread/ERROR]: Could not load 'plugins/ViaBackwards-4.2.1.jar' in folder 'plugins' +org.bukkit.plugin.UnknownDependencyException: Unknown/missing dependency plugins: [ViaVersion]. Please download and install these plugins to run 'ViaBackwards'. + at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:291) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?] + at org.bukkit.craftbukkit.v1_18_R2.CraftServer.loadPlugins(CraftServer.java:418) ~[paper-1.18.2.jar:git-Paper-333] + at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:288) ~[paper-1.18.2.jar:git-Paper-333] + at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1163) ~[paper-1.18.2.jar:git-Paper-333] + at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.18.2.jar:git-Paper-333] + at java.lang.Thread.run(Thread.java:833) ~[?:?] +[08:30:13] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it +[08:30:13] [Server thread/INFO]: Preparing level "world" +[08:30:24] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld +[08:30:26] [Worker-Main-1/INFO]: Preparing spawn area: 0% +[08:30:26] [Worker-Main-1/INFO]: Preparing spawn area: 99% +[08:30:36] [Server thread/INFO]: Time elapsed: 937 ms +[08:30:36] [Server thread/INFO]: Starting GS4 status listener +[08:30:36] [Query Listener #1/INFO]: Query running on 0.0.0.0:9898 +[08:30:36] [Server thread/INFO]: Thread Query Listener started +[08:30:36] [Server thread/INFO]: JMX monitoring enabled +[08:30:36] [Server thread/INFO]: Running delayed init tasks +[08:30:36] [Server thread/INFO]: Done (24.549s)! For help, type "help" +[08:30:36] [Server thread/INFO]: Timings Reset \ No newline at end of file diff --git a/test/tests/auto/Bukkit/PaperPluginDependency1182DuplicateTest.php b/test/tests/auto/Bukkit/PaperPluginDependency1182DuplicateTest.php new file mode 100644 index 00000000..4acbef28 --- /dev/null +++ b/test/tests/auto/Bukkit/PaperPluginDependency1182DuplicateTest.php @@ -0,0 +1,792 @@ +setLogFile($logFile); + $log = $detective->detect(); + $log->parse(); + $analysis = $log->analyse(); + + $expectedLog = 'Aternos\Codex\Minecraft\Log\PaperLog Object +( + [entries:protected] => Array + ( + [0] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:29:59] [ServerMain/INFO]: Environment: authHost=\'https://authserver.mojang.com\', accountsHost=\'https://api.mojang.com\', sessionHost=\'https://sessionserver.mojang.com\', servicesHost=\'https://api.minecraftservices.com\', name=\'PROD\' + [number:protected] => 1 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:29:59] [ServerMain/INFO]: + ) + + [1] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:08] [Worker-Main-1/INFO]: Loaded 7 recipes + [number:protected] => 2 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:08] [Worker-Main-1/INFO]: + ) + + [2] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:12] [Server thread/INFO]: Starting minecraft server version 1.18.2 + [number:protected] => 3 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:12] [Server thread/INFO]: + ) + + [3] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:12] [Server thread/INFO]: Loading properties + [number:protected] => 4 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:12] [Server thread/INFO]: + ) + + [4] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:12] [Server thread/INFO]: This server is running Paper version git-Paper-333 (MC: 1.18.2) (Implementing API version 1.18.2-R0.1-SNAPSHOT) (Git: 9fd870d) + [number:protected] => 5 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:12] [Server thread/INFO]: + ) + + [5] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:12] [Server thread/INFO]: Server Ping Player Sample Count: 12 + [number:protected] => 6 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:12] [Server thread/INFO]: + ) + + [6] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:12] [Server thread/INFO]: Using 4 threads for Netty based IO + [number:protected] => 7 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:12] [Server thread/INFO]: + ) + + [7] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:13] [Server thread/INFO]: Default game type: SURVIVAL + [number:protected] => 8 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:13] [Server thread/INFO]: + ) + + [8] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:13] [Server thread/INFO]: Generating keypair + [number:protected] => 9 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:13] [Server thread/INFO]: + ) + + [9] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:13] [Server thread/INFO]: Starting Minecraft server on *:32699 + [number:protected] => 10 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:13] [Server thread/INFO]: + ) + + [10] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:13] [Server thread/INFO]: Using epoll channel type + [number:protected] => 11 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:13] [Server thread/INFO]: + ) + + [11] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:13] [Server thread/INFO]: Paper: Using libdeflate (Linux x86_64) compression from Velocity. + [number:protected] => 12 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:13] [Server thread/INFO]: + ) + + [12] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:13] [Server thread/INFO]: Paper: Using OpenSSL 1.1.x (Linux x86_64) cipher from Velocity. + [number:protected] => 13 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:13] [Server thread/INFO]: + ) + + [13] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:13] [Server thread/ERROR]: Could not load \'plugins/ViaBackwards-4.2.1.jar\' in folder \'plugins\' + [number:protected] => 14 + ) + + [1] => Aternos\Codex\Log\Line Object + ( + [text:protected] => org.bukkit.plugin.UnknownDependencyException: Unknown/missing dependency plugins: [ViaVersion]. Please download and install these plugins to run \'ViaBackwards\'. + [number:protected] => 15 + ) + + [2] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:291) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?] + [number:protected] => 16 + ) + + [3] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at org.bukkit.craftbukkit.v1_18_R2.CraftServer.loadPlugins(CraftServer.java:418) ~[paper-1.18.2.jar:git-Paper-333] + [number:protected] => 17 + ) + + [4] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:288) ~[paper-1.18.2.jar:git-Paper-333] + [number:protected] => 18 + ) + + [5] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1163) ~[paper-1.18.2.jar:git-Paper-333] + [number:protected] => 19 + ) + + [6] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.18.2.jar:git-Paper-333] + [number:protected] => 20 + ) + + [7] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at java.lang.Thread.run(Thread.java:833) ~[?:?] + [number:protected] => 21 + ) + + ) + + [level:protected] => ERROR + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:13] [Server thread/ERROR]: + ) + + [14] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:13] [Server thread/ERROR]: Could not load \'plugins/ViaBackwards-4.2.1.jar\' in folder \'plugins\' + [number:protected] => 22 + ) + + [1] => Aternos\Codex\Log\Line Object + ( + [text:protected] => org.bukkit.plugin.UnknownDependencyException: Unknown/missing dependency plugins: [ViaVersion]. Please download and install these plugins to run \'ViaBackwards\'. + [number:protected] => 23 + ) + + [2] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:291) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?] + [number:protected] => 24 + ) + + [3] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at org.bukkit.craftbukkit.v1_18_R2.CraftServer.loadPlugins(CraftServer.java:418) ~[paper-1.18.2.jar:git-Paper-333] + [number:protected] => 25 + ) + + [4] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:288) ~[paper-1.18.2.jar:git-Paper-333] + [number:protected] => 26 + ) + + [5] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1163) ~[paper-1.18.2.jar:git-Paper-333] + [number:protected] => 27 + ) + + [6] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.18.2.jar:git-Paper-333] + [number:protected] => 28 + ) + + [7] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at java.lang.Thread.run(Thread.java:833) ~[?:?] + [number:protected] => 29 + ) + + ) + + [level:protected] => ERROR + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:13] [Server thread/ERROR]: + ) + + [15] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:13] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it + [number:protected] => 30 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:13] [Server thread/INFO]: + ) + + [16] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:13] [Server thread/INFO]: Preparing level "world" + [number:protected] => 31 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:13] [Server thread/INFO]: + ) + + [17] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:24] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld + [number:protected] => 32 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:24] [Server thread/INFO]: + ) + + [18] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:26] [Worker-Main-1/INFO]: Preparing spawn area: 0% + [number:protected] => 33 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:26] [Worker-Main-1/INFO]: + ) + + [19] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:26] [Worker-Main-1/INFO]: Preparing spawn area: 99% + [number:protected] => 34 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:26] [Worker-Main-1/INFO]: + ) + + [20] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:36] [Server thread/INFO]: Time elapsed: 937 ms + [number:protected] => 35 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:36] [Server thread/INFO]: + ) + + [21] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:36] [Server thread/INFO]: Starting GS4 status listener + [number:protected] => 36 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:36] [Server thread/INFO]: + ) + + [22] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:36] [Query Listener #1/INFO]: Query running on 0.0.0.0:9898 + [number:protected] => 37 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:36] [Query Listener #1/INFO]: + ) + + [23] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:36] [Server thread/INFO]: Thread Query Listener started + [number:protected] => 38 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:36] [Server thread/INFO]: + ) + + [24] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:36] [Server thread/INFO]: JMX monitoring enabled + [number:protected] => 39 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:36] [Server thread/INFO]: + ) + + [25] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:36] [Server thread/INFO]: Running delayed init tasks + [number:protected] => 40 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:36] [Server thread/INFO]: + ) + + [26] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:36] [Server thread/INFO]: Done (24.549s)! For help, type "help" + [number:protected] => 41 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:36] [Server thread/INFO]: + ) + + [27] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:36] [Server thread/INFO]: Timings Reset + [number:protected] => 42 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:36] [Server thread/INFO]: + ) + + ) + + [iterator:protected] => 28 + [logFile:protected] => Aternos\Codex\Log\File\PathLogFile Object + ( + [content:protected] => [08:29:59] [ServerMain/INFO]: Environment: authHost=\'https://authserver.mojang.com\', accountsHost=\'https://api.mojang.com\', sessionHost=\'https://sessionserver.mojang.com\', servicesHost=\'https://api.minecraftservices.com\', name=\'PROD\' +[08:30:08] [Worker-Main-1/INFO]: Loaded 7 recipes +[08:30:12] [Server thread/INFO]: Starting minecraft server version 1.18.2 +[08:30:12] [Server thread/INFO]: Loading properties +[08:30:12] [Server thread/INFO]: This server is running Paper version git-Paper-333 (MC: 1.18.2) (Implementing API version 1.18.2-R0.1-SNAPSHOT) (Git: 9fd870d) +[08:30:12] [Server thread/INFO]: Server Ping Player Sample Count: 12 +[08:30:12] [Server thread/INFO]: Using 4 threads for Netty based IO +[08:30:13] [Server thread/INFO]: Default game type: SURVIVAL +[08:30:13] [Server thread/INFO]: Generating keypair +[08:30:13] [Server thread/INFO]: Starting Minecraft server on *:32699 +[08:30:13] [Server thread/INFO]: Using epoll channel type +[08:30:13] [Server thread/INFO]: Paper: Using libdeflate (Linux x86_64) compression from Velocity. +[08:30:13] [Server thread/INFO]: Paper: Using OpenSSL 1.1.x (Linux x86_64) cipher from Velocity. +[08:30:13] [Server thread/ERROR]: Could not load \'plugins/ViaBackwards-4.2.1.jar\' in folder \'plugins\' +org.bukkit.plugin.UnknownDependencyException: Unknown/missing dependency plugins: [ViaVersion]. Please download and install these plugins to run \'ViaBackwards\'. + at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:291) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?] + at org.bukkit.craftbukkit.v1_18_R2.CraftServer.loadPlugins(CraftServer.java:418) ~[paper-1.18.2.jar:git-Paper-333] + at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:288) ~[paper-1.18.2.jar:git-Paper-333] + at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1163) ~[paper-1.18.2.jar:git-Paper-333] + at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.18.2.jar:git-Paper-333] + at java.lang.Thread.run(Thread.java:833) ~[?:?] +[08:30:13] [Server thread/ERROR]: Could not load \'plugins/ViaBackwards-4.2.1.jar\' in folder \'plugins\' +org.bukkit.plugin.UnknownDependencyException: Unknown/missing dependency plugins: [ViaVersion]. Please download and install these plugins to run \'ViaBackwards\'. + at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:291) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?] + at org.bukkit.craftbukkit.v1_18_R2.CraftServer.loadPlugins(CraftServer.java:418) ~[paper-1.18.2.jar:git-Paper-333] + at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:288) ~[paper-1.18.2.jar:git-Paper-333] + at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1163) ~[paper-1.18.2.jar:git-Paper-333] + at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.18.2.jar:git-Paper-333] + at java.lang.Thread.run(Thread.java:833) ~[?:?] +[08:30:13] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it +[08:30:13] [Server thread/INFO]: Preparing level "world" +[08:30:24] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld +[08:30:26] [Worker-Main-1/INFO]: Preparing spawn area: 0% +[08:30:26] [Worker-Main-1/INFO]: Preparing spawn area: 99% +[08:30:36] [Server thread/INFO]: Time elapsed: 937 ms +[08:30:36] [Server thread/INFO]: Starting GS4 status listener +[08:30:36] [Query Listener #1/INFO]: Query running on 0.0.0.0:9898 +[08:30:36] [Server thread/INFO]: Thread Query Listener started +[08:30:36] [Server thread/INFO]: JMX monitoring enabled +[08:30:36] [Server thread/INFO]: Running delayed init tasks +[08:30:36] [Server thread/INFO]: Done (24.549s)! For help, type "help" +[08:30:36] [Server thread/INFO]: Timings Reset + ) + +) +'; + + $expectedAnalysis = 'Aternos\Codex\Analysis\Analysis Object +( + [insights:protected] => Array + ( + [0] => Aternos\Codex\Minecraft\Analysis\Information\Vanilla\VanillaVersionInformation Object + ( + [entry:protected] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:12] [Server thread/INFO]: Starting minecraft server version 1.18.2 + [number:protected] => 3 + ) + + ) + + [level:protected] => INFO + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:12] [Server thread/INFO]: + ) + + [counter:protected] => 1 + [label:protected] => Minecraft version + [value:protected] => 1.18.2 + ) + + [1] => Aternos\Codex\Minecraft\Analysis\Problem\Bukkit\PluginDependenciesProblem Object + ( + [entry:protected] => Aternos\Codex\Minecraft\Log\Entry Object + ( + [lines:protected] => Array + ( + [0] => Aternos\Codex\Log\Line Object + ( + [text:protected] => [08:30:13] [Server thread/ERROR]: Could not load \'plugins/ViaBackwards-4.2.1.jar\' in folder \'plugins\' + [number:protected] => 14 + ) + + [1] => Aternos\Codex\Log\Line Object + ( + [text:protected] => org.bukkit.plugin.UnknownDependencyException: Unknown/missing dependency plugins: [ViaVersion]. Please download and install these plugins to run \'ViaBackwards\'. + [number:protected] => 15 + ) + + [2] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:291) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?] + [number:protected] => 16 + ) + + [3] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at org.bukkit.craftbukkit.v1_18_R2.CraftServer.loadPlugins(CraftServer.java:418) ~[paper-1.18.2.jar:git-Paper-333] + [number:protected] => 17 + ) + + [4] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:288) ~[paper-1.18.2.jar:git-Paper-333] + [number:protected] => 18 + ) + + [5] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1163) ~[paper-1.18.2.jar:git-Paper-333] + [number:protected] => 19 + ) + + [6] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.18.2.jar:git-Paper-333] + [number:protected] => 20 + ) + + [7] => Aternos\Codex\Log\Line Object + ( + [text:protected] => at java.lang.Thread.run(Thread.java:833) ~[?:?] + [number:protected] => 21 + ) + + ) + + [level:protected] => ERROR + [time:protected] => + [iterator:protected] => 0 + [prefix:protected] => [08:30:13] [Server thread/ERROR]: + ) + + [counter:protected] => 2 + [solutions:protected] => Array + ( + [0] => Aternos\Codex\Minecraft\Analysis\Solution\Bukkit\PluginInstallSolution Object + ( + [pluginName:protected] => ViaVersion + ) + + [1] => Aternos\Codex\Minecraft\Analysis\Solution\File\FileDeleteSolution Object + ( + [path:protected] => plugins/ViaBackwards-4.2.1.jar + [relativePath:protected] => 1 + ) + + ) + + [iterator:protected] => 0 + [pluginPath:protected] => plugins/ViaBackwards-4.2.1.jar + [pluginName:protected] => ViaBackwards-4.2.1 + [dependencyPluginNames:protected] => Array + ( + [0] => ViaVersion + ) + + ) + + ) + + [iterator:protected] => 1 +) +'; + + $this->assertEquals($expectedLog, print_r($log, true)); + $this->assertEquals($expectedAnalysis, print_r($analysis, true)); + + $this->assertEquals("Minecraft version: 1.18.2", $analysis[0]->getMessage()); + + $this->assertEquals("The plugin 'ViaBackwards-4.2.1' is missing the required plugins 'ViaVersion'.", $analysis[1]->getMessage()); + $this->assertEquals("Install the plugin 'ViaVersion'.", $analysis[1][0]->getMessage()); + $this->assertEquals("Delete the file 'plugins/ViaBackwards-4.2.1.jar'.", $analysis[1][1]->getMessage()); + + } +} \ No newline at end of file From c5ce7566a400cd9b187ba36ae47e95a06f91aa22 Mon Sep 17 00:00:00 2001 From: Julian Date: Tue, 31 May 2022 14:24:22 +0200 Subject: [PATCH 12/12] use different language variable for a single dependency --- src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php | 7 +++++++ .../auto/Bukkit/PaperPluginDependency1182DuplicateTest.php | 2 +- test/tests/auto/Bukkit/PaperPluginDependency1182Test.php | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php b/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php index 4c7d9e72..8c250d10 100644 --- a/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php +++ b/src/Analysis/Problem/Bukkit/PluginDependenciesProblem.php @@ -72,6 +72,13 @@ public function getDependencyPluginNames(): string */ public function getMessage(): string { + if (count($this->getDependencyPlugins()) === 1) { + return Translator::getInstance()->getTranslation("plugin-dependency-problem", [ + "plugin-name" => $this->getPluginName(), + "dependency-plugin-name" => $this->getDependencyPlugins()[0] + ]); + } + return Translator::getInstance()->getTranslation("plugin-dependencies-problem", [ "plugin-name" => $this->getPluginName(), "dependency-plugin-names" => $this->getDependencyPluginNames() diff --git a/test/tests/auto/Bukkit/PaperPluginDependency1182DuplicateTest.php b/test/tests/auto/Bukkit/PaperPluginDependency1182DuplicateTest.php index 4acbef28..c14e95a2 100644 --- a/test/tests/auto/Bukkit/PaperPluginDependency1182DuplicateTest.php +++ b/test/tests/auto/Bukkit/PaperPluginDependency1182DuplicateTest.php @@ -784,7 +784,7 @@ public function testParseAndAnalyse(): void $this->assertEquals("Minecraft version: 1.18.2", $analysis[0]->getMessage()); - $this->assertEquals("The plugin 'ViaBackwards-4.2.1' is missing the required plugins 'ViaVersion'.", $analysis[1]->getMessage()); + $this->assertEquals("The plugin 'ViaBackwards-4.2.1' is missing the required plugin 'ViaVersion'.", $analysis[1]->getMessage()); $this->assertEquals("Install the plugin 'ViaVersion'.", $analysis[1][0]->getMessage()); $this->assertEquals("Delete the file 'plugins/ViaBackwards-4.2.1.jar'.", $analysis[1][1]->getMessage()); diff --git a/test/tests/auto/Bukkit/PaperPluginDependency1182Test.php b/test/tests/auto/Bukkit/PaperPluginDependency1182Test.php index cd10d398..7e6d1495 100644 --- a/test/tests/auto/Bukkit/PaperPluginDependency1182Test.php +++ b/test/tests/auto/Bukkit/PaperPluginDependency1182Test.php @@ -716,7 +716,7 @@ public function testParseAndAnalyse(): void $this->assertEquals("Minecraft version: 1.18.2", $analysis[0]->getMessage()); - $this->assertEquals("The plugin 'ViaBackwards-4.2.1' is missing the required plugins 'ViaVersion'.", $analysis[1]->getMessage()); + $this->assertEquals("The plugin 'ViaBackwards-4.2.1' is missing the required plugin 'ViaVersion'.", $analysis[1]->getMessage()); $this->assertEquals("Install the plugin 'ViaVersion'.", $analysis[1][0]->getMessage()); $this->assertEquals("Delete the file 'plugins/ViaBackwards-4.2.1.jar'.", $analysis[1][1]->getMessage());