From 39207c79923feb93a37b387254df61a561d88c1b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Feb 2023 12:39:49 +0000 Subject: [PATCH 01/11] Bump phpstan/phpstan from 1.9.14 to 1.9.15 (#5557) Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.9.14 to 1.9.15. - [Release notes](https://github.com/phpstan/phpstan/releases) - [Changelog](https://github.com/phpstan/phpstan/blob/1.10.x/CHANGELOG.md) - [Commits](https://github.com/phpstan/phpstan/compare/1.9.14...1.9.15) --- updated-dependencies: - dependency-name: phpstan/phpstan dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index c4570bb09..712515cf7 100644 --- a/composer.json +++ b/composer.json @@ -54,7 +54,7 @@ "webmozart/path-util": "^2.3" }, "require-dev": { - "phpstan/phpstan": "1.9.14", + "phpstan/phpstan": "1.9.15", "phpstan/phpstan-phpunit": "^1.1.0", "phpstan/phpstan-strict-rules": "^1.2.0", "phpunit/phpunit": "^9.2" diff --git a/composer.lock b/composer.lock index 9ae4cab1d..0a3a8ebd7 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2c0f273b515174abfdcef4fc4ad3c262", + "content-hash": "140417e76259e8c3f520623c3de3f1e7", "packages": [ { "name": "adhocore/json-comment", @@ -1832,16 +1832,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.9.14", + "version": "1.9.15", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "e5fcc96289cf737304286a9b505fbed091f02e58" + "reference": "642f5d78e4bfb9d9bebed898740ca82b53264d9b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e5fcc96289cf737304286a9b505fbed091f02e58", - "reference": "e5fcc96289cf737304286a9b505fbed091f02e58", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/642f5d78e4bfb9d9bebed898740ca82b53264d9b", + "reference": "642f5d78e4bfb9d9bebed898740ca82b53264d9b", "shasum": "" }, "require": { @@ -1871,7 +1871,7 @@ ], "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.9.14" + "source": "https://github.com/phpstan/phpstan/tree/1.9.15" }, "funding": [ { @@ -1887,7 +1887,7 @@ "type": "tidelift" } ], - "time": "2023-01-19T10:47:09+00:00" + "time": "2023-02-07T07:49:27+00:00" }, { "name": "phpstan/phpstan-phpunit", From e47627f56577666d8f3aee1bb8a0ccf616b3a24b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Feb 2023 10:09:15 +0000 Subject: [PATCH 02/11] Bump build/php from `f51e954` to `fb297eb` (#5558) Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `f51e954` to `fb297eb`. - [Release notes](https://github.com/pmmp/php-build-scripts/releases) - [Commits](https://github.com/pmmp/php-build-scripts/compare/f51e954743d32aba515a91b2d8b7e6a65e4ac064...fb297eb511862ef3d4ca0aff5256a8caf5513cb4) --- updated-dependencies: - dependency-name: build/php dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- build/php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/php b/build/php index f51e95474..fb297eb51 160000 --- a/build/php +++ b/build/php @@ -1 +1 @@ -Subproject commit f51e954743d32aba515a91b2d8b7e6a65e4ac064 +Subproject commit fb297eb511862ef3d4ca0aff5256a8caf5513cb4 From 5d7b99daf4d438173cefd7c5f7da8d62b5aca153 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Feb 2023 10:55:09 +0000 Subject: [PATCH 03/11] Bump phpstan/phpstan from 1.9.15 to 1.9.16 (#5560) Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.9.15 to 1.9.16. - [Release notes](https://github.com/phpstan/phpstan/releases) - [Changelog](https://github.com/phpstan/phpstan/blob/1.10.x/CHANGELOG.md) - [Commits](https://github.com/phpstan/phpstan/compare/1.9.15...1.9.16) --- updated-dependencies: - dependency-name: phpstan/phpstan dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 712515cf7..03b37a014 100644 --- a/composer.json +++ b/composer.json @@ -54,7 +54,7 @@ "webmozart/path-util": "^2.3" }, "require-dev": { - "phpstan/phpstan": "1.9.15", + "phpstan/phpstan": "1.9.16", "phpstan/phpstan-phpunit": "^1.1.0", "phpstan/phpstan-strict-rules": "^1.2.0", "phpunit/phpunit": "^9.2" diff --git a/composer.lock b/composer.lock index 0a3a8ebd7..dc1ee168f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "140417e76259e8c3f520623c3de3f1e7", + "content-hash": "8b0866fdb437375a50307205a9e01643", "packages": [ { "name": "adhocore/json-comment", @@ -1832,16 +1832,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.9.15", + "version": "1.9.16", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "642f5d78e4bfb9d9bebed898740ca82b53264d9b" + "reference": "922e2689bb180575d0f57de0443c431a5a698e8f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/642f5d78e4bfb9d9bebed898740ca82b53264d9b", - "reference": "642f5d78e4bfb9d9bebed898740ca82b53264d9b", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/922e2689bb180575d0f57de0443c431a5a698e8f", + "reference": "922e2689bb180575d0f57de0443c431a5a698e8f", "shasum": "" }, "require": { @@ -1871,7 +1871,7 @@ ], "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.9.15" + "source": "https://github.com/phpstan/phpstan/tree/1.9.16" }, "funding": [ { @@ -1887,7 +1887,7 @@ "type": "tidelift" } ], - "time": "2023-02-07T07:49:27+00:00" + "time": "2023-02-07T10:42:21+00:00" }, { "name": "phpstan/phpstan-phpunit", From 3ba662f64fcfb9c9bd120d95b975505aeeba6438 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 8 Feb 2023 18:46:37 +0000 Subject: [PATCH 04/11] 1.19.60 --- composer.json | 4 +-- composer.lock | 26 +++++++++--------- src/entity/Human.php | 13 ++++----- src/network/mcpe/NetworkSession.php | 41 +++++++++++++++-------------- 4 files changed, 43 insertions(+), 41 deletions(-) diff --git a/composer.json b/composer.json index 03b37a014..26de28c15 100644 --- a/composer.json +++ b/composer.json @@ -34,8 +34,8 @@ "adhocore/json-comment": "^1.1", "fgrosse/phpasn1": "^2.3", "netresearch/jsonmapper": "^4.0", - "pocketmine/bedrock-data": "~1.13.0+bedrock-1.19.50", - "pocketmine/bedrock-protocol": "~18.1.0+bedrock-1.19.50", + "pocketmine/bedrock-data": "~1.14.0+bedrock-1.19.60", + "pocketmine/bedrock-protocol": "~19.0.0+bedrock-1.19.60", "pocketmine/binaryutils": "^0.2.1", "pocketmine/callback-validator": "^1.0.2", "pocketmine/classloader": "^0.2.0", diff --git a/composer.lock b/composer.lock index dc1ee168f..6ff40e421 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8b0866fdb437375a50307205a9e01643", + "content-hash": "f516e1546e5d16c31fef01d2a98c0da8", "packages": [ { "name": "adhocore/json-comment", @@ -250,16 +250,16 @@ }, { "name": "pocketmine/bedrock-data", - "version": "1.13.0+bedrock-1.19.50", + "version": "1.14.0+bedrock-1.19.60", "source": { "type": "git", "url": "https://github.com/pmmp/BedrockData.git", - "reference": "57337ddc9433a0e245a1ce48c51af05f0573d58d" + "reference": "7b06234ec6e1f4fb06ad4b2f177e606c25df9b46" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pmmp/BedrockData/zipball/57337ddc9433a0e245a1ce48c51af05f0573d58d", - "reference": "57337ddc9433a0e245a1ce48c51af05f0573d58d", + "url": "https://api.github.com/repos/pmmp/BedrockData/zipball/7b06234ec6e1f4fb06ad4b2f177e606c25df9b46", + "reference": "7b06234ec6e1f4fb06ad4b2f177e606c25df9b46", "shasum": "" }, "type": "library", @@ -270,22 +270,22 @@ "description": "Blobs of data generated from Minecraft: Bedrock Edition, used by PocketMine-MP", "support": { "issues": "https://github.com/pmmp/BedrockData/issues", - "source": "https://github.com/pmmp/BedrockData/tree/bedrock-1.19.50" + "source": "https://github.com/pmmp/BedrockData/tree/bedrock-1.19.60" }, - "time": "2022-11-30T16:19:59+00:00" + "time": "2023-02-08T18:32:01+00:00" }, { "name": "pocketmine/bedrock-protocol", - "version": "18.1.0+bedrock-1.19.50", + "version": "19.0.0+bedrock-1.19.60", "source": { "type": "git", "url": "https://github.com/pmmp/BedrockProtocol.git", - "reference": "c34f22847a1cc362a3f1c45698576d30d1e8392f" + "reference": "3c8cf08d09b8b3fafc209d184e66e50d2e34c06c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/c34f22847a1cc362a3f1c45698576d30d1e8392f", - "reference": "c34f22847a1cc362a3f1c45698576d30d1e8392f", + "url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/3c8cf08d09b8b3fafc209d184e66e50d2e34c06c", + "reference": "3c8cf08d09b8b3fafc209d184e66e50d2e34c06c", "shasum": "" }, "require": { @@ -317,9 +317,9 @@ "description": "An implementation of the Minecraft: Bedrock Edition protocol in PHP", "support": { "issues": "https://github.com/pmmp/BedrockProtocol/issues", - "source": "https://github.com/pmmp/BedrockProtocol/tree/18.1.0+bedrock-1.19.50" + "source": "https://github.com/pmmp/BedrockProtocol/tree/19.0.0+bedrock-1.19.60" }, - "time": "2023-01-20T12:35:30+00:00" + "time": "2023-02-08T18:38:02+00:00" }, { "name": "pocketmine/binaryutils", diff --git a/src/entity/Human.php b/src/entity/Human.php index 58911a07c..50034e5c3 100644 --- a/src/entity/Human.php +++ b/src/entity/Human.php @@ -50,6 +50,7 @@ use pocketmine\network\mcpe\convert\TypeConverter; use pocketmine\network\mcpe\protocol\AddPlayerPacket; use pocketmine\network\mcpe\protocol\PlayerListPacket; use pocketmine\network\mcpe\protocol\PlayerSkinPacket; +use pocketmine\network\mcpe\protocol\types\AbilitiesData; use pocketmine\network\mcpe\protocol\types\command\CommandPermissions; use pocketmine\network\mcpe\protocol\types\DeviceOS; use pocketmine\network\mcpe\protocol\types\entity\EntityIds; @@ -60,7 +61,7 @@ use pocketmine\network\mcpe\protocol\types\GameMode; use pocketmine\network\mcpe\protocol\types\inventory\ItemStackWrapper; use pocketmine\network\mcpe\protocol\types\PlayerListEntry; use pocketmine\network\mcpe\protocol\types\PlayerPermissions; -use pocketmine\network\mcpe\protocol\types\UpdateAbilitiesPacketLayer; +use pocketmine\network\mcpe\protocol\types\AbilitiesLayer; use pocketmine\network\mcpe\protocol\UpdateAbilitiesPacket; use pocketmine\player\Player; use pocketmine\utils\Limits; @@ -507,14 +508,14 @@ class Human extends Living implements ProjectileSource, InventoryHolder{ GameMode::SURVIVAL, $this->getAllNetworkData(), new PropertySyncData([], []), - UpdateAbilitiesPacket::create(CommandPermissions::NORMAL, PlayerPermissions::VISITOR, $this->getId() /* TODO: this should be unique ID */, [ - new UpdateAbilitiesPacketLayer( - UpdateAbilitiesPacketLayer::LAYER_BASE, - array_fill(0, UpdateAbilitiesPacketLayer::NUMBER_OF_ABILITIES, false), + UpdateAbilitiesPacket::create(new AbilitiesData(CommandPermissions::NORMAL, PlayerPermissions::VISITOR, $this->getId() /* TODO: this should be unique ID */, [ + new AbilitiesLayer( + AbilitiesLayer::LAYER_BASE, + array_fill(0, AbilitiesLayer::NUMBER_OF_ABILITIES, false), 0.0, 0.0 ) - ]), + ])), [], //TODO: entity links "", //device ID (we intentionally don't send this - secvuln) DeviceOS::UNKNOWN //we intentionally don't send this (secvuln) diff --git a/src/network/mcpe/NetworkSession.php b/src/network/mcpe/NetworkSession.php index 49f87793f..4e7f05127 100644 --- a/src/network/mcpe/NetworkSession.php +++ b/src/network/mcpe/NetworkSession.php @@ -90,6 +90,7 @@ use pocketmine\network\mcpe\protocol\TakeItemActorPacket; use pocketmine\network\mcpe\protocol\TextPacket; use pocketmine\network\mcpe\protocol\ToastRequestPacket; use pocketmine\network\mcpe\protocol\TransferPacket; +use pocketmine\network\mcpe\protocol\types\AbilitiesData; use pocketmine\network\mcpe\protocol\types\BlockPosition; use pocketmine\network\mcpe\protocol\types\command\CommandData; use pocketmine\network\mcpe\protocol\types\command\CommandEnum; @@ -103,7 +104,7 @@ use pocketmine\network\mcpe\protocol\types\inventory\ContainerIds; use pocketmine\network\mcpe\protocol\types\inventory\ItemStackWrapper; use pocketmine\network\mcpe\protocol\types\PlayerListEntry; use pocketmine\network\mcpe\protocol\types\PlayerPermissions; -use pocketmine\network\mcpe\protocol\types\UpdateAbilitiesPacketLayer; +use pocketmine\network\mcpe\protocol\types\AbilitiesLayer; use pocketmine\network\mcpe\protocol\UpdateAbilitiesPacket; use pocketmine\network\mcpe\protocol\UpdateAdventureSettingsPacket; use pocketmine\network\mcpe\protocol\UpdateAttributesPacket; @@ -848,33 +849,33 @@ class NetworkSession{ //ALL of these need to be set for the base layer, otherwise the client will cry $boolAbilities = [ - UpdateAbilitiesPacketLayer::ABILITY_ALLOW_FLIGHT => $for->getAllowFlight(), - UpdateAbilitiesPacketLayer::ABILITY_FLYING => $for->isFlying(), - UpdateAbilitiesPacketLayer::ABILITY_NO_CLIP => !$for->hasBlockCollision(), - UpdateAbilitiesPacketLayer::ABILITY_OPERATOR => $isOp, - UpdateAbilitiesPacketLayer::ABILITY_TELEPORT => $for->hasPermission(DefaultPermissionNames::COMMAND_TELEPORT_SELF), - UpdateAbilitiesPacketLayer::ABILITY_INVULNERABLE => $for->isCreative(), - UpdateAbilitiesPacketLayer::ABILITY_MUTED => false, - UpdateAbilitiesPacketLayer::ABILITY_WORLD_BUILDER => false, - UpdateAbilitiesPacketLayer::ABILITY_INFINITE_RESOURCES => !$for->hasFiniteResources(), - UpdateAbilitiesPacketLayer::ABILITY_LIGHTNING => false, - UpdateAbilitiesPacketLayer::ABILITY_BUILD => !$for->isSpectator(), - UpdateAbilitiesPacketLayer::ABILITY_MINE => !$for->isSpectator(), - UpdateAbilitiesPacketLayer::ABILITY_DOORS_AND_SWITCHES => !$for->isSpectator(), - UpdateAbilitiesPacketLayer::ABILITY_OPEN_CONTAINERS => !$for->isSpectator(), - UpdateAbilitiesPacketLayer::ABILITY_ATTACK_PLAYERS => !$for->isSpectator(), - UpdateAbilitiesPacketLayer::ABILITY_ATTACK_MOBS => !$for->isSpectator(), + AbilitiesLayer::ABILITY_ALLOW_FLIGHT => $for->getAllowFlight(), + AbilitiesLayer::ABILITY_FLYING => $for->isFlying(), + AbilitiesLayer::ABILITY_NO_CLIP => !$for->hasBlockCollision(), + AbilitiesLayer::ABILITY_OPERATOR => $isOp, + AbilitiesLayer::ABILITY_TELEPORT => $for->hasPermission(DefaultPermissionNames::COMMAND_TELEPORT_SELF), + AbilitiesLayer::ABILITY_INVULNERABLE => $for->isCreative(), + AbilitiesLayer::ABILITY_MUTED => false, + AbilitiesLayer::ABILITY_WORLD_BUILDER => false, + AbilitiesLayer::ABILITY_INFINITE_RESOURCES => !$for->hasFiniteResources(), + AbilitiesLayer::ABILITY_LIGHTNING => false, + AbilitiesLayer::ABILITY_BUILD => !$for->isSpectator(), + AbilitiesLayer::ABILITY_MINE => !$for->isSpectator(), + AbilitiesLayer::ABILITY_DOORS_AND_SWITCHES => !$for->isSpectator(), + AbilitiesLayer::ABILITY_OPEN_CONTAINERS => !$for->isSpectator(), + AbilitiesLayer::ABILITY_ATTACK_PLAYERS => !$for->isSpectator(), + AbilitiesLayer::ABILITY_ATTACK_MOBS => !$for->isSpectator(), ]; - $this->sendDataPacket(UpdateAbilitiesPacket::create( + $this->sendDataPacket(UpdateAbilitiesPacket::create(new AbilitiesData( $isOp ? CommandPermissions::OPERATOR : CommandPermissions::NORMAL, $isOp ? PlayerPermissions::OPERATOR : PlayerPermissions::MEMBER, $for->getId(), [ //TODO: dynamic flying speed! FINALLY!!!!!!!!!!!!!!!!! - new UpdateAbilitiesPacketLayer(UpdateAbilitiesPacketLayer::LAYER_BASE, $boolAbilities, 0.05, 0.1), + new AbilitiesLayer(AbilitiesLayer::LAYER_BASE, $boolAbilities, 0.05, 0.1), ] - )); + ))); } public function syncAdventureSettings() : void{ From 7bbc04e6deaf5dd31d2d3f4f17e18517f1fcc440 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 8 Feb 2023 18:55:38 +0000 Subject: [PATCH 05/11] Silence PlayerSkinPacket debug messages during spawn response stage the client sends its skin here in 1.19.60 for some reason, which makes no sense - I can only assume it's a bug --- src/network/mcpe/handler/SpawnResponsePacketHandler.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/network/mcpe/handler/SpawnResponsePacketHandler.php b/src/network/mcpe/handler/SpawnResponsePacketHandler.php index 554322af5..2ebb9d2b6 100644 --- a/src/network/mcpe/handler/SpawnResponsePacketHandler.php +++ b/src/network/mcpe/handler/SpawnResponsePacketHandler.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace pocketmine\network\mcpe\handler; use pocketmine\network\mcpe\protocol\PlayerAuthInputPacket; +use pocketmine\network\mcpe\protocol\PlayerSkinPacket; use pocketmine\network\mcpe\protocol\SetLocalPlayerAsInitializedPacket; final class SpawnResponsePacketHandler extends PacketHandler{ @@ -37,6 +38,13 @@ final class SpawnResponsePacketHandler extends PacketHandler{ return true; } + public function handlePlayerSkin(PlayerSkinPacket $packet) : bool{ + //TODO: REMOVE THIS + //As of 1.19.60, we receive this packet during pre-spawn for no obvious reason. The skin is still sent in the + //login packet, so we can ignore this one. If unhandled, this packet makes a huge debug spam in the log. + return true; + } + public function handlePlayerAuthInput(PlayerAuthInputPacket $packet) : bool{ //the client will send this every tick once we start sending chunks, but we don't handle it in this stage //this is very spammy so we filter it out From 5a4550a4fc19cf08715833f781f496b954d43162 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 8 Feb 2023 18:55:49 +0000 Subject: [PATCH 06/11] CS --- src/entity/Human.php | 2 +- src/network/mcpe/NetworkSession.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/entity/Human.php b/src/entity/Human.php index 50034e5c3..5ede1abf8 100644 --- a/src/entity/Human.php +++ b/src/entity/Human.php @@ -51,6 +51,7 @@ use pocketmine\network\mcpe\protocol\AddPlayerPacket; use pocketmine\network\mcpe\protocol\PlayerListPacket; use pocketmine\network\mcpe\protocol\PlayerSkinPacket; use pocketmine\network\mcpe\protocol\types\AbilitiesData; +use pocketmine\network\mcpe\protocol\types\AbilitiesLayer; use pocketmine\network\mcpe\protocol\types\command\CommandPermissions; use pocketmine\network\mcpe\protocol\types\DeviceOS; use pocketmine\network\mcpe\protocol\types\entity\EntityIds; @@ -61,7 +62,6 @@ use pocketmine\network\mcpe\protocol\types\GameMode; use pocketmine\network\mcpe\protocol\types\inventory\ItemStackWrapper; use pocketmine\network\mcpe\protocol\types\PlayerListEntry; use pocketmine\network\mcpe\protocol\types\PlayerPermissions; -use pocketmine\network\mcpe\protocol\types\AbilitiesLayer; use pocketmine\network\mcpe\protocol\UpdateAbilitiesPacket; use pocketmine\player\Player; use pocketmine\utils\Limits; diff --git a/src/network/mcpe/NetworkSession.php b/src/network/mcpe/NetworkSession.php index 4e7f05127..0caccb53c 100644 --- a/src/network/mcpe/NetworkSession.php +++ b/src/network/mcpe/NetworkSession.php @@ -91,6 +91,7 @@ use pocketmine\network\mcpe\protocol\TextPacket; use pocketmine\network\mcpe\protocol\ToastRequestPacket; use pocketmine\network\mcpe\protocol\TransferPacket; use pocketmine\network\mcpe\protocol\types\AbilitiesData; +use pocketmine\network\mcpe\protocol\types\AbilitiesLayer; use pocketmine\network\mcpe\protocol\types\BlockPosition; use pocketmine\network\mcpe\protocol\types\command\CommandData; use pocketmine\network\mcpe\protocol\types\command\CommandEnum; @@ -104,7 +105,6 @@ use pocketmine\network\mcpe\protocol\types\inventory\ContainerIds; use pocketmine\network\mcpe\protocol\types\inventory\ItemStackWrapper; use pocketmine\network\mcpe\protocol\types\PlayerListEntry; use pocketmine\network\mcpe\protocol\types\PlayerPermissions; -use pocketmine\network\mcpe\protocol\types\AbilitiesLayer; use pocketmine\network\mcpe\protocol\UpdateAbilitiesPacket; use pocketmine\network\mcpe\protocol\UpdateAdventureSettingsPacket; use pocketmine\network\mcpe\protocol\UpdateAttributesPacket; From 40b90bb722c1278cd2b04a4981bd9a0664cca4a4 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 8 Feb 2023 19:47:12 +0000 Subject: [PATCH 07/11] InGamePacketHandler: log a debug when processing skin change requests --- src/network/mcpe/handler/InGamePacketHandler.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/network/mcpe/handler/InGamePacketHandler.php b/src/network/mcpe/handler/InGamePacketHandler.php index cc2c24776..f93b4da5a 100644 --- a/src/network/mcpe/handler/InGamePacketHandler.php +++ b/src/network/mcpe/handler/InGamePacketHandler.php @@ -745,6 +745,7 @@ class InGamePacketHandler extends PacketHandler{ } public function handlePlayerSkin(PlayerSkinPacket $packet) : bool{ + $this->session->getLogger()->debug("Processing skin change request"); try{ $skin = SkinAdapterSingleton::get()->fromSkinData($packet->skin); }catch(InvalidSkinException $e){ From 475888b0318b3eaca3c749563c338b2d07e27e93 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 8 Feb 2023 20:16:41 +0000 Subject: [PATCH 08/11] InGamePacketHandler: do not process repeated skin change requests for the same full skin ID this fixes a feedback loop with persona skins in 1.19.60. --- src/network/mcpe/handler/InGamePacketHandler.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/network/mcpe/handler/InGamePacketHandler.php b/src/network/mcpe/handler/InGamePacketHandler.php index f93b4da5a..40e77f410 100644 --- a/src/network/mcpe/handler/InGamePacketHandler.php +++ b/src/network/mcpe/handler/InGamePacketHandler.php @@ -149,6 +149,8 @@ class InGamePacketHandler extends PacketHandler{ /** @var bool */ public $forceMoveSync = false; + protected ?string $lastRequestedFullSkinId = null; + public function __construct( private Player $player, private NetworkSession $session, @@ -745,6 +747,14 @@ class InGamePacketHandler extends PacketHandler{ } public function handlePlayerSkin(PlayerSkinPacket $packet) : bool{ + if($packet->skin->getFullSkinId() === $this->lastRequestedFullSkinId){ + //TODO: HACK! In 1.19.60, the client sends its skin back to us if we sent it a skin different from the one + //it's using. We need to prevent this from causing a feedback loop. + $this->session->getLogger()->debug("Refused duplicate skin change request"); + return true; + } + $this->lastRequestedFullSkinId = $packet->skin->getFullSkinId(); + $this->session->getLogger()->debug("Processing skin change request"); try{ $skin = SkinAdapterSingleton::get()->fromSkinData($packet->skin); From c7930ce9ec0045e712d21a65b95a24be6e051c8c Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 8 Feb 2023 20:21:42 +0000 Subject: [PATCH 09/11] Release 4.14.0 --- changelogs/4.14.md | 14 ++++++++++++++ src/VersionInfo.php | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 changelogs/4.14.md diff --git a/changelogs/4.14.md b/changelogs/4.14.md new file mode 100644 index 000000000..206e99048 --- /dev/null +++ b/changelogs/4.14.md @@ -0,0 +1,14 @@ +**For Minecraft: Bedrock Edition 1.19.60** + +### Note about API versions +Plugins which don't touch the protocol and compatible with any previous 4.x.y version will also run on these releases and do not need API bumps. +Plugin developers should **only** update their required API to this version if you need the changes in this build. + +**WARNING: If your plugin uses the protocol, you're not shielded by API change constraints.** You should consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you do. + +# 4.14.0 +Released 8th February 2023. + +## General +- Added support for Minecraft: Bedrock Edition 1.19.60. +- Removed support for older versions. diff --git a/src/VersionInfo.php b/src/VersionInfo.php index 253c907d3..746da4e50 100644 --- a/src/VersionInfo.php +++ b/src/VersionInfo.php @@ -31,8 +31,8 @@ use function str_repeat; final class VersionInfo{ public const NAME = "PocketMine-MP"; - public const BASE_VERSION = "4.13.1"; - public const IS_DEVELOPMENT_BUILD = true; + public const BASE_VERSION = "4.14.0"; + public const IS_DEVELOPMENT_BUILD = false; public const BUILD_CHANNEL = "stable"; private function __construct(){ From c62845e92a82254aa169b7a6e0b98561beacf084 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 8 Feb 2023 20:21:43 +0000 Subject: [PATCH 10/11] 4.14.1 is next --- src/VersionInfo.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/VersionInfo.php b/src/VersionInfo.php index 746da4e50..74aeaa19c 100644 --- a/src/VersionInfo.php +++ b/src/VersionInfo.php @@ -31,8 +31,8 @@ use function str_repeat; final class VersionInfo{ public const NAME = "PocketMine-MP"; - public const BASE_VERSION = "4.14.0"; - public const IS_DEVELOPMENT_BUILD = false; + public const BASE_VERSION = "4.14.1"; + public const IS_DEVELOPMENT_BUILD = true; public const BUILD_CHANNEL = "stable"; private function __construct(){ From fbaf8e3fc826f67964e3de5418cbe3e7afa13353 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 11 Feb 2023 17:13:12 +0000 Subject: [PATCH 11/11] Update composer dependencies --- composer.json | 2 +- composer.lock | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/composer.json b/composer.json index 26de28c15..74be1967b 100644 --- a/composer.json +++ b/composer.json @@ -54,7 +54,7 @@ "webmozart/path-util": "^2.3" }, "require-dev": { - "phpstan/phpstan": "1.9.16", + "phpstan/phpstan": "1.9.17", "phpstan/phpstan-phpunit": "^1.1.0", "phpstan/phpstan-strict-rules": "^1.2.0", "phpunit/phpunit": "^9.2" diff --git a/composer.lock b/composer.lock index 6ff40e421..630320020 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f516e1546e5d16c31fef01d2a98c0da8", + "content-hash": "f4a0fb9a6731f083ef7e29fc3f527171", "packages": [ { "name": "adhocore/json-comment", @@ -1832,16 +1832,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.9.16", + "version": "1.9.17", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "922e2689bb180575d0f57de0443c431a5a698e8f" + "reference": "204e459e7822f2c586463029f5ecec31bb45a1f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/922e2689bb180575d0f57de0443c431a5a698e8f", - "reference": "922e2689bb180575d0f57de0443c431a5a698e8f", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/204e459e7822f2c586463029f5ecec31bb45a1f2", + "reference": "204e459e7822f2c586463029f5ecec31bb45a1f2", "shasum": "" }, "require": { @@ -1871,7 +1871,7 @@ ], "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.9.16" + "source": "https://github.com/phpstan/phpstan/tree/1.9.17" }, "funding": [ { @@ -1887,20 +1887,20 @@ "type": "tidelift" } ], - "time": "2023-02-07T10:42:21+00:00" + "time": "2023-02-08T12:25:00+00:00" }, { "name": "phpstan/phpstan-phpunit", - "version": "1.3.3", + "version": "1.3.4", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "54a24bd23e9e80ee918cdc24f909d376c2e273f7" + "reference": "d77af96c1aaec28f7c0293677132eaaad079e01b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/54a24bd23e9e80ee918cdc24f909d376c2e273f7", - "reference": "54a24bd23e9e80ee918cdc24f909d376c2e273f7", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/d77af96c1aaec28f7c0293677132eaaad079e01b", + "reference": "d77af96c1aaec28f7c0293677132eaaad079e01b", "shasum": "" }, "require": { @@ -1937,9 +1937,9 @@ "description": "PHPUnit extensions and rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-phpunit/issues", - "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.3.3" + "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.3.4" }, - "time": "2022-12-21T15:25:00+00:00" + "time": "2023-02-09T08:05:29+00:00" }, { "name": "phpstan/phpstan-strict-rules",