diff --git a/src/Player.php b/src/Player.php index 58b9d9bd7..1a9949d00 100644 --- a/src/Player.php +++ b/src/Player.php @@ -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(); diff --git a/src/network/raknet/RakNetCodec.php b/src/network/raknet/RakNetCodec.php index 5595400b9..209ba1762 100644 --- a/src/network/raknet/RakNetCodec.php +++ b/src/network/raknet/RakNetCodec.php @@ -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 diff --git a/src/network/raknet/RakNetDataPacket.php b/src/network/raknet/RakNetDataPacket.php index aea30af4f..3237f9224 100644 --- a/src/network/raknet/RakNetDataPacket.php +++ b/src/network/raknet/RakNetDataPacket.php @@ -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 = ""){