Initial working slash commands on 0.16. TODO: new API

This commit is contained in:
Dylan K. Taylor
2016-10-06 11:21:48 +01:00
parent b198f287db
commit 018897062c
3 changed files with 93 additions and 2 deletions

View File

@ -38,8 +38,27 @@ class CommandStepPacket extends DataPacket{
* 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 $string4;
public function decode(){
//TODO
$this->command = $this->getString();
$this->overload = $this->getString();
$this->uvarint1 = $this->getUnsignedVarInt();
$this->uvarint2 = $this->getUnsignedVarInt();
$this->bool = (bool) $this->getByte();
$this->uvarint64 = $this->getUnsignedVarInt(); //TODO: varint64
$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.
}
}
public function encode(){