當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。