From eb28622823eb05cae5eb443bc81d1dcbf6164676 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Thu, 26 Apr 2018 10:06:56 +0100 Subject: [PATCH] Protocol changes for 1.5.0.0 this feels so strange to type... can we ditch the versioning system already? --- .../network/mcpe/protocol/PlayerSkinPacket.php | 4 ++++ .../network/mcpe/protocol/ProtocolInfo.php | 6 +++--- .../network/mcpe/protocol/StartGamePacket.php | 16 ++++++++++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/pocketmine/network/mcpe/protocol/PlayerSkinPacket.php b/src/pocketmine/network/mcpe/protocol/PlayerSkinPacket.php index 2fa531419..c029a1a21 100644 --- a/src/pocketmine/network/mcpe/protocol/PlayerSkinPacket.php +++ b/src/pocketmine/network/mcpe/protocol/PlayerSkinPacket.php @@ -40,6 +40,8 @@ class PlayerSkinPacket extends DataPacket{ public $newSkinName = ""; /** @var Skin */ public $skin; + /** @var bool */ + public $premium = false; protected function decodePayload(){ @@ -52,6 +54,7 @@ class PlayerSkinPacket extends DataPacket{ $capeData = $this->getString(); $geometryModel = $this->getString(); $geometryData = $this->getString(); + $this->premium = $this->getBool(); $this->skin = new Skin($skinId, $skinData, $capeData, $geometryModel, $geometryData); } @@ -66,6 +69,7 @@ class PlayerSkinPacket extends DataPacket{ $this->putString($this->skin->getCapeData()); $this->putString($this->skin->getGeometryName()); $this->putString($this->skin->getGeometryData()); + $this->putBool($this->premium); } public function handle(NetworkSession $session) : bool{ diff --git a/src/pocketmine/network/mcpe/protocol/ProtocolInfo.php b/src/pocketmine/network/mcpe/protocol/ProtocolInfo.php index 763ab2734..3dc7e9164 100644 --- a/src/pocketmine/network/mcpe/protocol/ProtocolInfo.php +++ b/src/pocketmine/network/mcpe/protocol/ProtocolInfo.php @@ -39,15 +39,15 @@ interface ProtocolInfo{ /** * Actual Minecraft: PE protocol version */ - public const CURRENT_PROTOCOL = 260; + public const CURRENT_PROTOCOL = 270; /** * Current Minecraft PE version reported by the server. This is usually the earliest currently supported version. */ - public const MINECRAFT_VERSION = 'v1.2.20.1 beta'; + public const MINECRAFT_VERSION = 'v1.5.0.0 beta'; /** * Version number sent to clients in ping responses. */ - public const MINECRAFT_VERSION_NETWORK = '1.2.20.1'; + public const MINECRAFT_VERSION_NETWORK = '1.5.0.0'; public const LOGIN_PACKET = 0x01; public const PLAY_STATUS_PACKET = 0x02; diff --git a/src/pocketmine/network/mcpe/protocol/StartGamePacket.php b/src/pocketmine/network/mcpe/protocol/StartGamePacket.php index 95d545264..c7df1520d 100644 --- a/src/pocketmine/network/mcpe/protocol/StartGamePacket.php +++ b/src/pocketmine/network/mcpe/protocol/StartGamePacket.php @@ -70,6 +70,8 @@ class StartGamePacket extends DataPacket{ public $time = -1; /** @var bool */ public $eduMode = false; + /** @var bool */ + public $hasEduFeaturesEnabled = false; /** @var float */ public $rainLevel; /** @var float */ @@ -104,6 +106,12 @@ class StartGamePacket extends DataPacket{ public $platformBroadcastMode = 0; /** @var bool */ public $xboxLiveBroadcastIntent = false; + /** @var bool */ + public $hasLockedBehaviorPack = false; + /** @var bool */ + public $hasLockedResourcePack = false; + /** @var bool */ + public $isFromLockedWorldTemplate = false; /** @var string */ public $levelId = ""; //base64 string, usually the same as world folder name in vanilla @@ -138,6 +146,7 @@ class StartGamePacket extends DataPacket{ $this->hasAchievementsDisabled = $this->getBool(); $this->time = $this->getVarInt(); $this->eduMode = $this->getBool(); + $this->hasEduFeaturesEnabled = $this->getBool(); $this->rainLevel = $this->getLFloat(); $this->lightningLevel = $this->getLFloat(); $this->isMultiplayerGame = $this->getBool(); @@ -155,6 +164,9 @@ class StartGamePacket extends DataPacket{ $this->hasPlatformBroadcast = $this->getBool(); $this->platformBroadcastMode = $this->getVarInt(); $this->xboxLiveBroadcastIntent = $this->getBool(); + $this->hasLockedBehaviorPack = $this->getBool(); + $this->hasLockedResourcePack = $this->getBool(); + $this->isFromLockedWorldTemplate = $this->getBool(); $this->levelId = $this->getString(); $this->worldName = $this->getString(); @@ -185,6 +197,7 @@ class StartGamePacket extends DataPacket{ $this->putBool($this->hasAchievementsDisabled); $this->putVarInt($this->time); $this->putBool($this->eduMode); + $this->putBool($this->hasEduFeaturesEnabled); $this->putLFloat($this->rainLevel); $this->putLFloat($this->lightningLevel); $this->putBool($this->isMultiplayerGame); @@ -202,6 +215,9 @@ class StartGamePacket extends DataPacket{ $this->putBool($this->hasPlatformBroadcast); $this->putVarInt($this->platformBroadcastMode); $this->putBool($this->xboxLiveBroadcastIntent); + $this->putBool($this->hasLockedBehaviorPack); + $this->putBool($this->hasLockedResourcePack); + $this->putBool($this->isFromLockedWorldTemplate); $this->putString($this->levelId); $this->putString($this->worldName);