Fixed invalid ACK/NACK handling

This commit is contained in:
Shoghi Cervantes Pueyo 2013-03-28 11:20:40 +01:00
parent 6260d66bde
commit 42d5296533
2 changed files with 4 additions and 4 deletions

View File

@ -541,7 +541,7 @@ class Player{
case 0xc0: //ACK case 0xc0: //ACK
$diff = $data[2] - $this->counter[2]; $diff = $data[2] - $this->counter[2];
if($diff > 8){ //Packet recovery if($diff > 8){ //Packet recovery
$this->directDataPacket($this->recovery[$data[2]]["id"], $this->recovery[$data[2]]); $this->directDataPacket($this->recovery[$this->counter[2]]["id"], $this->recovery[$this->counter[2]]);
} }
$this->counter[2] = $data[2]; $this->counter[2] = $data[2];
$this->recovery[$data[2]] = null; $this->recovery[$data[2]] = null;
@ -550,7 +550,7 @@ class Player{
if(isset($data[3])){ if(isset($data[3])){
$diff = $data[3] - $this->counter[2]; $diff = $data[3] - $this->counter[2];
if($diff > 8){ //Packet recovery if($diff > 8){ //Packet recovery
$this->directDataPacket($this->recovery[$data[3]]["id"], $this->recovery[$data[3]]); $this->directDataPacket($this->recovery[$this->counter[2]]["id"], $this->recovery[$this->counter[2]]);
} }
$this->counter[2] = $data[3]; $this->counter[2] = $data[3];
$this->recovery[$data[3]] = null; $this->recovery[$data[3]] = null;

View File

@ -62,7 +62,7 @@ class Packet{
case 0xc0: case 0xc0:
case 0xa0: case 0xa0:
if($this->data[1] === false){ if($this->data[1] === false){
$this->addRaw($this->data[$field]); $this->addRaw(strrev(Utils::writeTriad($this->data[$field])));
} }
break; break;
case 0x05: case 0x05:
@ -174,7 +174,7 @@ class Packet{
case 0xc0: case 0xc0:
case 0xa0: case 0xa0:
if($this->data[1] === false){ if($this->data[1] === false){
$this->data[] = $this->get(3); $this->data[] = Utils::readTriad(strrev($this->get(3)));
} }
break; break;
case 0x05: case 0x05: