Protocol changes for 1.5.0.0

this feels so strange to type... can we ditch the versioning system already?
This commit is contained in:
Dylan K. Taylor 2018-04-26 10:06:56 +01:00
parent 68494f1c0d
commit eb28622823
3 changed files with 23 additions and 3 deletions

View File

@ -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{

View File

@ -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;

View File

@ -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);