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
|
|
@ -110,6 +110,7 @@ class PacketPool{
|
|||
self::registerPacket(SetHealthPacket::class);
|
||||
self::registerPacket(SetSpawnPositionPacket::class, [8, 9, 10, 11, 12, 13, 14]);
|
||||
self::registerPacket(SetTimePacket::class);
|
||||
self::registerPacket(SignUpdatePacket::class, [6, 7, 8, 9]);
|
||||
self::registerPacket(StartGamePacket::class);
|
||||
|
||||
self::registerPacket(TakeItemEntityPacket::class);
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ abstract class ProtocolInfo9{
|
|||
const HURT_ARMOR_PACKET = 0xa5;
|
||||
const SET_ENTITY_DATA_PACKET = 0xa6;
|
||||
const SET_ENTITY_MOTION_PACKET = 0xa7;
|
||||
//const SET_ENTITY_LINK_PACKET = 0xa?;// Change
|
||||
//const SET_ENTITY_LINK_PACKET = 0xa?;
|
||||
const SET_HEALTH_PACKET = 0xa8;// Change
|
||||
const SET_SPAWN_POSITION_PACKET = 0xa9;
|
||||
const ANIMATE_PACKET = 0xaa;
|
||||
|
|
@ -210,7 +210,8 @@ abstract class ProtocolInfo9{
|
|||
const CONTAINER_SET_DATA_PACKET = 0xb1;
|
||||
const CONTAINER_SET_CONTENT_PACKET = 0xb2;
|
||||
const CONTAINER_ACK_PACKET = 0xb3;
|
||||
const CHAT_PACKET = 0xb4;//12 change
|
||||
const CHAT_PACKET = 0xb4;
|
||||
const SIGN_UPDATE_PACKET = 0xb5;
|
||||
const ADVENTURE_SETTINGS_PACKET = 0xb6;
|
||||
const ENTITY_DATA_PACKET = 0xb7;
|
||||
const PLAYER_INPUT_PACKET = 0xb9;
|
||||
|
|
@ -278,7 +279,8 @@ abstract class ProtocolInfo8{
|
|||
const CONTAINER_SET_DATA_PACKET = 0xae;
|
||||
const CONTAINER_SET_CONTENT_PACKET = 0xaf;
|
||||
const CONTAINER_ACK_PACKET = 0xb;
|
||||
const CHAT_PACKET = 0xb1;//12 change
|
||||
const CHAT_PACKET = 0xb1;
|
||||
const SIGN_UPDATE_PACKET = 0xb2;
|
||||
const ADVENTURE_SETTINGS_PACKET = 0xb3;
|
||||
const ENTITY_DATA_PACKET = 0xb2;
|
||||
const PLAYER_INPUT_PACKET = 0xb9;
|
||||
|
|
@ -346,6 +348,7 @@ abstract class ProtocolInfo6{
|
|||
const CONTAINER_SET_CONTENT_PACKET = 0xad;
|
||||
const CONTAINER_ACK_PACKET = 0xae;
|
||||
const CHAT_PACKET = 0xaf;
|
||||
const SIGN_UPDATE_PACKET = 0xb0;
|
||||
//const ADVENTURE_SETTINGS_PACKET = 0xb3;
|
||||
//const ENTITY_DATA_PACKET = 0xb2;
|
||||
//const PLAYER_INPUT_PACKET = 0xb9;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
|
|
|||
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