Moaaaar resource packets

This commit is contained in:
Dylan K. Taylor
2017-03-02 14:42:38 +00:00
parent 425686755b
commit 55598ba703
6 changed files with 194 additions and 3 deletions

View File

@ -0,0 +1,60 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\NetworkSession;
class ResourcePackDataInfoPacket extends DataPacket{
const NETWORK_ID = ProtocolInfo::RESOURCE_PACK_DATA_INFO_PACKET;
public $packId;
public $int1;
public $int2;
public $packSize;
public $unknown;
public function decode(){
$this->packId = $this->getString();
$this->int1 = $this->getLInt();
$this->int2 = $this->getLInt();
$this->packSize = $this->getLLong();
$this->unknown = $this->getString();
}
public function encode(){
$this->reset();
$this->putString($this->packId);
$this->putLInt($this->int1);
$this->putLInt($this->int2);
$this->putLLong($this->packSize);
$this->putString($this->unknown);
}
public function handle(NetworkSession $session) : bool{
$session->handleResourcePackDataInfo($this);
}
}