Document API changes related to broadcast channels

closes #2960
This commit is contained in:
Dylan K. Taylor 2021-04-11 20:59:09 +01:00
parent e720c001a9
commit 4b715aaba7
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -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()`