updates for 1.2.0.11

This commit is contained in:
Dylan K. Taylor 2017-08-10 11:15:23 +01:00
parent bb4808c23e
commit 9bae4d8ef6
4 changed files with 28 additions and 4 deletions

View File

@ -53,13 +53,16 @@ class AddPlayerPacket extends DataPacket{
public $item; public $item;
public $metadata = []; public $metadata = [];
//TODO //TODO: adventure settings stuff
public $uvarint1 = 0; public $uvarint1 = 0;
public $uvarint2 = 0; public $uvarint2 = 0;
public $uvarint3 = 0; public $uvarint3 = 0;
public $uvarint4 = 0; public $uvarint4 = 0;
public $long1 = 0; public $long1 = 0;
public $links = [];
protected function decodePayload(){ protected function decodePayload(){
$this->uuid = $this->getUUID(); $this->uuid = $this->getUUID();
$this->username = $this->getString(); $this->username = $this->getString();
@ -77,7 +80,13 @@ class AddPlayerPacket extends DataPacket{
$this->uvarint2 = $this->getUnsignedVarInt(); $this->uvarint2 = $this->getUnsignedVarInt();
$this->uvarint3 = $this->getUnsignedVarInt(); $this->uvarint3 = $this->getUnsignedVarInt();
$this->uvarint4 = $this->getUnsignedVarInt(); $this->uvarint4 = $this->getUnsignedVarInt();
$this->long1 = $this->getLLong(); $this->long1 = $this->getLLong();
$linkCount = $this->getUnsignedVarInt();
for($i = 0; $i < $linkCount; ++$i){
$this->links[$i] = $this->getEntityLink();
}
} }
protected function encodePayload(){ protected function encodePayload(){
@ -97,7 +106,13 @@ class AddPlayerPacket extends DataPacket{
$this->putUnsignedVarInt($this->uvarint2); $this->putUnsignedVarInt($this->uvarint2);
$this->putUnsignedVarInt($this->uvarint3); $this->putUnsignedVarInt($this->uvarint3);
$this->putUnsignedVarInt($this->uvarint4); $this->putUnsignedVarInt($this->uvarint4);
$this->putLLong($this->long1); $this->putLLong($this->long1);
$this->putUnsignedVarInt(count($this->links));
foreach($this->links as $link){
$this->putEntityLink($link);
}
} }
public function handle(NetworkSession $session) : bool{ public function handle(NetworkSession $session) : bool{

View File

@ -39,15 +39,15 @@ interface ProtocolInfo{
/** /**
* Actual Minecraft: PE protocol version * Actual Minecraft: PE protocol version
*/ */
const CURRENT_PROTOCOL = 131; const CURRENT_PROTOCOL = 132;
/** /**
* Current Minecraft PE version reported by the server. This is usually the earliest currently supported version. * Current Minecraft PE version reported by the server. This is usually the earliest currently supported version.
*/ */
const MINECRAFT_VERSION = 'v1.2.0.7 beta'; const MINECRAFT_VERSION = 'v1.2.0.11 beta';
/** /**
* Version number sent to clients in ping responses. * Version number sent to clients in ping responses.
*/ */
const MINECRAFT_VERSION_NETWORK = '1.2.0.7'; const MINECRAFT_VERSION_NETWORK = '1.2.0.11';
const LOGIN_PACKET = 0x01; const LOGIN_PACKET = 0x01;
const PLAY_STATUS_PACKET = 0x02; const PLAY_STATUS_PACKET = 0x02;

View File

@ -31,13 +31,19 @@ class ShowStoreOfferPacket extends DataPacket{
const NETWORK_ID = ProtocolInfo::SHOW_STORE_OFFER_PACKET; const NETWORK_ID = ProtocolInfo::SHOW_STORE_OFFER_PACKET;
public $offerId; public $offerId;
public $unknownBool;
public $unknownString;
protected function decodePayload(){ protected function decodePayload(){
$this->offerId = $this->getString(); $this->offerId = $this->getString();
$this->unknownBool = $this->getBool();
$this->unknownString = $this->getString();
} }
protected function encodePayload(){ protected function encodePayload(){
$this->putString($this->offerId); $this->putString($this->offerId);
$this->putBool($this->unknownBool);
$this->putString($this->unknownString);
} }
public function handle(NetworkSession $session) : bool{ public function handle(NetworkSession $session) : bool{

View File

@ -63,6 +63,7 @@ class StartGamePacket extends DataPacket{
public $isTexturePacksRequired = true; public $isTexturePacksRequired = true;
public $gameRules = []; //TODO: implement this public $gameRules = []; //TODO: implement this
public $hasBonusChestEnabled = false; public $hasBonusChestEnabled = false;
public $hasStartWithMapEnabled = false;
public $hasTrustPlayersEnabled = false; public $hasTrustPlayersEnabled = false;
public $defaultPlayerPermission = PlayerPermissions::MEMBER; //TODO public $defaultPlayerPermission = PlayerPermissions::MEMBER; //TODO
public $xboxLiveBroadcastMode = 0; //TODO: find values public $xboxLiveBroadcastMode = 0; //TODO: find values
@ -104,6 +105,7 @@ class StartGamePacket extends DataPacket{
$this->isTexturePacksRequired = $this->getBool(); $this->isTexturePacksRequired = $this->getBool();
$this->gameRules = $this->getGameRules(); $this->gameRules = $this->getGameRules();
$this->hasBonusChestEnabled = $this->getBool(); $this->hasBonusChestEnabled = $this->getBool();
$this->hasStartWithMapEnabled = $this->getBool();
$this->hasTrustPlayersEnabled = $this->getBool(); $this->hasTrustPlayersEnabled = $this->getBool();
$this->defaultPlayerPermission = $this->getVarInt(); $this->defaultPlayerPermission = $this->getVarInt();
$this->xboxLiveBroadcastMode = $this->getVarInt(); $this->xboxLiveBroadcastMode = $this->getVarInt();
@ -146,6 +148,7 @@ class StartGamePacket extends DataPacket{
$this->putBool($this->isTexturePacksRequired); $this->putBool($this->isTexturePacksRequired);
$this->putGameRules($this->gameRules); $this->putGameRules($this->gameRules);
$this->putBool($this->hasBonusChestEnabled); $this->putBool($this->hasBonusChestEnabled);
$this->putBool($this->hasStartWithMapEnabled);
$this->putBool($this->hasTrustPlayersEnabled); $this->putBool($this->hasTrustPlayersEnabled);
$this->putVarInt($this->defaultPlayerPermission); $this->putVarInt($this->defaultPlayerPermission);
$this->putVarInt($this->xboxLiveBroadcastMode); $this->putVarInt($this->xboxLiveBroadcastMode);