From 9555243f164da94795b2179ad98555d0ec83b533 Mon Sep 17 00:00:00 2001 From: ismail <74091824+ismaileke@users.noreply.github.com> Date: Wed, 7 Aug 2024 17:11:23 +0000 Subject: [PATCH] client supports security --- src/protocol/OpenConnectionRequest2.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/protocol/OpenConnectionRequest2.php b/src/protocol/OpenConnectionRequest2.php index 2152042..8c783f5 100644 --- a/src/protocol/OpenConnectionRequest2.php +++ b/src/protocol/OpenConnectionRequest2.php @@ -24,6 +24,7 @@ class OpenConnectionRequest2 extends OfflineMessage{ public int $cookie = 0; public int $clientID; + public bool $clientSupportsSecurity = false; // Always false for the vanilla client. public InternetAddress $serverAddress; public int $mtuSize; @@ -31,7 +32,7 @@ protected function encodePayload(PacketSerializer $out) : void{ $this->writeMagic($out); if (Cookie::$serverHasSecurity) { $out->putInt($this->cookie); - $out->putBool(false); // Client wrote challenge + $out->putBool($this->clientSupportsSecurity); } $out->putAddress($this->serverAddress); $out->putShort($this->mtuSize); @@ -42,7 +43,7 @@ protected function decodePayload(PacketSerializer $in) : void{ $this->readMagic($in); if (Cookie::$serverHasSecurity) { $this->cookie = $in->getInt(); - $in->getBool(); + $this->clientSupportsSecurity = $in->getBool(); } $this->serverAddress = $in->getAddress(); $this->mtuSize = $in->getShort();