From 93e5c80962d2d90bfce2fed9486feaa770e23be5 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 3 Mar 2020 12:32:57 +0000 Subject: [PATCH 1/2] MultiplayerSettingsPacket is bothways, close #3331 --- .../network/mcpe/protocol/MultiplayerSettingsPacket.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pocketmine/network/mcpe/protocol/MultiplayerSettingsPacket.php b/src/pocketmine/network/mcpe/protocol/MultiplayerSettingsPacket.php index b12afd01a0..c46918f885 100644 --- a/src/pocketmine/network/mcpe/protocol/MultiplayerSettingsPacket.php +++ b/src/pocketmine/network/mcpe/protocol/MultiplayerSettingsPacket.php @@ -27,7 +27,7 @@ namespace pocketmine\network\mcpe\protocol; use pocketmine\network\mcpe\NetworkSession; -class MultiplayerSettingsPacket extends DataPacket/* implements ServerboundPacket*/{ //TODO: this might be clientbound too, but unsure +class MultiplayerSettingsPacket extends DataPacket/* implements ClientboundPacket, ServerboundPacket*/{ public const NETWORK_ID = ProtocolInfo::MULTIPLAYER_SETTINGS_PACKET; public const ACTION_ENABLE_MULTIPLAYER = 0; From 15d81154e6b203a2163fdd509a7c858a20312b20 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Thu, 5 Mar 2020 19:53:01 +0000 Subject: [PATCH 2/2] PluginDescription: drop unenforceable type constraint on array keys the data that comes through here isn't validated, and there's also no guarantee that all the keys will be strings in spite of our best efforts even if it was validated, because PHP is fucking stupid and casts int-like string keys to int keys. --- src/pocketmine/plugin/PluginDescription.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pocketmine/plugin/PluginDescription.php b/src/pocketmine/plugin/PluginDescription.php index cd55c9ed4e..cc321cbf65 100644 --- a/src/pocketmine/plugin/PluginDescription.php +++ b/src/pocketmine/plugin/PluginDescription.php @@ -89,7 +89,6 @@ class PluginDescription{ /** * @param string|mixed[] $yamlString - * @phpstan-param string|array $yamlString */ public function __construct($yamlString){ $this->loadMap(!is_array($yamlString) ? yaml_parse($yamlString) : $yamlString); @@ -97,7 +96,6 @@ class PluginDescription{ /** * @param mixed[] $plugin - * @phpstan-param array $plugin * @throws PluginException */ private function loadMap(array $plugin) : void{