NetworkSession: Abort packet processing if handling triggered a disconnection

this shows up when requesting invalid data during resource pack handling, for example
This commit is contained in:
Dylan K. Taylor 2025-08-12 18:38:24 +01:00
parent 11612ed0e2
commit c417ecd30d
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -415,6 +415,11 @@ class NetworkSession{
$this->logger->debug($packet->getName() . ": " . base64_encode($buffer)); $this->logger->debug($packet->getName() . ": " . base64_encode($buffer));
throw PacketHandlingException::wrap($e, "Error processing " . $packet->getName()); 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){ }catch(PacketDecodeException|BinaryDataException $e){
$this->logger->logException($e); $this->logger->logException($e);