Update RakNetDataPacket.php

This commit is contained in:
kotyara 2022-03-08 20:57:32 +05:00 • committed by GitHub
parent 8e3c16a035
commit 3faffd84ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -56,12 +56,14 @@ abstract class RakNetDataPacket extends stdClass{
if($len <= 0){
$this->offset = strlen($this->buffer) - 1;
return "";
}
if($len === true){
}elseif($len === true){
return substr($this->buffer, $this->offset);
}
$this->offset += $len;
return substr($this->buffer, $this->offset - $len, $len);
$buffer = b"";
for(; $len > 0; --$len, ++$this->offset){
$buffer .= $this->buffer{$this->offset};
}
return $buffer;
}
protected function put($str){
@ -168,4 +170,4 @@ abstract class RakNetDataPacket extends stdClass{
protected function feof(){
return !isset($this->buffer{$this->offset});
}
}
}