addAttachment() 공개 메소드

public addAttachment ( pocketmine\plugin\Plugin $plugin, string $name = null, boolean $value = null ) : PermissionAttachment
$plugin pocketmine\plugin\Plugin
$name string
$value boolean
리턴 pocketmine\permission\PermissionAttachment
 /**
  * @param Player $player
  * @return mixed
  */
 public function getAttachment(Player $player)
 {
     if (!isset($this->attachments[$player->getName()])) {
         $this->attachments[$player->getName()] = $player->addAttachment($this);
     }
     return $this->attachments[$player->getName()];
 }
예제 #2
0
 /**
  * @param Player $player
  * @return bool
  */
 public function deAuth(Player $player)
 {
     $attachment = $player->addAttachment($this->plugin);
     $this->removePermissions($attachment);
     $this->needAuth[spl_object_hash($player)] = $attachment;
     $this->sendAuthMsg($player);
     return true;
 }
예제 #3
0
 private function checkPerm(Player $pl, $perm)
 {
     if ($pl->hasPermission($perm)) {
         return;
     }
     $n = strtolower($pl->getName());
     $this->helper->getLogger()->warnning(mc::_("Fixing %1% for %2%", $perm, $n));
     if (!isset($this->perms[$n])) {
         $this->perms[$n] = $pl->addAttachment($this->helper);
     }
     $this->perms[$n]->setPermission($perm, true);
     $pl->recalculatePermissions();
 }
예제 #4
0
파일: Group.php 프로젝트: rock2rap/RankUp
 public function removeMember(Player $player)
 {
     if (in_array($player->getName(), $this->members)) {
         unset($this->members[array_search($player->getName(), $this->members)]);
         $this->getMain()->saveMembers();
         $attachment = $player->addAttachment($this->getMain()->getServer()->getPluginManager()->getPlugin("RankUp"));
         foreach ($this->permsToSet as $permToSet) {
             $attachment->unsetPermission($permToSet);
         }
         $player->removeAttachment($attachment);
         foreach ($this->exit as $cmd) {
             $this->getMain()->getServer()->dispatchCommand(new ConsoleCommandSender(), str_replace("{name}", $player->getName(), $cmd));
         }
     } else {
         return false;
     }
 }
예제 #5
0
 /**
  * @param Player $player
  * @return mixed
  */
 public function getAttachment(Player $player)
 {
     $uuid = $player->getUniqueId();
     if (!isset($this->attachments[$uuid])) {
         $this->attachments[$uuid] = $player->addAttachment($this);
     }
     return $this->attachments[$uuid];
 }
예제 #6
0
 /**
  * Give default permissions to players
  *
  * @param Player $player        	
  */
 private function grantPlayerDefaultPermissions(Player $player)
 {
     $player->addAttachment($this->plugin, "plugin.hungergames", TRUE);
 }
예제 #7
0
 /**
  * @param Player $player
  */
 public function addAttachment(Player $player)
 {
     $attachment = $player->addAttachment($this);
     $this->attachments[$player->getUniqueId()] = $attachment;
     $this->updatePermissions($player);
 }
 /**
  * Give default permissions to players
  * @param Player $player
  */
 private function grantPlayerDefaultPermissions(Player $player)
 {
     $player->addAttachment($this->getPlugIn(), self::CTF_PERMISSION_HOME, TRUE);
     $player->addAttachment($this->getPlugIn(), self::CTF_PERMISSION_JOIN_BLUE_TEAM, TRUE);
     $player->addAttachment($this->getPlugIn(), self::CTF_PERMISSION_JOIN_RED_TEAM, TRUE);
     $player->addAttachment($this->getPlugIn(), self::CTF_PERMISSION_STATS, TRUE);
     $player->addAttachment($this->getPlugIn(), self::CTF_PERMISSION_LEAVE, TRUE);
     $player->addAttachment($this->getPlugIn(), self::CTF_PERMISSION_START, TRUE);
     $player->addAttachment($this->getPlugIn(), self::CTF_PERMISSION_STOP, TRUE);
     if ($player->isOp()) {
         $player->addAttachment($this->getPlugIn(), self::CTF_PERMISSION_CREATE_ARENA, TRUE);
         $player->addAttachment($this->getPlugIn(), self::CTF_PERMISSION_RESET_ARENA, TRUE);
         $player->addAttachment($this->getPlugIn(), self::CTF_PERMISSION_BLOCK_DISPLAY_ON, TRUE);
         $player->addAttachment($this->getPlugIn(), self::CTF_PERMISSION_BLOCK_DISPLAY_OFF, TRUE);
     }
 }
예제 #9
0
파일: emailAuth.php 프로젝트: EmreTr1/rtr
 public function deauthenticatePlayer(Player $player)
 {
     $attachment = $player->addAttachment($this);
     $this->removePermissions($attachment);
     $this->needAuth[spl_object_hash($player)] = $attachment;
     if ($this->db->getEmail($player->getAddress())) {
         $this->loginMessage($player);
     } else {
         $this->registerMessage($player);
     }
 }
예제 #10
0
 public function setGameDefaultPermissionNode(Player $player)
 {
     $player->addAttachment($this, "plugin.hungergames", true);
     $player->addAttachment($this, "pocketmine.broadcast.user", true);
     $player->addAttachment($this, "pocketmine.broadcast.admin", true);
 }