From efea39e0a4e3b9f9cd161093e5097aaa9d4ea9ad Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 4 Jun 2017 19:19:50 +0100 Subject: [PATCH] Change buffer unread assertion to debug I lost count of how many times I changed this now... what happened to the other times? --- src/pocketmine/Player.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 3b8b9a4a4..71dacce66 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -3406,7 +3406,10 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade $timings->startTiming(); $packet->decode(); - assert($packet->feof(), "Still " . strlen(substr($packet->buffer, $packet->offset)) . " bytes unread in " . get_class($packet)); + if(!$packet->feof()){ + $remains = substr($packet->buffer, $packet->offset); + $this->server->getLogger()->debug("Still " . strlen($remains) . " bytes unread in " . $packet->getName() . ": 0x" . bin2hex($remains)); + } $this->server->getPluginManager()->callEvent($ev = new DataPacketReceiveEvent($this, $packet)); if(!$ev->isCancelled() and !$packet->handle($this)){