本文整理汇总了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));
}
示例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));
}
示例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));
}
示例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;
}
示例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];
}
示例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));
}
示例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();
}
示例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;
}
示例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;
}
示例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));
}
示例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();
}
示例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];
}
示例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();
}
示例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();
}
示例15: decode
public function decode()
{
$this->eid = Binary::readLong($this->get(8));
$this->unknown = \ord($this->get(1));
$this->item = $this->getSlot();
}