承接 nethergamesmc/bedrock-protocol 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nethergamesmc/bedrock-protocol

Composer 安装命令:

composer require nethergamesmc/bedrock-protocol

包简介

An implementation of the Minecraft: Bedrock Edition protocol in PHP

README 文档

README

CI

An implementation of the Minecraft: Bedrock Edition protocol in PHP

This library implements all of the packets in the Minecraft: Bedrock Edition protocol, as well as a few extra things needed to support them. However, at the time of writing, it does not include the following:

  • Anything related to JWT handling/verification
  • Anything related to encryption
  • Anything related to compression

Decoding packets

Assuming you've decrypted and decompressed a Minecraft packet successfully, you're next going to want to decode it. With this library, that's currently done using PacketBatch, like so:

use pocketmine\network\mcpe\protocol\serializer\PacketBatch;
use pocketmine\network\mcpe\protocol\PacketPool;
use pmmp\encoding\ByteBufferReader;

foreach(PacketBatch::decodePackets(new ByteBufferReader($payload), PacketPool::getInstance()) as $packetObject){
    var_dump($packetObject); //tada
}

Encoding packets

This is easy:

use pocketmine\network\mcpe\protocol\serializer\PacketBatch;
use pmmp\encoding\ByteBufferWriter;

/** @var Packet[] $packets */
$stream = new ByteBufferWriter();
PacketBatch::encodePackets($stream, $packets);
$batchPayload = $stream->getData();

Footnotes

This library is a little rough around the edges, since it's only ever been intended for PocketMine-MP usage. It's only recently that this mess has been separated from the core to allow it to be used by other things. This means that API changes might be in order, and your feedback would be nice to drive them. If you want to improve BedrockProtocol, please open issues with suggestions, or better, make pull requests.

统计信息

  • 总下载量: 3k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 10
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 10
  • Watchers: 1
  • Forks: 112
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0
  • 更新时间: 2024-03-18