Added packet pid to buffer by default

This commit is contained in:
Shoghi Cervantes 2014-02-08 00:36:30 +01:00
parent c40b00288b
commit 580ef46513
3 changed files with 3 additions and 3 deletions

View File

@ -2317,7 +2317,7 @@ class Player{
$sendtime = microtime(true);
$size = $this->MTU - 34;
$buffer = str_split(chr($packet->pid()) . $packet->buffer, $size);
$buffer = str_split($packet->buffer, $size);
$bigCnt = $this->bigCnt;
$this->bigCnt = ($this->bigCnt + 1) % 0x10000;
$cnts = array();

View File

@ -123,7 +123,7 @@ class RakNetCodec{
private function encodeDataPacket(RakNetDataPacket $pk){
$this->putByte(($pk->reliability << 5) | ($pk->hasSplit > 0 ? 0b00010000:0));
$this->putShort((strlen($pk->buffer) + 1) << 3);
$this->putShort(strlen($pk->buffer) << 3);
if($pk->reliability === 2
or $pk->reliability === 3
or $pk->reliability === 4

View File

@ -40,7 +40,7 @@ abstract class RakNetDataPacket extends stdClass{
abstract public function decode();
protected function reset(){
$this->setBuffer();
$this->setBuffer(chr($this->pid()));
}
public function setBuffer($buffer = ""){