Fixed the disaster of packet receive error handling

This commit is contained in:
Dylan K. Taylor
2019-01-16 19:52:41 +00:00
parent ddc2bed63f
commit 23269da1a6
19 changed files with 126 additions and 55 deletions

View File

@ -25,6 +25,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\BadPacketException;
use pocketmine\network\mcpe\handler\SessionHandler;
use pocketmine\network\mcpe\protocol\types\MismatchTransactionData;
use pocketmine\network\mcpe\protocol\types\NormalTransactionData;
@ -68,7 +69,7 @@ class InventoryTransactionPacket extends DataPacket{
$this->trData = new ReleaseItemTransactionData();
break;
default:
throw new \UnexpectedValueException("Unknown transaction type $transactionType");
throw new BadPacketException("Unknown transaction type $transactionType");
}
$this->trData->decode($this);