mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
Fixed Packet of Death
This commit is contained in:
parent
5ad72b4f49
commit
bd0d708274
4 changed files with 18 additions and 7 deletions
|
|
@ -173,6 +173,10 @@ class Packet{
|
|||
$this->offset += $len;
|
||||
return $data;
|
||||
}
|
||||
|
||||
private function feof(){
|
||||
return !isset($this->raw{$this->offset});
|
||||
}
|
||||
|
||||
protected function addRaw($str){
|
||||
$this->raw .= $str;
|
||||
|
|
@ -203,10 +207,10 @@ class Packet{
|
|||
case 0xa0:
|
||||
$cnt = Utils::readShort($this->get(2), false);
|
||||
$this->data[$field] = array();
|
||||
for($i = 0; $i < $cnt; ++$i){
|
||||
for($i = 0; $i < $cnt and !$this->feof(); ++$i){
|
||||
if(Utils::readBool($this->get(1)) === false){
|
||||
$start = Utils::readTriad(strrev($this->get(3)));
|
||||
$end = Utils::readTriad(strrev($this->get(3)));
|
||||
$end = min(Utils::readTriad(strrev($this->get(3))), $start + 4096);
|
||||
for($c = $start; $c <= $end; ++$c){
|
||||
$this->data[$field][] = $c;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue