mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 02:08:21 +00:00
Protocol updates for 1.1.0.5
This commit is contained in:
@ -74,13 +74,16 @@ class BatchPacket extends DataPacket{
|
||||
|
||||
public function handle(NetworkSession $session) : bool{
|
||||
if(strlen($this->payload) < 2){
|
||||
throw new \InvalidStateException("Not enough bytes in payload, expected zlib header");
|
||||
return false;
|
||||
}
|
||||
|
||||
$str = zlib_decode($this->payload, 1024 * 1024 * 64); //Max 64MB
|
||||
$len = strlen($str);
|
||||
try{
|
||||
$str = zlib_decode($this->payload, 1024 * 1024 * 64); //Max 64MB
|
||||
}catch(\ErrorException $e){
|
||||
return false;
|
||||
}
|
||||
|
||||
if($len === 0){
|
||||
if(strlen($str) === 0){
|
||||
throw new \InvalidStateException("Decoded BatchPacket payload is empty");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user