Protocol changes for 1.2.10

This commit is contained in:
Dylan K. Taylor
2018-01-25 14:42:27 +00:00
parent a3fa8adf4a
commit fc795b80ae
12 changed files with 118 additions and 30 deletions

View File

@@ -38,10 +38,16 @@ class AddPlayerPacket extends DataPacket{
public $uuid;
/** @var string */
public $username;
/** @var string */
public $thirdPartyName = "";
/** @var int */
public $platform = 0;
/** @var int|null */
public $entityUniqueId = null; //TODO
/** @var int */
public $entityRuntimeId;
/** @var string */
public $string1 = "";
/** @var Vector3 */
public $position;
/** @var Vector3|null */
@@ -72,8 +78,11 @@ class AddPlayerPacket extends DataPacket{
protected function decodePayload(){
$this->uuid = $this->getUUID();
$this->username = $this->getString();
$this->thirdPartyName = $this->getString();
$this->platform = $this->getVarInt();
$this->entityUniqueId = $this->getEntityUniqueId();
$this->entityRuntimeId = $this->getEntityRuntimeId();
$this->string1 = $this->getString();
$this->position = $this->getVector3();
$this->motion = $this->getVector3();
$this->pitch = $this->getLFloat();
@@ -99,8 +108,11 @@ class AddPlayerPacket extends DataPacket{
protected function encodePayload(){
$this->putUUID($this->uuid);
$this->putString($this->username);
$this->putString($this->thirdPartyName);
$this->putVarInt($this->platform);
$this->putEntityUniqueId($this->entityUniqueId ?? $this->entityRuntimeId);
$this->putEntityRuntimeId($this->entityRuntimeId);
$this->putString($this->string1);
$this->putVector3($this->position);
$this->putVector3Nullable($this->motion);
$this->putLFloat($this->pitch);