Marked chat packets as not recoverable

This commit is contained in:
Shoghi Cervantes 2013-06-08 17:05:39 +02:00
parent 1a822460d8
commit 9874bd199e

View File

@ -565,9 +565,9 @@ class Player{
} }
} }
} }
$this->dataPacket(MC_CHAT, array( $this->directdataPacket(MC_CHAT, array(
"message" => $m, "message" => $m,
)); ), 0x00, false);
} }
} }
@ -1708,7 +1708,7 @@ class Player{
} }
} }
public function directDataPacket($id, $data = array(), $pid = 0x00){ public function directDataPacket($id, $data = array(), $pid = 0x00, $recover = true){
if($this->connected === false){ if($this->connected === false){
return false; return false;
} }
@ -1716,14 +1716,17 @@ class Player{
$data["pid"] = $pid; $data["pid"] = $pid;
$data["sendtime"] = microtime(true); $data["sendtime"] = microtime(true);
$count = $this->counter[0]++; $count = $this->counter[0]++;
if(count($this->recovery) >= PLAYER_RECOVERY_BUFFER){ if($recover !== false){
reset($this->recovery); if(count($this->recovery) >= PLAYER_RECOVERY_BUFFER){
$k = key($this->recovery); reset($this->recovery);
$this->recovery[$k] = null; $k = key($this->recovery);
unset($this->recovery[$k]); $this->recovery[$k] = null;
end($this->recovery); unset($this->recovery[$k]);
end($this->recovery);
}
$this->recovery[$count] = $data;
} }
$this->recovery[$count] = $data;
$this->send(0x80, array( $this->send(0x80, array(
$count, $count,