From bd21feffc41e984719a7ade06e3756d5c05b1d38 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Thu, 16 Mar 2023 21:45:18 +0000 Subject: [PATCH] Release 4.18.0-ALPHA1 --- changelogs/4.18-alpha.md | 45 ++++++++++++++++++++++++++++++++++++++++ src/VersionInfo.php | 6 +++--- 2 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 changelogs/4.18-alpha.md diff --git a/changelogs/4.18-alpha.md b/changelogs/4.18-alpha.md new file mode 100644 index 000000000..d2c5998fc --- /dev/null +++ b/changelogs/4.18-alpha.md @@ -0,0 +1,45 @@ +**For Minecraft: Bedrock Edition 1.19.70** + +### Note about API versions +Plugins which don't touch the `pocketmine\network\mcpe` namespace are 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 `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.** +Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly. + +### Alpha release warning +Alpha releases are **experimental**. Features introduced in these releases are subject to change or removal. + +APIs which existed **prior** to this version will continue to work as normal, so plugins which use them will continue to work. + +### Highlights +This version makes changes to the internal network system to improve server performance and reduce memory usage. + +While these changes don't affect non-internal API, they are still significant enough to warrant a new minor version, as they may break plugins which use the internal network API (not recommended). + +# 4.18.0-ALPHA1 +Released 16th March 2023. + +## General +- Improved server performance in congested areas of the world (lots of players and/or entities in the same area). + +## API +### `pocketmine\event\server` +- The following new classes have been added: + - `DataPacketDecodeEvent` - called before a packet is decoded by a `NetworkSession`; useful to mitigate DoS attacks if PocketMine-MP hasn't been patched against new bugs yet + +## Internals +- Introduced new system for broadcasting entity events to network sessions. + - This change improves performance when lots of players and/or entities are in the same area. + - New interface `EntityEventBroadcaster` and class `StandardEntityEventBroadcaster` have been added to implement this. + - All entity-specific `on*()` and `sync*()` methods have been removed from `NetworkSession` (BC break). + - `NetworkSession` now accepts an `EntityEventBroadcaster` instance in its constructor. + - `NetworkBroadcastUtils::broadcastEntityEvent()` can be used to efficiently broadcast events to unique broadcasters shared by several network sessions. +- All network sessions now share the same `PacketSerializerContext` and `PacketBroadcaster` by default. + - Previously, every session had its own context, meaning that broadcast optimisations were not used, causing significant performance losses compared to 3.x. + - This change improves performance in congested areas by allowing reuse of previously encoded packet buffers for all sessions sharing the same context. + - Packet broadcasts are automatically encoded separately per unique `PacketSerializerContext` instance. This allows, for example, a multi-version fork to have a separate context for each protocol version, to ensure maximum broadcast efficiency while encoding different packets for different versions. + - `PacketSerializerContext` is now passed in `NetworkSession::__construct()`, instead of being created by the session. +- `StandardPacketBroadcaster` is now locked to a single `PacketSerializer` context, reducing complexity. +- Introduced `NetworkBroadcastUtils::broadcastPackets()`, replacing `Server->broadcastPackets()`. +- `Server->broadcastPackets()` has been deprecated. It will be removed in a future version. diff --git a/src/VersionInfo.php b/src/VersionInfo.php index 880fda698..cecefa7d7 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.17.1"; - public const IS_DEVELOPMENT_BUILD = true; - public const BUILD_CHANNEL = "stable"; + public const BASE_VERSION = "4.18.0-ALPHA1"; + public const IS_DEVELOPMENT_BUILD = false; + public const BUILD_CHANNEL = "alpha"; private function __construct(){ //NOOP