SignUpdatePacket implement

This commit is contained in:
yefengeeeeeeeeeee 2025-05-03 16:19:35 +08:00
parent e3f0ed0744
commit de98590660
5 changed files with 46 additions and 3 deletions

View file

@ -0,0 +1,34 @@
<?php
class SignUpdatePacket extends RakNetDataPacket{
public $x;
public $y;
public $z;
public $content;
public function pid(){
if($this->PROTOCOL < ProtocolInfo8::CURRENT_PROTOCOL_8){
return ProtocolInfo6::SIGN_UPDATE_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::SIGN_UPDATE_PACKET) {
return ProtocolInfo8::SIGN_UPDATE_PACKET;
}
return ProtocolInfo9::SIGN_UPDATE_PACKET;
}
public function decode(){
//$this->reset();
$this->x = $this->getShort();
$this->y = $this->getByte();
$this->z = $this->getShort();
$this->content = $this->getString();
}
public function encode(){
//$this->reset();
$this->putShort($this->x);
$this->putByte($this->y);
$this->putShort($this->z);
$this->putString($this->content);
}
}