Updated BedrockProtocol:

it's weirdly satisfying that LevelChunkPacket::create() with the extra parameter turns out to be exactly the same length as the old way.
This commit is contained in:
Dylan K. Taylor 2021-11-02 01:37:56 +00:00
parent f2912fcdd8
commit 0f6b7e48cb
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
3 changed files with 6 additions and 6 deletions

8
composer.lock generated
View File

@ -253,12 +253,12 @@
"source": {
"type": "git",
"url": "https://github.com/pmmp/BedrockProtocol.git",
"reference": "c76e31fc948f58ad2b788679c84335684396d025"
"reference": "67c0c15b4044cab2190501933912c3d02c5f63ab"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/c76e31fc948f58ad2b788679c84335684396d025",
"reference": "c76e31fc948f58ad2b788679c84335684396d025",
"url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/67c0c15b4044cab2190501933912c3d02c5f63ab",
"reference": "67c0c15b4044cab2190501933912c3d02c5f63ab",
"shasum": ""
},
"require": {
@ -293,7 +293,7 @@
"issues": "https://github.com/pmmp/BedrockProtocol/issues",
"source": "https://github.com/pmmp/BedrockProtocol/tree/master"
},
"time": "2021-11-01T18:59:44+00:00"
"time": "2021-11-02T01:27:05+00:00"
},
{
"name": "pocketmine/binaryutils",

View File

@ -72,7 +72,7 @@ class ChunkRequestTask extends AsyncTask{
$subCount = ChunkSerializer::getSubChunkCount($chunk);
$encoderContext = new PacketSerializerContext(GlobalItemTypeDictionary::getInstance()->getDictionary());
$payload = ChunkSerializer::serializeFullChunk($chunk, RuntimeBlockMapping::getInstance(), $encoderContext, $this->tiles);
$this->setResult($this->compressor->compress(PacketBatch::fromPackets($encoderContext, LevelChunkPacket::withoutCache($this->chunkX, $this->chunkZ, $subCount, $payload))->getBuffer()));
$this->setResult($this->compressor->compress(PacketBatch::fromPackets($encoderContext, LevelChunkPacket::create($this->chunkX, $this->chunkZ, $subCount, null, $payload))->getBuffer()));
}
public function onError() : void{

View File

@ -563,7 +563,7 @@ class NetworkSession{
*/
private function doServerDisconnect(string $reason, bool $notify = true) : void{
if($notify){
$this->sendDataPacket($reason === "" ? DisconnectPacket::silent() : DisconnectPacket::message($reason), true);
$this->sendDataPacket(DisconnectPacket::create($reason !== "" ? $reason : null), true);
}
$this->sender->close($notify ? $reason : "");