当前位置: 首页>>代码示例>>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;未经允许,请勿转载。