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


PHP Binary::writeLInt方法代码示例

本文整理汇总了PHP中pocketmine\utils\Binary::writeLInt方法的典型用法代码示例。如果您正苦于以下问题:PHP Binary::writeLInt方法的具体用法?PHP Binary::writeLInt怎么用?PHP Binary::writeLInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pocketmine\utils\Binary的用法示例。


在下文中一共展示了Binary::writeLInt方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: putLInt

 public function putLInt($v)
 {
     $this->buffer .= Binary::writeLInt($v);
 }
开发者ID:Cecil107,项目名称:PocketMine-0.13.0,代码行数:4,代码来源:BinaryStream.php

示例2: chunkIndex

 public static function chunkIndex($chunkX, $chunkZ)
 {
     return Binary::writeLInt($chunkX) . Binary::writeLInt($chunkZ);
 }
开发者ID:Creeperface01,项目名称:ImagicalMine,代码行数:4,代码来源:LevelDB.php

示例3: writeChunk

 public function writeChunk($X, $Z)
 {
     $X = (int) $X;
     $Z = (int) $Z;
     if (!isset($this->map[$X][$Z])) {
         return false;
     }
     $chunk = "";
     foreach ($this->map[$X][$Z] as $section => $data) {
         for ($i = 0; $i < 256; ++$i) {
             $chunk .= $data[$i];
         }
     }
     return Binary::writeLInt(strlen($chunk)) . $chunk;
 }
开发者ID:boybook,项目名称:PocketMine-MP,代码行数:15,代码来源:PocketChunkParser.php

示例4: writePacket

 private function writePacket($client, $requestID, $packetType, $payload)
 {
     $pk = Binary::writeLInt((int) $requestID) . Binary::writeLInt((int) $packetType) . $payload . "";
     //Terminate payload and packet
     return socket_write($client, Binary::writeLInt(strlen($pk)) . $pk);
 }
开发者ID:ClearSkyTeam,项目名称:ClearSky,代码行数:6,代码来源:RCONInstance.php

示例5: putInt

 public function putInt($v)
 {
     $this->buffer .= $this->endianness === self::BIG_ENDIAN ? Binary::writeInt($v) : Binary::writeLInt($v);
 }
开发者ID:ianju,项目名称:PocketMine-MP,代码行数:4,代码来源:NBT.php

示例6: onRun

 public function onRun()
 {
     $orderedIds = "";
     $orderedData = "";
     $orderedSkyLight = "";
     $orderedLight = "";
     $ids = "";
     $meta = "";
     $blockLight = "";
     $skyLight = "";
     foreach ($this->sections as $section) {
         $ids .= $section->getIdArray();
         $meta .= $section->getDataArray();
         $blockLight .= $section->getLightArray();
         $skyLight .= $section->getSkyLightArray();
     }
     for ($x = 0; $x < 16; ++$x) {
         for ($z = 0; $z < 16; ++$z) {
             $orderedIds .= $this->getColumn($ids, $x, $z);
             $orderedData .= $this->getHalfColumn($meta, $x, $z);
             $orderedSkyLight .= $this->getHalfColumn($skyLight, $x, $z);
             $orderedLight .= $this->getHalfColumn($blockLight, $x, $z);
         }
     }
     $biomeColors = pack("N*", ...$this->biomeColors);
     $ordered = zlib_encode(Binary::writeLInt($this->chunkX) . Binary::writeLInt($this->chunkZ) . $orderedIds . $orderedData . $orderedSkyLight . $orderedLight . $this->biomeIds . $biomeColors . $this->tiles, ZLIB_ENCODING_DEFLATE, $this->compressionLevel);
     $this->setResult($ordered);
 }
开发者ID:rryy,项目名称:PocketMine-MP,代码行数:28,代码来源:ChunkRequestTask.php

示例7: requestChunkTask

 public function requestChunkTask($x, $z)
 {
     $chunk = $this->getChunk($x, $z, false);
     if (!$chunk instanceof Chunk) {
         throw new \Exception("Invalid Chunk sent");
     }
     $tiles = "";
     $nbt = new NBT(NBT::LITTLE_ENDIAN);
     foreach ($chunk->getTiles() as $tile) {
         if ($tile instanceof Spawnable) {
             $nbt->setData($tile->getSpawnCompound());
             $tiles .= $nbt->write();
         }
     }
     $biomeColors = pack("N*", ...$chunk->getBiomeColorArray());
     $ordered = zlib_encode(Binary::writeLInt($x) . Binary::writeLInt($z) . $chunk->getBlockIdArray() . $chunk->getBlockDataArray() . $chunk->getBlockSkyLightArray() . $chunk->getBlockLightArray() . $chunk->getBiomeIdArray() . $biomeColors . $tiles, ZLIB_ENCODING_DEFLATE, Level::$COMPRESSION_LEVEL);
     $this->getLevel()->chunkRequestCallback($x, $z, $ordered);
     return null;
 }
开发者ID:boybook,项目名称:PocketMine-MP,代码行数:19,代码来源:McRegion.php

示例8: putInt

 public function putInt($v, bool $network = false)
 {
     if ($network === true) {
         $this->buffer .= Binary::writeVarInt($v);
     } else {
         $this->buffer .= $this->endianness === self::BIG_ENDIAN ? Binary::writeInt($v) : Binary::writeLInt($v);
     }
 }
开发者ID:ClearSkyTeam,项目名称:ClearSky,代码行数:8,代码来源:NBT.php

示例9: putInt

 public function putInt($int)
 {
     $this->buffer .= Binary::writeLInt($int);
 }
开发者ID:Ad5001,项目名称:WorldEditArt,代码行数:4,代码来源:ByteBufferWriter.php


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