mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
SignUpdatePacket implement
This commit is contained in:
parent
e3f0ed0744
commit
de98590660
5 changed files with 46 additions and 3 deletions
34
src/network/protocol/packet/SignUpdatePacket.php
Normal file
34
src/network/protocol/packet/SignUpdatePacket.php
Normal 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);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue