Added encode/decode for ModalFormResponsePacket

This commit is contained in:
Dylan K. Taylor 2017-08-12 19:33:16 +01:00
parent 5a4fbc6f5a
commit 02cbf800d0

View File

@ -30,12 +30,19 @@ use pocketmine\network\mcpe\NetworkSession;
class ModalFormResponsePacket extends DataPacket{
const NETWORK_ID = ProtocolInfo::MODAL_FORM_RESPONSE_PACKET;
/** @var int */
public $formId;
/** @var string */
public $formData; //json
protected function decodePayload(){
//TODO
$this->formId = $this->getUnsignedVarInt();
$this->formData = $this->getString();
}
protected function encodePayload(){
//TODO
$this->putUnsignedVarInt($this->formId);
$this->putString($this->formData);
}
public function handle(NetworkSession $session) : bool{