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


PHP Binary::writeMetadata方法代码示例

本文整理汇总了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);
 }
开发者ID:Cybertechpp,项目名称:Steadfast2,代码行数:7,代码来源:SetEntityDataPacket.php

示例2: encode

 public function encode()
 {
     $this->reset();
     $this->buffer .= Binary::writeLong($this->eid);
     $meta = Binary::writeMetadata($this->metadata);
     $this->buffer .= $meta;
 }
开发者ID:Edwardthedog2,项目名称:Steadfast2,代码行数:7,代码来源:SetEntityDataPacket.php

示例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;
 }
开发者ID:xpyctum,项目名称:PocketMinePlusPlus,代码行数:8,代码来源:SetEntityDataPacket__32bit.php

示例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;
 }
开发者ID:xpyctum,项目名称:PocketMinePlusPlus,代码行数:8,代码来源:SetEntityDataPacket__64bit.php

示例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));
 }
开发者ID:boybook,项目名称:PocketMine-MP,代码行数:12,代码来源:AddMobPacket.php

示例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);
 }
开发者ID:Hydreon,项目名称:PMSoft238,代码行数:12,代码来源:AddMobPacket.php

示例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));
 }
开发者ID:boybook,项目名称:PocketMine-MP,代码行数:15,代码来源:AddPlayerPacket.php

示例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);
 }
开发者ID:Hydreon,项目名称:PMSoft238,代码行数:15,代码来源:AddPlayerPacket.php

示例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);
 }
开发者ID:kniffo80,项目名称:Genisys,代码行数:18,代码来源:AddPlayerPacket.php

示例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);
 }
开发者ID:NewDelion,项目名称:PocketMine-0.13.x,代码行数:20,代码来源:AddPlayerPacket.php

示例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;
 }
开发者ID:kazuemon,项目名称:NIGHTMARE,代码行数:21,代码来源:AddPlayerPacket.php

示例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]);
     }
 }
开发者ID:Edwardthedog2,项目名称:Steadfast2,代码行数:22,代码来源:AddEntityPacket.php

示例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]);
     }
 }
开发者ID:kniffo80,项目名称:Genisys,代码行数:22,代码来源:AddEntityPacket.php

示例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]);
     }
 }
开发者ID:orlando092,项目名称:ImagicalMine,代码行数:22,代码来源:AddEntityPacket.php

示例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]);
     }
 }
开发者ID:xpyctum,项目名称:PocketMinePlusPlus,代码行数:23,代码来源:AddEntityPacket__64bit.php


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