From c417ecd30d20520227b15e09eda87db492ab0a6a Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 12 Aug 2025 18:38:24 +0100 Subject: [PATCH] NetworkSession: Abort packet processing if handling triggered a disconnection this shows up when requesting invalid data during resource pack handling, for example --- src/network/mcpe/NetworkSession.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/network/mcpe/NetworkSession.php b/src/network/mcpe/NetworkSession.php index bea3f8131..234ad4765 100644 --- a/src/network/mcpe/NetworkSession.php +++ b/src/network/mcpe/NetworkSession.php @@ -415,6 +415,11 @@ class NetworkSession{ $this->logger->debug($packet->getName() . ": " . base64_encode($buffer)); throw PacketHandlingException::wrap($e, "Error processing " . $packet->getName()); } + if(!$this->isConnected()){ + //handling this packet may have caused a disconnection + $this->logger->debug("Aborting batch processing due to server-side disconnection"); + break; + } } }catch(PacketDecodeException|BinaryDataException $e){ $this->logger->logException($e);