From 52fe2cb97fa0cee5e4d72fa8e4fd298b4697385f Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Mon, 25 Nov 2024 21:29:26 +0000 Subject: [PATCH] PermissionManager: deprecate permission subscription system this is no longer used by the core, and as far as I can tell no plugin uses it either. it was used in the past for chat broadcast channels, but not anymore. --- src/permission/PermissionManager.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/permission/PermissionManager.php b/src/permission/PermissionManager.php index f2b02e8e5..c9e37f5e9 100644 --- a/src/permission/PermissionManager.php +++ b/src/permission/PermissionManager.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace pocketmine\permission; +use pocketmine\Server; use pocketmine\utils\Utils; use function count; use function spl_object_id; @@ -71,6 +72,10 @@ class PermissionManager{ } } + /** + * @deprecated Superseded by server chat broadcast channels + * @see Server::subscribeToBroadcastChannel() + */ public function subscribeToPermission(string $permission, PermissibleInternal $permissible) : void{ if(!isset($this->permSubs[$permission])){ $this->permSubs[$permission] = []; @@ -78,6 +83,10 @@ class PermissionManager{ $this->permSubs[$permission][spl_object_id($permissible)] = $permissible; } + /** + * @deprecated Superseded by server chat broadcast channels + * @see Server::unsubscribeFromBroadcastChannel() + */ public function unsubscribeFromPermission(string $permission, PermissibleInternal $permissible) : void{ if(isset($this->permSubs[$permission][spl_object_id($permissible)])){ if(count($this->permSubs[$permission]) === 1){ @@ -88,6 +97,10 @@ class PermissionManager{ } } + /** + * @deprecated Superseded by server chat broadcast channels + * @see Server::unsubscribeFromAllBroadcastChannels() + */ public function unsubscribeFromAllPermissions(PermissibleInternal $permissible) : void{ foreach(Utils::promoteKeys($this->permSubs) as $permission => $subs){ if(count($subs) === 1 && isset($subs[spl_object_id($permissible)])){ @@ -99,6 +112,8 @@ class PermissionManager{ } /** + * @deprecated Superseded by server chat broadcast channels + * @see Server::getBroadcastChannelSubscribers() * @return PermissibleInternal[] */ public function getPermissionSubscriptions(string $permission) : array{