Handle unknown packets more gracefully

This commit is contained in:
Shoghi Cervantes 2014-02-08 19:21:45 +01:00
parent 0ff647015c
commit dfd5733969

View File

@ -1141,6 +1141,7 @@ class Player{
foreach($this->receiveQueue as $count => $packets){
unset($this->receiveQueue[$count]);
foreach($packets as $p){
if($p instanceof RakNetDataPacket){
if(isset($p->messageIndex) and $p->messageIndex !== false){
if($p->messageIndex > $this->receiveCount){
$this->receiveCount = $p->messageIndex;
@ -1166,6 +1167,7 @@ class Player{
}
}
}
}
if($this->nextBuffer <= $time and $this->bufferLen > 0){
$this->sendBuffer();
@ -2235,7 +2237,7 @@ class Player{
}
break;
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;
}
}