mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-13 06:55:29 +00:00
Automatic permission calculation on PermissibleBase construction
thanks to the PermissibleInternal/PermissibleBase architectural change, there's no longer any concern regarding cyclic refs.
This commit is contained in:
parent
02fab77e55
commit
ede4d58394
@ -1124,7 +1124,6 @@ class Server{
|
||||
|
||||
//TODO: move console parts to a separate component
|
||||
$consoleSender = new ConsoleCommandSender($this, $this->language);
|
||||
$consoleSender->recalculatePermissions();
|
||||
$this->subscribeToBroadcastChannel(self::BROADCAST_CHANNEL_ADMINISTRATIVE, $consoleSender);
|
||||
$this->subscribeToBroadcastChannel(self::BROADCAST_CHANNEL_USERS, $consoleSender);
|
||||
|
||||
|
@ -64,10 +64,8 @@ class PermissibleInternal implements Permissible{
|
||||
public function __construct(array $basePermissions){
|
||||
$this->permissionRecalculationCallbacks = new ObjectSet();
|
||||
|
||||
//TODO: we can't setBasePermission here directly due to bad architecture that causes recalculatePermissions to explode
|
||||
//so, this hack has to be done here to prevent permission recalculations until it's fixed...
|
||||
$this->rootPermissions = $basePermissions;
|
||||
//TODO: permissions need to be recalculated here, or inherited permissions won't work
|
||||
$this->recalculatePermissions();
|
||||
}
|
||||
|
||||
public function setBasePermission($name, bool $grant) : void{
|
||||
|
@ -305,8 +305,6 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
||||
return;
|
||||
}
|
||||
|
||||
$this->perm->recalculatePermissions();
|
||||
|
||||
$this->server->getLogger()->info($this->getServer()->getLanguage()->translateString("pocketmine.player.logIn", [
|
||||
TextFormat::AQUA . $this->username . TextFormat::WHITE,
|
||||
$session->getIp(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user