当前位置: 首页>>代码示例>>PHP>>正文


PHP Player::isOnline方法代码示例

本文整理汇总了PHP中pocketmine\Player::isOnline方法的典型用法代码示例。如果您正苦于以下问题:PHP Player::isOnline方法的具体用法?PHP Player::isOnline怎么用?PHP Player::isOnline使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pocketmine\Player的用法示例。


在下文中一共展示了Player::isOnline方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: onRun

 /**
  * @param int $currentTick
  */
 public function onRun($currentTick)
 {
     if ($this->requester instanceof Player && $this->requester->isOnline()) {
         $this->getAPI()->getServer()->getLogger()->debug(TextFormat::YELLOW . "Running EssentialsPE's TPRequestTask");
         $this->getAPI()->removeTPRequest($this->requester);
     }
 }
开发者ID:PrimusLV,项目名称:EssentialsPE,代码行数:10,代码来源:TPRequestTask.php

示例2: onRun

 /**
  * @param int $currentTick
  */
 public function onRun($currentTick)
 {
     $this->getPlugin()->getServer()->getLogger()->debug(TextFormat::YELLOW . "Running EssentialsPE's AFKKickTask");
     if ($this->player instanceof Player && $this->player->isOnline() && $this->getPlugin()->isAFK($this->player) && !$this->player->hasPermission("essentials.afk.kickexempt") && time() - $this->getPlugin()->getLastPlayerMovement($this->player) >= $this->getPlugin()->getConfig()->getNested("afk.auto-set")) {
         $this->player->kick("You have been kicked for idling more than " . (($time = floor($this->getPlugin()->getConfig()->getNested("afk.auto-kick"))) / 60 >= 1 ? $time / 60 . " minutes" : $time . " seconds"), false);
     }
 }
开发者ID:mwvent,项目名称:WattzEssentialsPE,代码行数:10,代码来源:AFKKickTask.php

示例3: getValidUUID

 /**
  * @param Player $player
  * @return null|string
  */
 public function getValidUUID(Player $player)
 {
     $uuid = $player->getUniqueId();
     if ($uuid instanceof UUID) {
         return $uuid->toString();
     }
     // Heheheh...
     $this->getLogger()->warning("Why did you give me an invalid unique id? *cries* (userName: " . $player->getName() . ", isConnected: " . $player->isConnected() . ", isOnline: " . $player->isOnline() . ", isValid: " . $player->isValid() . ")");
     return null;
 }
开发者ID:0-Eclipse-0,项目名称:PurePerms,代码行数:14,代码来源:PurePerms.php

示例4: showPlayer

 /**
  * @param Player $player
  */
 public function showPlayer(Player $player)
 {
     if ($player === $this) {
         return;
     }
     unset($this->hiddenPlayers[$player->getRawUniqueId()]);
     if ($player->isOnline()) {
         $player->spawnTo($this);
     }
 }
开发者ID:NewDelion,项目名称:PocketMine-0.13.x,代码行数:13,代码来源:Player.php

示例5: isValid

 /**
  * {@inheritdoc}
  * This method also checks whether the player is online.
  */
 public function isValid()
 {
     return parent::isValid() and $this->player instanceof Player and $this->player->isOnline();
 }
开发者ID:GoneTone,项目名称:WorldEditArt,代码行数:8,代码来源:PlayerSession.php

示例6: giveFirecracker

 public function giveFirecracker(Player $player)
 {
     if ($player->isOnline()) {
         $player->getInventory()->remove(Item::get(Item::BRICK));
         $player->getInventory()->addItem(Item::get(Item::BRICK, 0, 1));
     }
     if (isset($this->givetask[$player->getName()])) {
         $this->getServer()->getScheduler()->cancelTask($this->givetask[$player->getName()]);
         unset($this->givetask[$player->getName()]);
     }
 }
开发者ID:JiangsNetworkAlpha,项目名称:FireCracka,代码行数:11,代码来源:Main.php

示例7: getKiller

 /**
  * @param Player $level
  * @return Player $killer
  */
 public function getKiller(Player $player)
 {
     if ($player->isOnline() && !$player->isAlive()) {
         $cause = $player->getLastDamageCause();
         if ($cause instanceof EntityDamageByEntityEvent) {
             $killer = $cause->getDamager();
             if ($killer->isOnline() && $killer instanceof Player) {
                 return $killer;
             }
         }
     }
 }
开发者ID:gitter-badger,项目名称:Development-1,代码行数:16,代码来源:SAPI.php

示例8: isOnline

 public function isOnline(Player $player)
 {
     if ($player->isOnline()) {
         return true;
     } else {
         return false;
     }
 }
开发者ID:TuffDev,项目名称:HungerGames,代码行数:8,代码来源:Arena.php

示例9: loadInv

 public function loadInv(Player $p)
 {
     if (!$p->isOnline()) {
         return;
     }
     $p->getInventory()->clearAll();
     foreach ($this->plugin->inv[strtolower($p->getName())] as $slot => $i) {
         list($id, $dmg, $count) = explode(":", $i);
         $item = Item::get($id, $dmg, $count);
         $p->getInventory()->setItem($slot, $item);
         unset($this->plugin->inv[strtolower($p->getName())]);
     }
 }
开发者ID:Creeperface01,项目名称:ColorMatch,代码行数:13,代码来源:Arena.php


注:本文中的pocketmine\Player::isOnline方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。