pocketmine\Player::recalculatePermissions PHP Method

recalculatePermissions() public method

    public function recalculatePermissions()
    {
        $this->server->getPluginManager()->unsubscribeFromPermission(Server::BROADCAST_CHANNEL_USERS, $this);
        $this->server->getPluginManager()->unsubscribeFromPermission(Server::BROADCAST_CHANNEL_ADMINISTRATIVE, $this);
        if ($this->perm === null) {
            return;
        }
        $this->perm->recalculatePermissions();
        if ($this->hasPermission(Server::BROADCAST_CHANNEL_USERS)) {
            $this->server->getPluginManager()->subscribeToPermission(Server::BROADCAST_CHANNEL_USERS, $this);
        }
        if ($this->hasPermission(Server::BROADCAST_CHANNEL_ADMINISTRATIVE)) {
            $this->server->getPluginManager()->subscribeToPermission(Server::BROADCAST_CHANNEL_ADMINISTRATIVE, $this);
        }
    }

Usage Example

Exemplo n.º 1
0
 public function resetPerms(Player $pl)
 {
     $n = strtolower($pl->getName());
     if (isset($this->perms[$n])) {
         $attach = $this->perms[$n];
         unset($this->perms[$n]);
         $pl->removeAttachment($attach);
         $pl->recalculatePermissions();
     }
 }
All Usage Examples Of pocketmine\Player::recalculatePermissions
Player