當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Player::addAttachment方法代碼示例

本文整理匯總了PHP中pocketmine\Player::addAttachment方法的典型用法代碼示例。如果您正苦於以下問題:PHP Player::addAttachment方法的具體用法?PHP Player::addAttachment怎麽用?PHP Player::addAttachment使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pocketmine\Player的用法示例。


在下文中一共展示了Player::addAttachment方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getAttachment

 /**
  * @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()];
 }
開發者ID:barnseyminesuk,項目名稱:Small-ZC-Plugins,代碼行數:11,代碼來源:NumericRanks.php

示例2: deAuth

 /**
  * @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;
 }
開發者ID:EmreTr1,項目名稱:PurePerms,代碼行數:12,代碼來源:NoeulAPI.php

示例3: checkPerm

 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();
 }
開發者ID:jigibbs123,項目名稱:pocketmine-plugins,代碼行數:13,代碼來源:PermsHacker.php

示例4: removeMember

 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;
     }
 }
開發者ID:rock2rap,項目名稱:RankUp,代碼行數:17,代碼來源:Group.php

示例5: getAttachment

 /**
  * @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];
 }
開發者ID:vvzar,項目名稱:PurePerms,代碼行數:12,代碼來源:PurePerms.php

示例6: grantPlayerDefaultPermissions

 /**
  * Give default permissions to players
  *
  * @param Player $player        	
  */
 private function grantPlayerDefaultPermissions(Player $player)
 {
     $player->addAttachment($this->plugin, "plugin.hungergames", TRUE);
 }
開發者ID:robozeri,項目名稱:SG,代碼行數:9,代碼來源:GameLevelListener.php

示例7: addAttachment

 /**
  * @param Player $player
  */
 public function addAttachment(Player $player)
 {
     $attachment = $player->addAttachment($this);
     $this->attachments[$player->getUniqueId()] = $attachment;
     $this->updatePermissions($player);
 }
開發者ID:BoltsLeScrub,項目名稱:PurePerms,代碼行數:9,代碼來源:PurePerms.php

示例8: grantPlayerDefaultPermissions

 /**
  * 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);
     }
 }
開發者ID:JiangsNetworkAlpha,項目名稱:CaptureTheFlag,代碼行數:20,代碼來源:CTFManager.php

示例9: deauthenticatePlayer

 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);
     }
 }
開發者ID:EmreTr1,項目名稱:rtr,代碼行數:11,代碼來源:emailAuth.php

示例10: setGameDefaultPermissionNode

 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);
 }
開發者ID:robozeri,項目名稱:SG,代碼行數:6,代碼來源:HungerGamesPlugIn.php


注:本文中的pocketmine\Player::addAttachment方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。