diff --git a/src/pocketmine/network/mcpe/NetworkSession.php b/src/pocketmine/network/mcpe/NetworkSession.php index 46dfd06f3..6afd12166 100644 --- a/src/pocketmine/network/mcpe/NetworkSession.php +++ b/src/pocketmine/network/mcpe/NetworkSession.php @@ -319,7 +319,7 @@ class NetworkSession{ try{ $packet->decode(); - if(!$packet->feof() and !$packet->mayHaveUnreadBytes()){ + if(!$packet->feof()){ $remains = substr($packet->getBuffer(), $packet->getOffset()); $this->logger->debug("Still " . strlen($remains) . " bytes unread in " . $packet->getName() . ": " . bin2hex($remains)); } diff --git a/src/pocketmine/network/mcpe/protocol/DataPacket.php b/src/pocketmine/network/mcpe/protocol/DataPacket.php index e6563630f..9633f7113 100644 --- a/src/pocketmine/network/mcpe/protocol/DataPacket.php +++ b/src/pocketmine/network/mcpe/protocol/DataPacket.php @@ -56,14 +56,6 @@ abstract class DataPacket extends NetworkBinaryStream implements Packet{ return false; } - /** - * Returns whether the packet may legally have unread bytes left in the buffer. - * @return bool - */ - public function mayHaveUnreadBytes() : bool{ - return false; - } - /** * @throws BadPacketException */ diff --git a/src/pocketmine/network/mcpe/protocol/LoginPacket.php b/src/pocketmine/network/mcpe/protocol/LoginPacket.php index 694d8877f..9deef9bb4 100644 --- a/src/pocketmine/network/mcpe/protocol/LoginPacket.php +++ b/src/pocketmine/network/mcpe/protocol/LoginPacket.php @@ -82,10 +82,6 @@ class LoginPacket extends DataPacket implements ServerboundPacket{ return true; } - public function mayHaveUnreadBytes() : bool{ - return $this->protocol !== null and $this->protocol !== ProtocolInfo::CURRENT_PROTOCOL; - } - protected function decodePayload() : void{ $this->protocol = $this->getInt(); $this->decodeConnectionRequest(); diff --git a/src/pocketmine/network/mcpe/protocol/Packet.php b/src/pocketmine/network/mcpe/protocol/Packet.php index 5ca1ba074..71bd3a5c4 100644 --- a/src/pocketmine/network/mcpe/protocol/Packet.php +++ b/src/pocketmine/network/mcpe/protocol/Packet.php @@ -48,12 +48,6 @@ interface Packet{ public function canBeSentBeforeLogin() : bool; - /** - * Returns whether the packet may legally have unread bytes left in the buffer. - * @return bool - */ - public function mayHaveUnreadBytes() : bool; - /** * @throws BadPacketException */