当前位置: 首页>>代码示例>>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;未经允许,请勿转载。