mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
Added packet pid to buffer by default
This commit is contained in:
parent
c40b00288b
commit
580ef46513
@ -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();
|
||||
|
@ -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
|
||||
|
@ -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 = ""){
|
||||
|
Loading…
x
Reference in New Issue
Block a user