mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-04 17:20:02 +00:00
SkinData: fixed loss of data from packet decode
This commit is contained in:
parent
778814a35e
commit
93597dcd50
@ -100,7 +100,7 @@ class NetworkBinaryStream extends BinaryStream{
|
|||||||
$capeId = $this->getString();
|
$capeId = $this->getString();
|
||||||
$fullSkinId = $this->getString();
|
$fullSkinId = $this->getString();
|
||||||
|
|
||||||
return new SkinData($skinId, $skinResourcePatch, $skinData, $animations, $capeData, $geometryData, $animationData, $premium, $persona, $capeOnClassic, $capeId);
|
return new SkinData($skinId, $skinResourcePatch, $skinData, $animations, $capeData, $geometryData, $animationData, $premium, $persona, $capeOnClassic, $capeId, $fullSkinId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -123,9 +123,7 @@ class NetworkBinaryStream extends BinaryStream{
|
|||||||
$this->putBool($skin->isPersona());
|
$this->putBool($skin->isPersona());
|
||||||
$this->putBool($skin->isPersonaCapeOnClassic());
|
$this->putBool($skin->isPersonaCapeOnClassic());
|
||||||
$this->putString($skin->getCapeId());
|
$this->putString($skin->getCapeId());
|
||||||
|
$this->putString($skin->getFullSkinId());
|
||||||
//this has to be unique or the client will do stupid things
|
|
||||||
$this->putString(UUID::fromRandom()->toString()); //full skin ID
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getSkinImage() : SkinImage{
|
private function getSkinImage() : SkinImage{
|
||||||
|
@ -23,6 +23,8 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\network\mcpe\protocol\types;
|
namespace pocketmine\network\mcpe\protocol\types;
|
||||||
|
|
||||||
|
use pocketmine\utils\UUID;
|
||||||
|
|
||||||
class SkinData{
|
class SkinData{
|
||||||
|
|
||||||
/** @var string */
|
/** @var string */
|
||||||
@ -47,11 +49,13 @@ class SkinData{
|
|||||||
private $personaCapeOnClassic;
|
private $personaCapeOnClassic;
|
||||||
/** @var string */
|
/** @var string */
|
||||||
private $capeId;
|
private $capeId;
|
||||||
|
/** @var string */
|
||||||
|
private $fullSkinId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param SkinAnimation[] $animations
|
* @param SkinAnimation[] $animations
|
||||||
*/
|
*/
|
||||||
public function __construct(string $skinId, string $resourcePatch, SkinImage $skinImage, array $animations = [], SkinImage $capeImage = null, string $geometryData = "", string $animationData = "", bool $premium = false, bool $persona = false, bool $personaCapeOnClassic = false, string $capeId = ""){
|
public function __construct(string $skinId, string $resourcePatch, SkinImage $skinImage, array $animations = [], SkinImage $capeImage = null, string $geometryData = "", string $animationData = "", bool $premium = false, bool $persona = false, bool $personaCapeOnClassic = false, string $capeId = "", ?string $fullSkinId = null){
|
||||||
$this->skinId = $skinId;
|
$this->skinId = $skinId;
|
||||||
$this->resourcePatch = $resourcePatch;
|
$this->resourcePatch = $resourcePatch;
|
||||||
$this->skinImage = $skinImage;
|
$this->skinImage = $skinImage;
|
||||||
@ -63,6 +67,8 @@ class SkinData{
|
|||||||
$this->persona = $persona;
|
$this->persona = $persona;
|
||||||
$this->personaCapeOnClassic = $personaCapeOnClassic;
|
$this->personaCapeOnClassic = $personaCapeOnClassic;
|
||||||
$this->capeId = $capeId;
|
$this->capeId = $capeId;
|
||||||
|
//this has to be unique or the client will do stupid things
|
||||||
|
$this->fullSkinId = $fullSkinId ?? UUID::fromRandom()->toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSkinId() : string{
|
public function getSkinId() : string{
|
||||||
@ -112,4 +118,7 @@ class SkinData{
|
|||||||
return $this->capeId;
|
return $this->capeId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getFullSkinId() : string{
|
||||||
|
return $this->fullSkinId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user