Handle all kind of unknown data packets

This commit is contained in:
Shoghi Cervantes 2014-02-08 19:17:49 +01:00
parent f255948eb6
commit 0ff647015c

View File

@ -180,9 +180,17 @@ class RakNetParser{
if($length <= 0 if($length <= 0
or $orderChannel >= 32 or $orderChannel >= 32
or ($hasSplit === true and $splitIndex >= $splitCount)){ or ($hasSplit === true and $splitIndex >= $splitCount)){
return false; $data = new UnknownPacket();
} $data->reliability = $reliability;
$data->hasSplit = $hasSplit;
$data->messageIndex = $messageIndex;
$data->orderIndex = $orderIndex;
$data->orderChannel = $orderChannel;
$data->splitCount = $splitCount;
$data->splitID = $splitID;
$data->splitIndex = $splitIndex;
$data->setBuffer($this->get($length));
}else{
$pid = $this->getByte(); $pid = $this->getByte();
if(isset(ProtocolInfo::$packets[$pid])){ if(isset(ProtocolInfo::$packets[$pid])){
$data = new ProtocolInfo::$packets[$pid]; $data = new ProtocolInfo::$packets[$pid];
@ -199,6 +207,7 @@ class RakNetParser{
$data->splitID = $splitID; $data->splitID = $splitID;
$data->splitIndex = $splitIndex; $data->splitIndex = $splitIndex;
$data->setBuffer($this->get($length - 1)); $data->setBuffer($this->get($length - 1));
}
return $data; return $data;
} }