Skip to content

Commit

Permalink
extra byte
Browse files Browse the repository at this point in the history
  • Loading branch information
ismaileke authored Jul 28, 2024
1 parent c22a7d1 commit 7425ec5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/protocol/OpenConnectionRequest2.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ class OpenConnectionRequest2 extends OfflineMessage{

protected function encodePayload(PacketSerializer $out) : void{
$this->writeMagic($out);
$out->putByte(($this->serverSecurity ? 1 : 0));
if ($this->serverSecurity) {
$out->putInt($this->cookie);
$out->putByte(false); // WHY MOJANG?

Check failure on line 34 in src/protocol/OpenConnectionRequest2.php

View workflow job for this annotation

GitHub Actions / PHP 8.1

Parameter #1 $v of method pocketmine\utils\BinaryStream::putByte() expects int, false given.

Check failure on line 34 in src/protocol/OpenConnectionRequest2.php

View workflow job for this annotation

GitHub Actions / PHP 8.2

Parameter #1 $v of method pocketmine\utils\BinaryStream::putByte() expects int, false given.
}
$out->putAddress($this->serverAddress);
$out->putShort($this->mtuSize);
Expand All @@ -40,9 +40,9 @@ protected function encodePayload(PacketSerializer $out) : void{

protected function decodePayload(PacketSerializer $in) : void{
$this->readMagic($in);
$this->serverSecurity = $in->getByte() !== 0;
if ($this->serverSecurity) {
$this->cookie = $in->getInt();
$in->getByte(); // JUST 5 BYTES AND THERE IS WEIRD EXTRA BYTE
}
$this->serverAddress = $in->getAddress();
$this->mtuSize = $in->getShort();
Expand Down

0 comments on commit 7425ec5

Please sign in to comment.