Skip to content

Commit c417ecd

Browse files
committed
NetworkSession: Abort packet processing if handling triggered a disconnection
this shows up when requesting invalid data during resource pack handling, for example
1 parent 11612ed commit c417ecd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/network/mcpe/NetworkSession.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,11 @@ public function handleEncoded(string $payload) : void{
415415
$this->logger->debug($packet->getName() . ": " . base64_encode($buffer));
416416
throw PacketHandlingException::wrap($e, "Error processing " . $packet->getName());
417417
}
418+
if(!$this->isConnected()){
419+
//handling this packet may have caused a disconnection
420+
$this->logger->debug("Aborting batch processing due to server-side disconnection");
421+
break;
422+
}
418423
}
419424
}catch(PacketDecodeException|BinaryDataException $e){
420425
$this->logger->logException($e);

0 commit comments

Comments
 (0)