當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UUID::fromRandom方法代碼示例

本文整理匯總了PHP中pocketmine\utils\UUID::fromRandom方法的典型用法代碼示例。如果您正苦於以下問題:PHP UUID::fromRandom方法的具體用法?PHP UUID::fromRandom怎麽用?PHP UUID::fromRandom使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pocketmine\utils\UUID的用法示例。


在下文中一共展示了UUID::fromRandom方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: encode

 public function encode()
 {
     $p = [];
     if ($this->entityId === null) {
         $this->entityId = bcadd("1095216660480", mt_rand(0, 0x7fffffff));
         //No conflict with other things
     } else {
         $pk0 = new RemoveEntityPacket();
         $pk0->eid = $this->entityId;
         $p[] = $pk0;
     }
     if (!$this->invisible) {
         $pk = new AddPlayerPacket();
         $pk->eid = $this->entityId;
         $pk->uuid = UUID::fromRandom();
         $pk->x = $this->x;
         $pk->y = $this->y - 1.62;
         $pk->z = $this->z;
         $pk->speedX = 0;
         $pk->speedY = 0;
         $pk->speedZ = 0;
         $pk->yaw = 0;
         $pk->pitch = 0;
         $pk->item = Item::get(0);
         $pk->metadata = [Entity::DATA_FLAGS => [Entity::DATA_TYPE_BYTE, 1 << Entity::DATA_FLAG_INVISIBLE], Entity::DATA_NAMETAG => [Entity::DATA_TYPE_STRING, $this->title . ($this->text !== "" ? "\n" . $this->text : "")], Entity::DATA_SHOW_NAMETAG => [Entity::DATA_TYPE_BYTE, 1], Entity::DATA_NO_AI => [Entity::DATA_TYPE_BYTE, 1], Entity::DATA_LEAD_HOLDER => [Entity::DATA_TYPE_LONG, -1], Entity::DATA_LEAD => [Entity::DATA_TYPE_BYTE, 0]];
         $p[] = $pk;
     }
     return $p;
 }
開發者ID:iTXTech,項目名稱:Genisys,代碼行數:29,代碼來源:FloatingTextParticle.php

示例2: __construct

 public function __construct(Location $loc, $name, $skin, $skinName, Item $item, $message = "")
 {
     parent::__construct($loc->x, $loc->y, $loc->z, $loc->yaw, $loc->pitch, $loc->level);
     $this->eid = Entity::$entityCount++;
     $this->skin = $skin;
     $this->skinName = $skinName;
     $this->name = $name;
     $this->item = $item;
     $this->message = $message;
     $this->uuid = UUID::fromRandom();
 }
開發者ID:wodnr0804,項目名稱:NPC,代碼行數:11,代碼來源:NPC.php

示例3: __construct

 public function __construct(Main $plugin, Location $loc, $name, $skin, $skinId, Item $item, $message = "", $command = null)
 {
     parent::__construct($loc->x, $loc->y, $loc->z, $loc->yaw, $loc->pitch, $loc->level);
     $this->plugin = $plugin;
     $this->eid = Entity::$entityCount++;
     $this->skin = $skin;
     $this->skinId = $skinId;
     $this->name = $name;
     $this->item = $item;
     $this->message = $message;
     $this->command = $command;
     $this->uuid = UUID::fromRandom();
 }
開發者ID:onebone,項目名稱:NPC,代碼行數:13,代碼來源:NPC.php

示例4: __construct

 public function __construct(SourceInterface $interface, $clientID, $ip, $port)
 {
     parent::__construct($interface, $clientID, $ip, $port);
     $this->randomUUID = UUID::fromRandom();
     $this->inventory = new DummyInventory($this);
 }
開發者ID:organization,項目名稱:DummyPlayer,代碼行數:6,代碼來源:DummyReceiver.php


注:本文中的pocketmine\utils\UUID::fromRandom方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。