mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-11 12:27:51 +00:00
Handle unknown packets more gracefully
This commit is contained in:
parent
0ff647015c
commit
dfd5733969
@ -1141,6 +1141,7 @@ class Player{
|
|||||||
foreach($this->receiveQueue as $count => $packets){
|
foreach($this->receiveQueue as $count => $packets){
|
||||||
unset($this->receiveQueue[$count]);
|
unset($this->receiveQueue[$count]);
|
||||||
foreach($packets as $p){
|
foreach($packets as $p){
|
||||||
|
if($p instanceof RakNetDataPacket){
|
||||||
if(isset($p->messageIndex) and $p->messageIndex !== false){
|
if(isset($p->messageIndex) and $p->messageIndex !== false){
|
||||||
if($p->messageIndex > $this->receiveCount){
|
if($p->messageIndex > $this->receiveCount){
|
||||||
$this->receiveCount = $p->messageIndex;
|
$this->receiveCount = $p->messageIndex;
|
||||||
@ -1166,6 +1167,7 @@ class Player{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if($this->nextBuffer <= $time and $this->bufferLen > 0){
|
if($this->nextBuffer <= $time and $this->bufferLen > 0){
|
||||||
$this->sendBuffer();
|
$this->sendBuffer();
|
||||||
@ -2235,7 +2237,7 @@ class Player{
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
console("[DEBUG] Unhandled 0x".dechex($packet->pid())." data packet for ".$this->username." (".$this->clientID."): ".print_r($data, true), true, true, 2);
|
console("[DEBUG] Unhandled 0x".dechex($packet->pid())." data packet for ".$this->username." (".$this->clientID."): ".print_r($packet, true), true, true, 2);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user