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

@ -35,6 +35,8 @@ class ContainerAckPacket extends RakNetDataPacket{
ConsoleAPI::debug($this->unknownshort);
ConsoleAPI::debug($this->write1);
ConsoleAPI::debug($this->write0);
ConsoleAPI::debug($this->unknwonubyte2);
}
public function encode(){
@ -53,6 +55,8 @@ class ContainerAckPacket extends RakNetDataPacket{
ConsoleAPI::debug($this->unknownshort);
ConsoleAPI::debug($this->write1);
ConsoleAPI::debug($this->write0);
ConsoleAPI::debug($this->unknwonubyte2);
}
}

View file

@ -37,6 +37,7 @@ class ContainerOpenPacket extends RakNetDataPacket{
$this->putByte($this->slots);
if ($this->PROTOCOL <= ProtocolInfo9::CURRENT_PROTOCOL_9){
$this->putString($this->unknownstring);
ConsoleAPI::debug($this->unknownstring);
}else{
$this->putInt($this->x);
$this->putInt($this->y);

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);
}
}