Added handling for unknown packets

This commit is contained in:
Dylan K. Taylor
2017-02-27 16:51:02 +00:00
parent 5aed0fb0d5
commit e008a3cd5e
4 changed files with 67 additions and 8 deletions

View File

@ -174,6 +174,7 @@ use pocketmine\network\mcpe\protocol\StartGamePacket;
use pocketmine\network\mcpe\protocol\TakeItemEntityPacket;
use pocketmine\network\mcpe\protocol\TextPacket;
use pocketmine\network\mcpe\protocol\TransferPacket;
use pocketmine\network\mcpe\protocol\UnknownPacket;
use pocketmine\network\mcpe\protocol\UpdateAttributesPacket;
use pocketmine\network\mcpe\protocol\UpdateBlockPacket;
use pocketmine\network\mcpe\protocol\UseItemPacket;
@ -3258,12 +3259,13 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
return false;
}
public function handleUnknown(UnknownPacket $packet) : bool{
$this->server->getLogger()->debug("Received unknown packet from " . $this->getName() . ": 0x" . bin2hex($packet->payload));
return true;
}
/**
* Handles a Minecraft packet
* TODO: Separate all of this in handlers
*
* WARNING: Do not use this, it's only for internal use.
* Changes to this function won't be recorded on the version.
* TODO: get rid of these remains, fix DataPacketReceiveEvent, fix timings
*
* @param DataPacket $packet
*/