mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Cleaned up muddled varint/varlong mess, added separate methods for entity unique and runtime ids, moved some MCPE-protocol-specific methods out of BinaryStream
This commit is contained in:
@ -28,25 +28,13 @@ use pocketmine\network\mcpe\NetworkSession;
|
||||
class CommandStepPacket extends DataPacket{
|
||||
const NETWORK_ID = ProtocolInfo::COMMAND_STEP_PACKET;
|
||||
|
||||
/**
|
||||
* unknown (string)
|
||||
* unknown (string)
|
||||
* unknown (uvarint)
|
||||
* unknown (uvarint)
|
||||
* unknown (bool)
|
||||
* unknown (uvarint64)
|
||||
* unknown (string)
|
||||
* unknown (string)
|
||||
* https://gist.github.com/dktapps/8285b93af4ca38e0104bfeb9a6c87afd
|
||||
*/
|
||||
|
||||
public $command;
|
||||
public $overload;
|
||||
public $uvarint1;
|
||||
public $uvarint2;
|
||||
public $bool;
|
||||
public $uvarint64;
|
||||
public $args; //JSON formatted command arguments
|
||||
public $args;
|
||||
public $string4;
|
||||
|
||||
public function decode(){
|
||||
@ -55,12 +43,11 @@ class CommandStepPacket extends DataPacket{
|
||||
$this->uvarint1 = $this->getUnsignedVarInt();
|
||||
$this->uvarint2 = $this->getUnsignedVarInt();
|
||||
$this->bool = (bool) $this->getByte();
|
||||
$this->uvarint64 = $this->getUnsignedVarInt(); //TODO: varint64
|
||||
$this->uvarint64 = $this->getUnsignedVarLong();
|
||||
$this->args = json_decode($this->getString());
|
||||
$this->string4 = $this->getString();
|
||||
while(!$this->feof()){
|
||||
$this->getByte(); //prevent assertion errors. TODO: find out why there are always 3 extra bytes at the end of this packet.
|
||||
}
|
||||
|
||||
$this->get(true); //TODO: read command origin data
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
|
Reference in New Issue
Block a user