Merge branch 'master' into pr

This commit is contained in:
yefengeeeeeeeeeee 2025-04-29 17:42:31 +08:00 • committed by GitHub
commit c3a8ecaeb0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
359 changed files with 3109 additions and 3222 deletions

View file

@ -14,7 +14,7 @@ abstract class RakNetDataPacket extends stdClass{
private $offset = 0;
public $PROTOCOL = ProtocolInfo::CURRENT_PROTOCOL;
public $PROTOCOL = ProtocolInfo::CURRENT_PROTOCOL;
abstract public function encode();
@ -23,11 +23,11 @@ abstract class RakNetDataPacket extends stdClass{
public function getBuffer(){
return $this->buffer;
}
public function getOffset(){
return $this->offset;
}
public function setBuffer($buffer = ""){
$this->buffer = $buffer;
$this->offset = 0;
@ -140,12 +140,12 @@ abstract class RakNetDataPacket extends stdClass{
protected function getShort($unsigned = false){
return Utils::readShort($this->get(2), $unsigned);
}
public function getSignedByte(){
$b = ord($this->get(1));
return $b >= 0x80 ? ($b-256) : $b;
return $b >= 0x80 ? ($b - 256) : $b;
}
protected function getByte(){
return ord($this->get(1));
}
@ -161,7 +161,7 @@ abstract class RakNetDataPacket extends stdClass{
}
protected function putByte($v){
$this->buffer .= chr((int)$v);
$this->buffer .= chr((int) $v);
}
protected function getString(){