Rename more unknown things in the protocol

This commit is contained in:
Dylan K. Taylor 2018-04-07 11:34:59 +01:00
parent 5b532fdcf5
commit db5890fddb
4 changed files with 13 additions and 13 deletions

View File

@ -33,14 +33,14 @@ class RiderJumpPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::RIDER_JUMP_PACKET; public const NETWORK_ID = ProtocolInfo::RIDER_JUMP_PACKET;
/** @var int */ /** @var int */
public $unknown; public $jumpStrength; //percentage
protected function decodePayload(){ protected function decodePayload(){
$this->unknown = $this->getVarInt(); $this->jumpStrength = $this->getVarInt();
} }
protected function encodePayload(){ protected function encodePayload(){
$this->putVarInt($this->unknown); $this->putVarInt($this->jumpStrength);
} }
public function handle(NetworkSession $session) : bool{ public function handle(NetworkSession $session) : bool{

View File

@ -33,16 +33,16 @@ class ShowStoreOfferPacket extends DataPacket{
/** @var string */ /** @var string */
public $offerId; public $offerId;
/** @var bool */ /** @var bool */
public $unknownBool; public $showAll;
protected function decodePayload(){ protected function decodePayload(){
$this->offerId = $this->getString(); $this->offerId = $this->getString();
$this->unknownBool = $this->getBool(); $this->showAll = $this->getBool();
} }
protected function encodePayload(){ protected function encodePayload(){
$this->putString($this->offerId); $this->putString($this->offerId);
$this->putBool($this->unknownBool); $this->putBool($this->showAll);
} }
public function handle(NetworkSession $session) : bool{ public function handle(NetworkSession $session) : bool{

View File

@ -112,9 +112,9 @@ class StartGamePacket extends DataPacket{
/** @var string */ /** @var string */
public $premiumWorldTemplateId = ""; public $premiumWorldTemplateId = "";
/** @var bool */ /** @var bool */
public $unknownBool = false; public $isTrial = false;
/** @var int */ /** @var int */
public $currentTick = 0; public $currentTick = 0; //only used if isTrial is true
/** @var int */ /** @var int */
public $enchantmentSeed = 0; public $enchantmentSeed = 0;
@ -159,7 +159,7 @@ class StartGamePacket extends DataPacket{
$this->levelId = $this->getString(); $this->levelId = $this->getString();
$this->worldName = $this->getString(); $this->worldName = $this->getString();
$this->premiumWorldTemplateId = $this->getString(); $this->premiumWorldTemplateId = $this->getString();
$this->unknownBool = $this->getBool(); $this->isTrial = $this->getBool();
$this->currentTick = $this->getLLong(); $this->currentTick = $this->getLLong();
$this->enchantmentSeed = $this->getVarInt(); $this->enchantmentSeed = $this->getVarInt();
@ -206,7 +206,7 @@ class StartGamePacket extends DataPacket{
$this->putString($this->levelId); $this->putString($this->levelId);
$this->putString($this->worldName); $this->putString($this->worldName);
$this->putString($this->premiumWorldTemplateId); $this->putString($this->premiumWorldTemplateId);
$this->putBool($this->unknownBool); $this->putBool($this->isTrial);
$this->putLLong($this->currentTick); $this->putLLong($this->currentTick);
$this->putVarInt($this->enchantmentSeed); $this->putVarInt($this->enchantmentSeed);

View File

@ -82,7 +82,7 @@ class NetworkInventoryAction{
/** @var int */ /** @var int */
public $windowId = ContainerIds::NONE; public $windowId = ContainerIds::NONE;
/** @var int */ /** @var int */
public $unknown = 0; public $sourceFlags = 0;
/** @var int */ /** @var int */
public $inventorySlot; public $inventorySlot;
/** @var Item */ /** @var Item */
@ -102,7 +102,7 @@ class NetworkInventoryAction{
$this->windowId = $packet->getVarInt(); $this->windowId = $packet->getVarInt();
break; break;
case self::SOURCE_WORLD: case self::SOURCE_WORLD:
$this->unknown = $packet->getUnsignedVarInt(); $this->sourceFlags = $packet->getUnsignedVarInt();
break; break;
case self::SOURCE_CREATIVE: case self::SOURCE_CREATIVE:
break; break;
@ -137,7 +137,7 @@ class NetworkInventoryAction{
$packet->putVarInt($this->windowId); $packet->putVarInt($this->windowId);
break; break;
case self::SOURCE_WORLD: case self::SOURCE_WORLD:
$packet->putUnsignedVarInt($this->unknown); $packet->putUnsignedVarInt($this->sourceFlags);
break; break;
case self::SOURCE_CREATIVE: case self::SOURCE_CREATIVE:
break; break;