本文整理汇总了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"));
}
示例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);
}
示例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();
}
示例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);
}
}
示例5: getValidUUID
/**
* @param Player $player
* @return null|string
*/
public function getValidUUID(Player $player)
{
$uniqueId = $player->getUniqueId()->toString();
return $uniqueId;
}
示例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);
}
}
示例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;
}
示例8: onPlayerLogin
public function onPlayerLogin(Player $player)
{
if ($this->sendUsageTicker > 0) {
$this->uniquePlayers[$player->getUniqueId()] = $player->getUniqueId();
}
}
示例9: addPlayer
public function addPlayer(Player $player)
{
$uuid = $player->getUniqueId()->toString();
$this->playerList[$uuid] = $player;
}
示例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" => []];
}
示例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()]);
}
}
示例12: removePlayer
public function removePlayer(Player $player)
{
unset($this->playerList[$player->getUniqueId()->toString()]);
}
示例13: removePlayer
public function removePlayer(Player $player)
{
$this->playerList[spl_object_hash($player->getUniqueId())] = null;
}
示例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;
}
示例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]);
}