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