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


PHP Binary::readLong方法代码示例

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


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

示例1: decode

 public function decode()
 {
     $this->eid = Binary::readLong($this->get(8));
     $this->x = \unpack("N", $this->get(4))[1];
     $this->z = \unpack("N", $this->get(4))[1];
     $this->y = \ord($this->get(1));
 }
开发者ID:xpyctum,项目名称:PocketMinePlusPlus,代码行数:7,代码来源:RemoveBlockPacket__32bit.php

示例2: decode

 public function decode()
 {
     $this->eid = Binary::readLong($this->get(8));
     $this->x = \PHP_INT_SIZE === 8 ? \unpack("N", $this->get(4))[1] << 32 >> 32 : \unpack("N", $this->get(4))[1];
     $this->z = \PHP_INT_SIZE === 8 ? \unpack("N", $this->get(4))[1] << 32 >> 32 : \unpack("N", $this->get(4))[1];
     $this->y = \ord($this->get(1));
 }
开发者ID:Edwardthedog2,项目名称:Steadfast2,代码行数:7,代码来源:RemoveBlockPacket.php

示例3: decode

 public function decode()
 {
     $this->eid = Binary::readLong($this->get(8));
     $this->item = $this->getSlot();
     $this->slot = \ord($this->get(1));
     $this->selectedSlot = \ord($this->get(1));
 }
开发者ID:ken77731,项目名称:PocketMine-0.13.0,代码行数:7,代码来源:MobEquipmentPacket__64bit.php

示例4: onPkt

 public function onPkt(DataPacketReceiveEvent $e)
 {
     if ($e->getPacket()->pid() !== 0x0) {
         return;
     }
     $this->lastPing[strtolower($e->getPlayer()->getName())] = Binary::readLong($e->getPacket()->buffer) / 1000.0;
 }
开发者ID:AvivShopen,项目名称:bad-plugins,代码行数:7,代码来源:Main.php

示例5: decode

 public function decode()
 {
     Binary::readLong($this->get(8));
     //TODO: remove
     $this->x = \ENDIANNESS === 0 ? \unpack("f", $this->get(4))[1] : \unpack("f", \strrev($this->get(4)))[1];
     $this->y = \ENDIANNESS === 0 ? \unpack("f", $this->get(4))[1] : \unpack("f", \strrev($this->get(4)))[1];
     $this->z = \ENDIANNESS === 0 ? \unpack("f", $this->get(4))[1] : \unpack("f", \strrev($this->get(4)))[1];
 }
开发者ID:Edwardthedog2,项目名称:Steadfast2,代码行数:8,代码来源:RespawnPacket.php

示例6: decode

 public function decode()
 {
     $this->eid = Binary::readLong($this->get(8));
     $this->item = \unpack("n", $this->get(2))[1];
     $this->meta = \unpack("n", $this->get(2))[1];
     $this->slot = \ord($this->get(1));
     $this->selectedSlot = \ord($this->get(1));
 }
开发者ID:Edwardthedog2,项目名称:Steadfast2,代码行数:8,代码来源:PlayerEquipmentPacket.php

示例7: decode

 public function decode()
 {
     $this->eid = Binary::readLong($this->get(8));
     $this->slots[0] = $this->getSlot();
     $this->slots[1] = $this->getSlot();
     $this->slots[2] = $this->getSlot();
     $this->slots[3] = $this->getSlot();
 }
开发者ID:xpyctum,项目名称:PocketMinePlusPlus,代码行数:8,代码来源:MobArmorEquipmentPacket__64bit.php

示例8: __construct

 public function __construct(DynamicHub $hub)
 {
     $this->hub = $hub;
     $this->dir = $hub->getDataFolder() . "data/json/";
     $this->playerDir = $this->dir . "players/";
     $this->nextIdFile = $this->dir . "nextId.txt";
     $this->nextId = is_file($this->dir) ? Binary::readLong(file_get_contents($this->dir . $this->nextIdFile)) : 0;
 }
开发者ID:gitter-badger,项目名称:DynamicHub,代码行数:8,代码来源:JsonDataProvider.php

示例9: decode

 public function decode()
 {
     $this->eid = Binary::readLong($this->get(8));
     $this->action = \unpack("N", $this->get(4))[1] << 32 >> 32;
     $this->x = \unpack("N", $this->get(4))[1] << 32 >> 32;
     $this->y = \unpack("N", $this->get(4))[1] << 32 >> 32;
     $this->z = \unpack("N", $this->get(4))[1] << 32 >> 32;
     $this->face = \unpack("N", $this->get(4))[1] << 32 >> 32;
 }
开发者ID:xpyctum,项目名称:PocketMinePlusPlus,代码行数:9,代码来源:PlayerActionPacket__64bit.php

示例10: decode

 public function decode()
 {
     $this->eid = Binary::readLong($this->get(8));
     $this->x = \ENDIANNESS === 0 ? \unpack("f", $this->get(4))[1] : \unpack("f", \strrev($this->get(4)))[1];
     $this->y = \ENDIANNESS === 0 ? \unpack("f", $this->get(4))[1] : \unpack("f", \strrev($this->get(4)))[1];
     $this->z = \ENDIANNESS === 0 ? \unpack("f", $this->get(4))[1] : \unpack("f", \strrev($this->get(4)))[1];
     $this->yaw = \ENDIANNESS === 0 ? \unpack("f", $this->get(4))[1] : \unpack("f", \strrev($this->get(4)))[1];
     $this->bodyYaw = \ENDIANNESS === 0 ? \unpack("f", $this->get(4))[1] : \unpack("f", \strrev($this->get(4)))[1];
     $this->pitch = \ENDIANNESS === 0 ? \unpack("f", $this->get(4))[1] : \unpack("f", \strrev($this->get(4)))[1];
     $this->mode = \ord($this->get(1));
 }
开发者ID:Edwardthedog2,项目名称:Steadfast2,代码行数:11,代码来源:MovePlayerPacket.php

示例11: decode

 public function decode()
 {
     $this->username = $this->getString();
     $this->protocol1 = \PHP_INT_SIZE === 8 ? \unpack("N", $this->get(4))[1] << 32 >> 32 : \unpack("N", $this->get(4))[1];
     $this->protocol2 = \PHP_INT_SIZE === 8 ? \unpack("N", $this->get(4))[1] << 32 >> 32 : \unpack("N", $this->get(4))[1];
     $this->clientId = Binary::readLong($this->get(8));
     $this->clientUUID = $this->getUUID();
     $this->serverAddress = $this->getString();
     $this->clientSecret = $this->getString();
     $this->slim = $this->getByte() > 0;
     $this->isTransparent = $this->getByte() > 0;
     $this->skin = $this->getString();
 }
开发者ID:kazuemon,项目名称:NIGHTMARE,代码行数:13,代码来源:LoginPacket.php

示例12: decode

 public function decode()
 {
     $this->x = \PHP_INT_SIZE === 8 ? \unpack("N", $this->get(4))[1] << 32 >> 32 : \unpack("N", $this->get(4))[1];
     $this->y = \PHP_INT_SIZE === 8 ? \unpack("N", $this->get(4))[1] << 32 >> 32 : \unpack("N", $this->get(4))[1];
     $this->z = \PHP_INT_SIZE === 8 ? \unpack("N", $this->get(4))[1] << 32 >> 32 : \unpack("N", $this->get(4))[1];
     $this->face = \ord($this->get(1));
     $this->item = \unpack("n", $this->get(2))[1];
     $this->meta = \unpack("n", $this->get(2))[1];
     $this->eid = Binary::readLong($this->get(8));
     $this->fx = \ENDIANNESS === 0 ? \unpack("f", $this->get(4))[1] : \unpack("f", \strrev($this->get(4)))[1];
     $this->fy = \ENDIANNESS === 0 ? \unpack("f", $this->get(4))[1] : \unpack("f", \strrev($this->get(4)))[1];
     $this->fz = \ENDIANNESS === 0 ? \unpack("f", $this->get(4))[1] : \unpack("f", \strrev($this->get(4)))[1];
     $this->posX = \ENDIANNESS === 0 ? \unpack("f", $this->get(4))[1] : \unpack("f", \strrev($this->get(4)))[1];
     $this->posY = \ENDIANNESS === 0 ? \unpack("f", $this->get(4))[1] : \unpack("f", \strrev($this->get(4)))[1];
     $this->posZ = \ENDIANNESS === 0 ? \unpack("f", $this->get(4))[1] : \unpack("f", \strrev($this->get(4)))[1];
 }
开发者ID:Edwardthedog2,项目名称:Steadfast2,代码行数:16,代码来源:UseItemPacket.php

示例13: decode

 public function decode()
 {
     $this->username = $this->getString();
     $this->protocol1 = \unpack("N", $this->get(4))[1] << 32 >> 32;
     $this->protocol2 = \unpack("N", $this->get(4))[1] << 32 >> 32;
     if ($this->protocol1 < Info::CURRENT_PROTOCOL) {
         //New fields!
         $this->setBuffer(\null, 0);
         //Skip batch packet handling
         return;
     }
     $this->clientId = Binary::readLong($this->get(8));
     $this->clientUUID = $this->getUUID();
     $this->serverAddress = $this->getString();
     $this->clientSecret = $this->getString();
     $this->slim = \ord($this->get(1)) > 0;
     $this->skin = $this->getString();
 }
开发者ID:VonHirsch,项目名称:PocketMine-0.13.0,代码行数:18,代码来源:LoginPacket__64bit.php

示例14: decode

 public function decode()
 {
     $this->username = $this->getString();
     $this->protocol1 = \PHP_INT_SIZE === 8 ? \unpack("N", $this->get(4))[1] << 32 >> 32 : \unpack("N", $this->get(4))[1];
     $this->protocol2 = \PHP_INT_SIZE === 8 ? \unpack("N", $this->get(4))[1] << 32 >> 32 : \unpack("N", $this->get(4))[1];
     if ($this->protocol1 < Info::CURRENT_PROTOCOL) {
         //New fields!
         $this->setBuffer(\null, 0);
         //Skip batch packet handling
         return;
     }
     $this->clientId = Binary::readLong($this->get(8));
     $this->clientUUID = $this->getUUID();
     $this->serverAddress = $this->getString();
     $this->clientSecret = $this->getString();
     $this->getByte();
     //extra byte being sent, not sure what it's for yet
     $this->slim = \ord($this->get(1)) > 0;
     $this->skin = $this->getString();
 }
开发者ID:ken77731,项目名称:PocketMine-0.13.0,代码行数:20,代码来源:LoginPacket.php

示例15: decode

 public function decode()
 {
     $this->eid = Binary::readLong($this->get(8));
     $this->unknown = \ord($this->get(1));
     $this->item = $this->getSlot();
 }
开发者ID:Edwardthedog2,项目名称:Steadfast2,代码行数:6,代码来源:DropItemPacket.php


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