From 664089861a8e19ac072e9f53155adc98d5d0270a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Jan 2023 14:27:51 +0000 Subject: [PATCH 1/7] Bump phpstan/phpstan from 1.9.11 to 1.9.12 (#5517) Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.9.11 to 1.9.12. - [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.11...1.9.12) --- updated-dependencies: - dependency-name: phpstan/phpstan dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] 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 1b2679e71..c9d3908d5 100644 --- a/composer.json +++ b/composer.json @@ -54,7 +54,7 @@ "webmozart/path-util": "^2.3" }, "require-dev": { - "phpstan/phpstan": "1.9.11", + "phpstan/phpstan": "1.9.12", "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 861d73ead..b2bbb472c 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": "d5ea4a4f41bf80636b678e6d3d06eac0", + "content-hash": "1c5a3de092db3cda702d3f39d3da246c", "packages": [ { "name": "adhocore/json-comment", @@ -1832,16 +1832,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.9.11", + "version": "1.9.12", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "60f3d68481eef216199eae7a2603cd5fe124d464" + "reference": "44a338ff0d5572c13fd77dfd91addb96e48c29f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/60f3d68481eef216199eae7a2603cd5fe124d464", - "reference": "60f3d68481eef216199eae7a2603cd5fe124d464", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/44a338ff0d5572c13fd77dfd91addb96e48c29f8", + "reference": "44a338ff0d5572c13fd77dfd91addb96e48c29f8", "shasum": "" }, "require": { @@ -1871,7 +1871,7 @@ ], "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.9.11" + "source": "https://github.com/phpstan/phpstan/tree/1.9.12" }, "funding": [ { @@ -1887,7 +1887,7 @@ "type": "tidelift" } ], - "time": "2023-01-12T14:04:13+00:00" + "time": "2023-01-17T10:44:04+00:00" }, { "name": "phpstan/phpstan-phpunit", From a8556dff02cbc981cc108bc4e4f29782e7c6be8f Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 18 Jan 2023 15:00:18 +0000 Subject: [PATCH 2/7] RakLibInterface: include Snooze events in Connection Handler timings --- src/network/mcpe/raklib/RakLibInterface.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/network/mcpe/raklib/RakLibInterface.php b/src/network/mcpe/raklib/RakLibInterface.php index bf1f75c26..5eec4b31b 100644 --- a/src/network/mcpe/raklib/RakLibInterface.php +++ b/src/network/mcpe/raklib/RakLibInterface.php @@ -36,6 +36,8 @@ use pocketmine\network\NetworkInterfaceStartException; use pocketmine\network\PacketHandlingException; use pocketmine\Server; use pocketmine\snooze\SleeperNotifier; +use pocketmine\timings\Timings; +use pocketmine\timings\TimingsHandler; use pocketmine\utils\Utils; use raklib\generic\SocketException; use raklib\protocol\EncapsulatedPacket; @@ -110,7 +112,12 @@ class RakLibInterface implements ServerEventListener, AdvancedNetworkInterface{ public function start() : void{ $this->server->getTickSleeper()->addNotifier($this->sleeper, function() : void{ - while($this->eventReceiver->handle($this)); + Timings::$connection->startTiming(); + try{ + while($this->eventReceiver->handle($this)); + }finally{ + Timings::$connection->stopTiming(); + } }); $this->server->getLogger()->debug("Waiting for RakLib to start..."); try{ From 2f5e08067d2558559d65e90945f3297624cf7bb0 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 18 Jan 2023 15:16:30 +0000 Subject: [PATCH 3/7] Release 4.12.10 --- changelogs/4.12.md | 11 +++++++++++ src/VersionInfo.php | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/changelogs/4.12.md b/changelogs/4.12.md index ab96c2082..8878a42f5 100644 --- a/changelogs/4.12.md +++ b/changelogs/4.12.md @@ -93,3 +93,14 @@ Released 16th January 2023. ## Other changes - Increased packet batch budget for player sessions. + +# 4.12.10 +Released 18th January 2023. + +## Fixes +- Fixed reported server load not including the time spent processing Snooze interrupts between ticks (e.g. incoming network packets). +- Fixed `Connection Handler` entry in timings report not including time spent receiving packets. + +## Note about server load & performance +This version will report higher apparent server load than previous versions. The actual performance of the server is unchanged; the previous reported load was inaccurate. +These bugs have been present for nearly 5 years (ever since the first introduction of Snooze in 3.0.0). diff --git a/src/VersionInfo.php b/src/VersionInfo.php index 9bbff9b63..1c1023ae5 100644 --- a/src/VersionInfo.php +++ b/src/VersionInfo.php @@ -32,7 +32,7 @@ use function str_repeat; final class VersionInfo{ public const NAME = "PocketMine-MP"; public const BASE_VERSION = "4.12.10"; - public const IS_DEVELOPMENT_BUILD = true; + public const IS_DEVELOPMENT_BUILD = false; public const BUILD_CHANNEL = "stable"; private function __construct(){ From 217f9aea02945816ec8a8280ccef7e297fe7ee3b Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 18 Jan 2023 15:16:33 +0000 Subject: [PATCH 4/7] 4.12.11 is next --- src/VersionInfo.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/VersionInfo.php b/src/VersionInfo.php index 1c1023ae5..fe876727a 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.12.10"; - public const IS_DEVELOPMENT_BUILD = false; + public const BASE_VERSION = "4.12.11"; + public const IS_DEVELOPMENT_BUILD = true; public const BUILD_CHANNEL = "stable"; private function __construct(){ From 7c068101b719dfaf330f5b23c0055b902877d06e Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 18 Jan 2023 15:17:37 +0000 Subject: [PATCH 5/7] =?UTF-8?q?CS=C3=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/network/mcpe/raklib/RakLibInterface.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/network/mcpe/raklib/RakLibInterface.php b/src/network/mcpe/raklib/RakLibInterface.php index 5eec4b31b..ef9f7d641 100644 --- a/src/network/mcpe/raklib/RakLibInterface.php +++ b/src/network/mcpe/raklib/RakLibInterface.php @@ -37,7 +37,6 @@ use pocketmine\network\PacketHandlingException; use pocketmine\Server; use pocketmine\snooze\SleeperNotifier; use pocketmine\timings\Timings; -use pocketmine\timings\TimingsHandler; use pocketmine\utils\Utils; use raklib\generic\SocketException; use raklib\protocol\EncapsulatedPacket; From 1d9336ed677ce5df380c75da11d779d13ea2c0ce Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 18 Jan 2023 16:15:43 +0000 Subject: [PATCH 6/7] Release 4.13.0-BETA1 --- changelogs/4.13-beta.md | 94 +++++++++++++++++++++++++++++++++++++++++ src/VersionInfo.php | 6 +-- 2 files changed, 97 insertions(+), 3 deletions(-) create mode 100644 changelogs/4.13-beta.md diff --git a/changelogs/4.13-beta.md b/changelogs/4.13-beta.md new file mode 100644 index 000000000..865d2267b --- /dev/null +++ b/changelogs/4.13-beta.md @@ -0,0 +1,94 @@ +**For Minecraft: Bedrock Edition 1.19.50** + +This is a minor feature release for PocketMine-MP, introducing some new features and improvements. + +### 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.13.0-BETA1 +Released 18th January 2023. + +## Gameplay +- Death message is now shown on the death screen when a player dies. +- Armour damage is now only increased if the armour reduced the damage taken. +- Implemented Swift Sneak enchantment. +- Fixed incorrect collision box calculation of walls and glass/bars when connected. Note: Client-side, wall connections are still broken; this only fixes projectile flight server-side. + +## Performance +- Improved performance of chunk selection for chunk random ticking using a cache. This improves performance of chunk random ticking by 10-20%. + +## Localization +- Added localized description for the `/dumpmemory` command. + +## Permissions +- Added the following new core permissions: + - `pocketmine.command.effect.other` - allows the player to use the `/effect` command on other players (default operator only) + - `pocketmine.command.effect.self` - allows the player to use the `/effect` command on themselves (default operator only) + - `pocketmine.command.enchant.other` - allows the player to use the `/enchant` command on other players (default operator only) + - `pocketmine.command.enchant.self` - allows the player to use the `/enchant` command on themselves (default operator only) + - `pocketmine.command.gamemode.other` - allows the player to use the `/gamemode` command on other players (default operator only) + - `pocketmine.command.gamemode.self` - allows the player to use the `/gamemode` command on themselves (default operator only) + - `pocketmine.command.give.other` - allows the player to use the `/give` command on other players (default operator only) + - `pocketmine.command.give.self` - allows the player to use the `/give` command on themselves (default operator only) + - `pocketmine.command.spawnpoint.other` - allows the player to use the `/spawnpoint` command on other players (default operator only) + - `pocketmine.command.spawnpoint.self` - allows the player to use the `/spawnpoint` command on themselves (default operator only) + - `pocketmine.command.teleport.other` - allows the player to use the `/teleport` command on other players (default operator only) + - `pocketmine.command.teleport.self` - allows the player to use the `/teleport` command on themselves (default operator only) + - `pocketmine.command.title.other` - allows the player to use the `/title` command on other players (default operator only) + - `pocketmine.command.title.self` - allows the player to use the `/title` command on themselves (default operator only) + +## Internals +- Decoupled `Player->sendMessage()` and `Player->sendTranslation()`. +- Refactored resource pack loading in `ResourcePackManager` to make it easier to understand. +- Client-aware translation processing has been moved to `NetworkSession` due to being client-specific. +- Replaced hardcoded strings with constants in various places. +- `NetworkSession` destructive cleanup is now deferred to the next session tick. This fixes various `InventoryManager` crashes when kicking players during events. +- Updated code using `strpos()` to use `str_starts_with()`, `str_ends_with()` and `str_contains()` where appropriate. +- Added documentation for some internal methods. + +## API +### `pocketmine\command` +- The following new API methods have been added: + - `protected VanillaCommand->fetchPermittedPlayerTarget(...) : ?Player` - fetches a player target according to the given sender permissions, or null if not found or not permitted + +### `pocketmine\entity` +- The following new API methods have been added: + - `public Living->getDisplayName() : string` - the name of the entity to be shown in death messages, commands etc. + +### `pocketmine\event\world` +- The following new classes have been added: + - `WorldSoundEvent` - called when a sound is played in a world + - `WorldParticleEvent` - called when a particle is spawned in a world + +### `pocketmine\item` +- The following new API methods have been added: + - `public Item->onInteractEntity(Player $player, Entity $entity, Vector3 $clickVector) : bool` - called when a player interacts with an entity with this item in hand + +### `pocketmine\lang` +- `Language->translate()` and `Language->translateString()` no longer parse nested translation in the "base text". This was never intended behaviour, and didn't work beyond the first level anyway. + +### `pocketmine\player` +- The following new interfaces have been added: + - `PlayerDataProvider` - implemented by classes which want to offer storage for player data +- The following new classes have been added: + - `DatFilePlayerDataProvider` - the default player data provider, which stores `.dat` files in the `players` folder + - `PlayerDataLoadException` - thrown when an error occurs while loading player data + - `PlayerDataSaveException` - thrown when an error occurs while saving player data +- The following API methods have been deprecated: + - `Player->sendTranslation()` - use `Player->sendMessage()` instead with a `Translatable` message + +### `pocketmine\resourcepacks` +- The following new API methods have been added: + - `public ResourcePackManager->setResourceStack(list $resourceStack) : void` - sets the list of resource packs to be applied by players + - `public ResourcePackManager->setPackEncryptionKey(string $id, ?string $key) : void` - sets the encryption key to be used for a resource pack + +### `pocketmine\utils` +- The following new API methods have been added: + - `public static Filesystem::fileGetContents(...) : string` - a wrapper around `file_get_contents()` which throws an exception on failure + +### `pocketmine\world` +- The following new API methods have been added: + - `public World->requestSafeSpawn(?Vector3 $spawn = null) : Promise` - an async version of `getSafeSpawn()` which generates all the needed chunks before returning diff --git a/src/VersionInfo.php b/src/VersionInfo.php index fe876727a..053c813ec 100644 --- a/src/VersionInfo.php +++ b/src/VersionInfo.php @@ -31,9 +31,9 @@ use function str_repeat; final class VersionInfo{ public const NAME = "PocketMine-MP"; - public const BASE_VERSION = "4.12.11"; - public const IS_DEVELOPMENT_BUILD = true; - public const BUILD_CHANNEL = "stable"; + public const BASE_VERSION = "4.13.0-BETA1"; + public const IS_DEVELOPMENT_BUILD = false; + public const BUILD_CHANNEL = "beta"; private function __construct(){ //NOOP From d9324b9951687df4ecc429691439099887866ef2 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 18 Jan 2023 16:15:47 +0000 Subject: [PATCH 7/7] 4.13.0-BETA2 is next --- src/VersionInfo.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/VersionInfo.php b/src/VersionInfo.php index 053c813ec..a55ca2ba3 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.0-BETA1"; - public const IS_DEVELOPMENT_BUILD = false; + public const BASE_VERSION = "4.13.0-BETA2"; + public const IS_DEVELOPMENT_BUILD = true; public const BUILD_CHANNEL = "beta"; private function __construct(){