mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 12:39:43 +00:00
ContainerAckPacket implement
This commit is contained in:
parent
1eceb700c2
commit
a992bb614c
3 changed files with 48 additions and 2 deletions
|
|
@ -57,6 +57,7 @@ class PacketPool{
|
||||||
self::registerPacket(ContainerSetContentPacket::class);
|
self::registerPacket(ContainerSetContentPacket::class);
|
||||||
self::registerPacket(ContainerSetDataPacket::class);
|
self::registerPacket(ContainerSetDataPacket::class);
|
||||||
self::registerPacket(ContainerSetSlotPacket::class);
|
self::registerPacket(ContainerSetSlotPacket::class);
|
||||||
|
self::registerPacket(ContainerAckPacket::class);
|
||||||
|
|
||||||
self::registerPacket(DisconnectPacket::class);
|
self::registerPacket(DisconnectPacket::class);
|
||||||
self::registerPacket(DropItemPacket::class);
|
self::registerPacket(DropItemPacket::class);
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,6 @@ abstract class ProtocolInfo{
|
||||||
|
|
||||||
}
|
}
|
||||||
/*Unused:
|
/*Unused:
|
||||||
* 0xb5
|
|
||||||
* 0x96
|
* 0x96
|
||||||
* 0x17
|
* 0x17
|
||||||
* 0x14
|
* 0x14
|
||||||
|
|
@ -142,7 +141,7 @@ abstract class ProtocolInfo12{
|
||||||
const CONTAINER_SET_SLOT_PACKET = 0xb1;
|
const CONTAINER_SET_SLOT_PACKET = 0xb1;
|
||||||
const CONTAINER_SET_DATA_PACKET = 0xb2;
|
const CONTAINER_SET_DATA_PACKET = 0xb2;
|
||||||
const CONTAINER_SET_CONTENT_PACKET = 0xb3;
|
const CONTAINER_SET_CONTENT_PACKET = 0xb3;
|
||||||
const CONTAINER_ACK_PACKET = 0xb5; //Bruh
|
const CONTAINER_ACK_PACKET = 0xb4;
|
||||||
const CHAT_PACKET = 0xb5;
|
const CHAT_PACKET = 0xb5;
|
||||||
const ADVENTURE_SETTINGS_PACKET = 0xb6;
|
const ADVENTURE_SETTINGS_PACKET = 0xb6;
|
||||||
const ENTITY_DATA_PACKET = 0xb7;
|
const ENTITY_DATA_PACKET = 0xb7;
|
||||||
|
|
|
||||||
46
src/network/protocol/packet/ContainerAckPacket.php
Normal file
46
src/network/protocol/packet/ContainerAckPacket.php
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class ContainerAckPacket extends RakNetDataPacket{
|
||||||
|
public $unknwonubyte1;
|
||||||
|
public $unknownshort;
|
||||||
|
public $write1;
|
||||||
|
public $write0;
|
||||||
|
|
||||||
|
public function pid(){
|
||||||
|
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
|
||||||
|
return ProtocolInfo4::CONTAINER_ACK_PACKET;
|
||||||
|
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
|
||||||
|
return ProtocolInfo5::CONTAINER_ACK_PACKET;
|
||||||
|
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
|
||||||
|
return ProtocolInfo7::CONTAINER_ACK_PACKET;
|
||||||
|
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
|
||||||
|
return ProtocolInfo9::CONTAINER_ACK_PACKET;
|
||||||
|
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||||
|
return ProtocolInfo12::CONTAINER_ACK_PACKET;
|
||||||
|
}
|
||||||
|
return ProtocolInfo::CONTAINER_ACK_PACKET;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function decode(){
|
||||||
|
$this->unknwonubyte1 = $this->getByte();
|
||||||
|
$this->unknownshort = $this->getShort();
|
||||||
|
$this->write1 = $this->get();
|
||||||
|
$this->write0 = $this->get();
|
||||||
|
ConsoleAPI::debug($this->unknwonubyte1);
|
||||||
|
ConsoleAPI::debug($this->unknownshort);
|
||||||
|
ConsoleAPI::debug($this->write1);
|
||||||
|
ConsoleAPI::debug($this->write0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function encode(){
|
||||||
|
$this->putByte($this->unknwonubyte1);
|
||||||
|
$this->putShort($this->unknownshort);
|
||||||
|
$this->put($this->write1);
|
||||||
|
$this->put($this->write0);
|
||||||
|
ConsoleAPI::debug($this->unknwonubyte1);
|
||||||
|
ConsoleAPI::debug($this->unknownshort);
|
||||||
|
ConsoleAPI::debug($this->write1);
|
||||||
|
ConsoleAPI::debug($this->write0);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue