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


PHP Player::getUniqueId方法代码示例

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


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

示例1: __construct

 public function __construct(HereAuth $main, Player $player, AccountInfo $info)
 {
     $this->main = $main;
     $this->player = $player;
     $this->accountInfo = $info;
     if ($info->passwordHash === null) {
         if (!$main->getConfig()->getNested("ForceRegister.Enabled", true)) {
             // no registration involved
             $this->onAuth();
             $reminder = $main->getConfig()->getNested("ForceRegister.Reminder", "");
             if (strlen($reminder) > 0) {
                 $player->sendMessage($reminder);
             }
             return;
         }
         $this->startRegistration();
         return;
     }
     if ($info->opts->autoSecret and $player->getClientSecret() === $info->lastSecret) {
         $this->onAuth();
         return;
     }
     if ($info->opts->autoIp and $player->getAddress() === $info->lastIp) {
         $this->onAuth();
         return;
     }
     if ($info->opts->autoUuid and $player->getUniqueId()->toBinary() === $info->lastUuid) {
         $this->onAuth();
         return;
     }
     $this->state = self::STATE_PENDING_LOGIN;
     $this->player->sendMessage($main->getConfig()->getNested("Messages.Login.Query", "Please login"));
 }
开发者ID:EpicArtz08999,项目名称:HereAuth,代码行数:33,代码来源:User.php

示例2: putPacket

 public function putPacket(Player $player, DataPacket $packet, $needACK = false, $immediate = true)
 {
     $packet->encode();
     $pk = new RedirectPacket();
     $pk->uuid = $player->getUniqueId();
     $pk->direct = $immediate;
     $pk->mcpeBuffer = $packet->buffer;
     $this->synapseInterface->putPacket($pk);
 }
开发者ID:iTXTech,项目名称:Genisys,代码行数:9,代码来源:SynLibInterface.php

示例3: __construct

 public function __construct(HereAuth $main, Player $player, AccountInfo $info)
 {
     $this->loadTime = microtime(true);
     $this->main = $main;
     $this->player = $player;
     $this->accountInfo = $info;
     if (!$info->passwordHash) {
         $main->getDataBase()->passesLimit($player->getAddress(), $main->getConfig()->getNested("Registration.RateLimit.Accounts", 3), $main->getConfig()->getNested("Registration.RateLimit.Days", 30) * 86400, $player->getId());
         if (!$main->getConfig()->getNested("ForceRegister.Enabled", true)) {
             // no registration involved
             $this->onAuth();
             $reminder = $main->getConfig()->getNested("ForceRegister.Reminder", "");
             if (strlen($reminder) > 0) {
                 $player->sendMessage($reminder);
             }
             return;
         }
         $this->startRegistration();
         $this->initAppearance();
         return;
     }
     if ($info->opts->autoSecret and $player->getClientSecret() === $info->lastSecret and $this->callLogin(HereAuthLoginEvent::METHOD_CLIENT_SECRET)) {
         $this->main->getAuditLogger()->logLogin(strtolower($player->getName()), $player->getAddress(), "secret");
         $this->onAuth();
         return;
     }
     if ($info->opts->autoIp and $player->getAddress() === $info->lastIp and $this->callLogin(HereAuthLoginEvent::METHOD_IP)) {
         $this->main->getAuditLogger()->logLogin(strtolower($player->getName()), $player->getAddress(), "ip");
         $this->onAuth();
         return;
     }
     if ($info->opts->autoUuid and $player->getUniqueId()->toBinary() === $info->lastUuid and $this->callLogin(HereAuthLoginEvent::METHOD_UUID)) {
         $this->main->getAuditLogger()->logLogin(strtolower($player->getName()), $player->getAddress(), "uuid");
         $this->onAuth();
         return;
     }
     $this->state = self::STATE_PENDING_LOGIN;
     $this->player->sendMessage($main->getConfig()->getNested("Messages.Login.Query", "Please login"));
     $this->initAppearance();
 }
开发者ID:GoneTone,项目名称:HereAuth,代码行数:40,代码来源:User.php

示例4: removeOnlinePlayer

 public function removeOnlinePlayer(Player $player)
 {
     if (isset($this->playerList[$player->getRawUniqueId()])) {
         unset($this->playerList[$player->getRawUniqueId()]);
         $pk = new PlayerListPacket();
         $pk->type = PlayerListPacket::TYPE_REMOVE;
         $pk->entries[] = [$player->getUniqueId()];
         Server::broadcastPacket($this->playerList, $pk);
     }
 }
开发者ID:ZenaGamingsky,项目名称:PocketBox,代码行数:10,代码来源:Server.php

示例5: getValidUUID

 /**
  * @param Player $player
  * @return null|string
  */
 public function getValidUUID(Player $player)
 {
     $uniqueId = $player->getUniqueId()->toString();
     return $uniqueId;
 }
开发者ID:PainTR,项目名称:PurePerms,代码行数:9,代码来源:PurePerms.php

示例6: showPlayer

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

示例7: getValidUUID

 /**
  * @param Player $player
  * @return null|string
  */
 public function getValidUUID(Player $player)
 {
     if ($this->isUUIDSupported) {
         if ($player->getUniqueId() === null) {
             return null;
         }
         $uniqueId = $player->getUniqueId()->toString();
     } else {
         $uniqueId = $player->getUniqueId();
     }
     return $uniqueId;
 }
开发者ID:mad-hon,项目名称:PurePerms,代码行数:16,代码来源:PurePerms.php

示例8: onPlayerLogin

 public function onPlayerLogin(Player $player)
 {
     if ($this->sendUsageTicker > 0) {
         $this->uniquePlayers[$player->getUniqueId()] = $player->getUniqueId();
     }
 }
开发者ID:KyleTheHack3r,项目名称:PocketMine-MP,代码行数:6,代码来源:Server.php

示例9: addPlayer

 public function addPlayer(Player $player)
 {
     $uuid = $player->getUniqueId()->toString();
     $this->playerList[$uuid] = $player;
 }
开发者ID:Muqsit,项目名称:SimpleBlindAuth,代码行数:5,代码来源:ShowMessageTask.php

示例10: defaultLoginData

 protected static function defaultLoginData($uid, Player $player)
 {
     $name = $player->getName();
     $ip = $player->getAddress();
     return ["uid" => $uid, "name" => $name, "nicks" => "|{$name}|", "lastip" => "", "status" => Settings::STATUS_ONLINE, "lastses" => Settings::$LOCALIZE_CLASS, "authuuid" => $player->getUniqueId(), "coins" => 100.0, "hash" => str_repeat("0", 128), "pwprefix" => "", "pwlen" => 0, "registration" => time(), "laston" => time(), "ontime" => 0, "config" => Settings::CONFIG_DEFAULT_VALUE, "lastgrind" => 0, "rank" => 0, "warnpts" => 0, "lastwarn" => 0, "tid" => -1, "teamrank" => -1, "teamjoin" => 0, "ignorelist" => ",", "iphist" => ",{$ip},", "isnew" => true, "email" => self::EMAIL_UNVERIFIED, "friends" => [], "langs" => [], "purchases" => []];
 }
开发者ID:Addison118,项目名称:LegionPE-Theta-Base-1,代码行数:6,代码来源:BasePlugin.php

示例11: removeAttachment

 /**
  * @param Player $player
  */
 public function removeAttachment(Player $player)
 {
     if (isset($this->attachments[$player->getUniqueId()])) {
         $player->removeAttachment($this->attachments[$player->getUniqueId()]);
         unset($this->attachments[$player->getUniqueId()]);
     }
 }
开发者ID:BoltsLeScrub,项目名称:PurePerms,代码行数:10,代码来源:PurePerms.php

示例12: removePlayer

 public function removePlayer(Player $player)
 {
     unset($this->playerList[$player->getUniqueId()->toString()]);
 }
开发者ID:Johnmacrocraft,项目名称:Minecraft-PE,代码行数:4,代码来源:ShowMessageTask.php

示例13: removePlayer

 public function removePlayer(Player $player)
 {
     $this->playerList[spl_object_hash($player->getUniqueId())] = null;
 }
开发者ID:TheMurasyouServer,项目名称:SimpleAuth,代码行数:4,代码来源:ShowMessageTask.php

示例14: 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

示例15: unregisterPlayer

 /**
  * @param Player $player
  */
 public function unregisterPlayer(Player $player)
 {
     $this->getLogger()->debug($this->getMessage("logger_messages.unregisterPlayer", $player->getName()));
     $uniqueId = $player->getUniqueId()->toString();
     if (isset($this->attachments[$uniqueId])) {
         $player->removeAttachment($this->attachments[$uniqueId]);
     }
     unset($this->attachments[$uniqueId]);
 }
开发者ID:pomee4,项目名称:PurePerms,代码行数:12,代码来源:PurePerms.php


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