mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-05 03:17:12 +00:00
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.
This commit is contained in:
parent
12ae8dc03b
commit
52fe2cb97f
@ -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{
|
||||
|
Loading…
x
Reference in New Issue
Block a user