本文整理汇总了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()];
}
示例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;
}
示例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();
}
示例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;
}
}
示例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];
}
示例6: grantPlayerDefaultPermissions
/**
* Give default permissions to players
*
* @param Player $player
*/
private function grantPlayerDefaultPermissions(Player $player)
{
$player->addAttachment($this->plugin, "plugin.hungergames", TRUE);
}
示例7: addAttachment
/**
* @param Player $player
*/
public function addAttachment(Player $player)
{
$attachment = $player->addAttachment($this);
$this->attachments[$player->getUniqueId()] = $attachment;
$this->updatePermissions($player);
}
示例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);
}
}
示例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);
}
}
示例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);
}