From 4b715aaba7e1e27070719c35728edb007f9bbc93 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 11 Apr 2021 20:59:09 +0100 Subject: [PATCH] Document API changes related to broadcast channels closes #2960 --- changelogs/4.0-snapshot.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/changelogs/4.0-snapshot.md b/changelogs/4.0-snapshot.md index 847a91705f..0e6e2a6bc9 100644 --- a/changelogs/4.0-snapshot.md +++ b/changelogs/4.0-snapshot.md @@ -585,6 +585,7 @@ This version features substantial changes to the network system, improving coher - The following API methods have been added: - `Permission->addChild()` - `Permission->removeChild()` + - `Permissible->getPermissionRecalculationCallbacks()` - allows reacting to changes of permissions, such as new permissions being granted or denied - The following API methods have been removed: - `Permissible->isOp()`: use `Permissible->hasPermission(DefaultPermissions::ROOT_OPERATOR)` instead, **but you really shouldn't directly depend on a player's op status, add your own permissions instead!** - `Permissible->setOp()`: use `addAttachment($plugin, DefaultPermissions::ROOT_OPERATOR, true)` instead to add, and `removeAttachment()` to remove it (or addAttachment() with false to explicitly deny it, just like any other permission) @@ -722,11 +723,16 @@ This version features substantial changes to the network system, improving coher - `AsyncTask->saveToThreadStore()`: use `AsyncTask->worker->saveToThreadStore()` ### Server -- The following API methods have been added: - - `subscribeToBroadcastChannel()` - allows subscribing a `CommandSender` to receive chat messages (and other message types) on any channel - - `unsubscribeFromBroadcastChannel()` - - `unsubscribeFromAllBroadcastChannels()` - - `getBroadcastChannelSubscribers()` +- New chat broadcasting APIs have been implemented, which don't depend on the permission system. + - The following API methods have been added: + - `subscribeToBroadcastChannel()` - allows subscribing a `CommandSender` to receive chat messages (and other message types) on any channel + - `unsubscribeFromBroadcastChannel()` + - `unsubscribeFromAllBroadcastChannels()` + - `getBroadcastChannelSubscribers()` + - Giving `Player` any `pocketmine.broadcast.*` permissions will cause them to automatically subscribe to the corresponding broadcast channel (and removing them will unsubscribe it). + - It's now possible to create and subscribe to custom broadcast channels without using permissions. + - However, `Player`s may automatically unsubscribe themselves from the builtin broadcast channels if they don't have the proper permissions. + - Automatic subscribe/unsubscribe from custom broadcast channels can be implemented using the new `Permissible` permission recalculation callbacks API. - The following API methods have been removed: - `reloadWhitelist()` - `getLevelMetadata()`