mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-11 00:09:39 +00:00
EducationSettingsPacket: added encode & decode
This commit is contained in:
parent
f37ea6a203
commit
85521f5e7a
@ -30,12 +30,34 @@ use pocketmine\network\mcpe\NetworkSession;
|
||||
class EducationSettingsPacket extends DataPacket{
|
||||
public const NETWORK_ID = ProtocolInfo::EDUCATION_SETTINGS_PACKET;
|
||||
|
||||
/** @var string */
|
||||
private $codeBuilderDefaultUri;
|
||||
/** @var bool */
|
||||
private $hasQuiz;
|
||||
|
||||
public static function create(string $codeBuilderDefaultUri, bool $hasQuiz) : self{
|
||||
$result = new self;
|
||||
$result->codeBuilderDefaultUri = $codeBuilderDefaultUri;
|
||||
$result->hasQuiz = $hasQuiz;
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function getCodeBuilderDefaultUri() : string{
|
||||
return $this->codeBuilderDefaultUri;
|
||||
}
|
||||
|
||||
public function getHasQuiz() : bool{
|
||||
return $this->hasQuiz;
|
||||
}
|
||||
|
||||
protected function decodePayload() : void{
|
||||
//TODO
|
||||
$this->codeBuilderDefaultUri = $this->getString();
|
||||
$this->hasQuiz = $this->getBool();
|
||||
}
|
||||
|
||||
protected function encodePayload() : void{
|
||||
//TODO
|
||||
$this->putString($this->codeBuilderDefaultUri);
|
||||
$this->putBool($this->hasQuiz);
|
||||
}
|
||||
|
||||
public function handle(NetworkSession $handler) : bool{
|
||||
|
Loading…
x
Reference in New Issue
Block a user