本文整理汇总了PHP中pocketmine\utils\Binary::writeMetadata方法的典型用法代码示例。如果您正苦于以下问题:PHP Binary::writeMetadata方法的具体用法?PHP Binary::writeMetadata怎么用?PHP Binary::writeMetadata使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pocketmine\utils\Binary
的用法示例。
在下文中一共展示了Binary::writeMetadata方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: encode
public function encode()
{
$this->reset();
$this->putLong($this->eid);
$meta = Binary::writeMetadata($this->metadata);
$this->put($meta);
}
示例2: encode
public function encode()
{
$this->reset();
$this->buffer .= Binary::writeLong($this->eid);
$meta = Binary::writeMetadata($this->metadata);
$this->buffer .= $meta;
}
示例3: encode
public function encode()
{
$this->buffer = \chr(self::NETWORK_ID);
$this->offset = 0;
$this->buffer .= Binary::writeLong($this->eid);
$meta = Binary::writeMetadata($this->metadata);
$this->buffer .= $meta;
}
示例4: encode
public function encode()
{
$this->buffer = \chr(self::NETWORK_ID);
$this->offset = 0;
$this->buffer .= \pack("NN", $this->eid >> 32, $this->eid & 0xffffffff);
$meta = Binary::writeMetadata($this->metadata);
$this->buffer .= $meta;
}
示例5: encode
public function encode()
{
$this->reset();
$this->putInt($this->eid);
$this->putInt($this->type);
$this->putInt($this->x);
$this->putInt($this->y);
$this->putInt($this->z);
$this->putByte(floor($this->yaw * (256 / 360)));
$this->putByte(floor($this->pitch * (256 / 360)));
$this->put(Binary::writeMetadata($this->metadata));
}
示例6: encode
public function encode()
{
$this->reset();
$this->buffer .= pack("N", $this->eid);
$this->buffer .= pack("N", $this->type);
$this->buffer .= pack("N", $this->x);
$this->buffer .= pack("N", $this->y);
$this->buffer .= pack("N", $this->z);
$this->buffer .= chr(floor($this->yaw * (256 / 360)));
$this->buffer .= chr(floor($this->pitch * (256 / 360)));
$this->buffer .= Binary::writeMetadata($this->metadata);
}
示例7: encode
public function encode()
{
$this->reset();
$this->putLong($this->clientID);
$this->putString($this->username);
$this->putInt($this->eid);
$this->putFloat($this->x);
$this->putFloat($this->y);
$this->putFloat($this->z);
$this->putByte((int) ($this->yaw * (256 / 360)));
$this->putByte((int) ($this->pitch * (256 / 360)));
$this->putShort($this->unknown1);
$this->putShort($this->unknown2);
$this->put(Binary::writeMetadata($this->metadata));
}
示例8: encode
public function encode()
{
$this->reset();
$this->buffer .= Binary::writeLong($this->clientID);
$this->putString($this->username);
$this->buffer .= pack("N", $this->eid);
$this->buffer .= \ENDIANNESS === 0 ? pack("f", $this->x) : strrev(pack("f", $this->x));
$this->buffer .= \ENDIANNESS === 0 ? pack("f", $this->y) : strrev(pack("f", $this->y));
$this->buffer .= \ENDIANNESS === 0 ? pack("f", $this->z) : strrev(pack("f", $this->z));
$this->buffer .= chr((int) ($this->yaw * (256 / 360)));
$this->buffer .= chr((int) ($this->pitch * (256 / 360)));
$this->buffer .= pack("n", $this->item);
$this->buffer .= pack("n", $this->meta);
$this->buffer .= Binary::writeMetadata($this->metadata);
}
示例9: encode
public function encode()
{
$this->reset();
$this->putUUID($this->uuid);
$this->putString($this->username);
$this->putEntityId($this->eid);
//EntityUniqueID
$this->putEntityId($this->eid);
//EntityRuntimeID
$this->putVector3f($this->x, $this->y, $this->z);
$this->putVector3f($this->speedX, $this->speedY, $this->speedZ);
$this->putLFloat($this->pitch);
$this->putLFloat($this->headYaw ?? $this->yaw);
$this->putLFloat($this->yaw);
$this->putSlot($this->item);
$meta = Binary::writeMetadata($this->metadata);
$this->put($meta);
}
示例10: encode
public function encode()
{
$this->reset();
$this->putUUID($this->uuid);
$this->putString($this->username);
$this->putLong($this->eid);
$this->putFloat($this->x);
$this->putFloat($this->y);
$this->putFloat($this->z);
$this->putFloat($this->speedX);
$this->putFloat($this->speedY);
$this->putFloat($this->speedZ);
$this->putFloat($this->yaw);
$this->putFloat($this->yaw);
//TODO headrot
$this->putFloat($this->pitch);
$this->putSlot($this->item);
$meta = Binary::writeMetadata($this->metadata);
$this->put($meta);
}
示例11: encode
public function encode()
{
$this->buffer = \chr(self::NETWORK_ID);
$this->offset = 0;
$this->putUUID($this->uuid);
$this->putString($this->username);
$this->buffer .= Binary::writeLong($this->eid);
$this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->x) : \strrev(\pack("f", $this->x));
$this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->y) : \strrev(\pack("f", $this->y));
$this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->z) : \strrev(\pack("f", $this->z));
$this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->speedX) : \strrev(\pack("f", $this->speedX));
$this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->speedY) : \strrev(\pack("f", $this->speedY));
$this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->speedZ) : \strrev(\pack("f", $this->speedZ));
$this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->yaw) : \strrev(\pack("f", $this->yaw));
$this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->yaw) : \strrev(\pack("f", $this->yaw));
//TODO headrot
$this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->pitch) : \strrev(\pack("f", $this->pitch));
$this->putSlot($this->item);
$meta = Binary::writeMetadata($this->metadata);
$this->buffer .= $meta;
}
示例12: encode
public function encode()
{
$this->reset();
$this->buffer .= Binary::writeLong($this->eid);
$this->buffer .= \pack("N", $this->type);
$this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->x) : \strrev(\pack("f", $this->x));
$this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->y) : \strrev(\pack("f", $this->y));
$this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->z) : \strrev(\pack("f", $this->z));
$this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->speedX) : \strrev(\pack("f", $this->speedX));
$this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->speedY) : \strrev(\pack("f", $this->speedY));
$this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->speedZ) : \strrev(\pack("f", $this->speedZ));
$this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->yaw) : \strrev(\pack("f", $this->yaw));
$this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->pitch) : \strrev(\pack("f", $this->pitch));
$meta = Binary::writeMetadata($this->metadata);
$this->buffer .= $meta;
$this->buffer .= \pack("n", \count($this->links));
foreach ($this->links as $link) {
$this->buffer .= Binary::writeLong($link[0]);
$this->buffer .= Binary::writeLong($link[1]);
$this->buffer .= \chr($link[2]);
}
}
示例13: encode
public function encode()
{
$this->reset();
$this->putEntityId($this->eid);
//EntityUniqueID - TODO: verify this
$this->putEntityId($this->eid);
$this->putUnsignedVarInt($this->type);
$this->putVector3f($this->x, $this->y, $this->z);
$this->putVector3f($this->speedX, $this->speedY, $this->speedZ);
$this->putLFloat($this->yaw * (256 / 360));
$this->putLFloat($this->pitch * (256 / 360));
$this->putUnsignedVarInt($this->modifiers);
//attributes?
$meta = Binary::writeMetadata($this->metadata);
$this->put($meta);
$this->putUnsignedVarInt(count($this->links));
foreach ($this->links as $link) {
$this->putEntityId($link[0]);
$this->putEntityId($link[1]);
$this->putByte($link[2]);
}
}
示例14: encode
public function encode()
{
$this->reset();
$this->putLong($this->eid);
$this->putInt($this->type);
$this->putFloat($this->x);
$this->putFloat($this->y);
$this->putFloat($this->z);
$this->putFloat($this->speedX);
$this->putFloat($this->speedY);
$this->putFloat($this->speedZ);
$this->putFloat($this->yaw);
$this->putFloat($this->pitch);
$meta = Binary::writeMetadata($this->metadata);
$this->put($meta);
$this->putShort(count($this->links));
foreach ($this->links as $link) {
$this->putLong($link[0]);
$this->putLong($link[1]);
$this->putByte($link[2]);
}
}
示例15: encode
public function encode()
{
$this->buffer = \chr(self::NETWORK_ID);
$this->offset = 0;
$this->buffer .= \pack("NN", $this->eid >> 32, $this->eid & 0xffffffff);
$this->buffer .= \pack("N", $this->type);
$this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->x) : \strrev(\pack("f", $this->x));
$this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->y) : \strrev(\pack("f", $this->y));
$this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->z) : \strrev(\pack("f", $this->z));
$this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->speedX) : \strrev(\pack("f", $this->speedX));
$this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->speedY) : \strrev(\pack("f", $this->speedY));
$this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->speedZ) : \strrev(\pack("f", $this->speedZ));
$this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->yaw) : \strrev(\pack("f", $this->yaw));
$this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->pitch) : \strrev(\pack("f", $this->pitch));
$meta = Binary::writeMetadata($this->metadata);
$this->buffer .= $meta;
$this->buffer .= \pack("n", \count($this->links));
foreach ($this->links as $link) {
$this->buffer .= \pack("NN", $link[0] >> 32, $link[0] & 0xffffffff);
$this->buffer .= \pack("NN", $link[1] >> 32, $link[1] & 0xffffffff);
$this->buffer .= \chr($link[2]);
}
}