mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Clean up duplicated skin entries
This commit is contained in:
@ -62,28 +62,7 @@ class PlayerListPacket extends DataPacket{
|
||||
$entry->xboxUserId = $this->getString();
|
||||
$entry->platformChatId = $this->getString();
|
||||
$entry->buildPlatform = $this->getLInt();
|
||||
|
||||
$skinId = $this->getString();
|
||||
$skinResourcePatch = $this->getString();
|
||||
$skinData = $this->getImage();
|
||||
$animationCount = $this->getLInt();
|
||||
$animations = [];
|
||||
for($i = 0; $i < $animationCount; ++$i){
|
||||
$animations[] = new SkinAnimation($this->getImage(), $this->getLInt(), $this->getLFloat());
|
||||
}
|
||||
$capeData = $this->getImage();
|
||||
$geometryData = $this->getString();
|
||||
$animationData = $this->getString();
|
||||
$premium = $this->getBool();
|
||||
$persona = $this->getBool();
|
||||
$capeOnClassic = $this->getBool();
|
||||
$capeId = $this->getString();
|
||||
$fullSkinId = $this->getString();
|
||||
|
||||
$entry->skin = new Skin(
|
||||
$skinId, $skinResourcePatch, $skinData, $animations, $capeData, $geometryData, $animationData, $premium, $persona, $capeOnClassic, $capeId
|
||||
);
|
||||
|
||||
$entry->skin = $this->getSkin();
|
||||
$entry->isTeacher = $this->getBool();
|
||||
$entry->isHost = $this->getBool();
|
||||
}else{
|
||||
@ -105,25 +84,7 @@ class PlayerListPacket extends DataPacket{
|
||||
$this->putString($entry->xboxUserId);
|
||||
$this->putString($entry->platformChatId);
|
||||
$this->putLInt($entry->buildPlatform);
|
||||
|
||||
$this->putString($entry->skin->getSkinId());
|
||||
$this->putString($entry->skin->getSkinResourcePatch());
|
||||
$this->putImage($entry->skin->getSkinData());
|
||||
$this->putLInt(count($entry->skin->getAnimations()));
|
||||
foreach($entry->skin->getAnimations() as $animation){
|
||||
$this->putImage($animation->getImage());
|
||||
$this->putLInt($animation->getType());
|
||||
$this->putLFloat($animation->getFrames());
|
||||
}
|
||||
$this->putImage($entry->skin->getCapeData());
|
||||
$this->putString($entry->skin->getGeometryData());
|
||||
$this->putString($entry->skin->getAnimationData());
|
||||
$this->putBool($entry->skin->getPremium());
|
||||
$this->putBool($entry->skin->getPersona());
|
||||
$this->putBool($entry->skin->getCapeOnClassic());
|
||||
$this->putString($entry->skin->getCapeId());
|
||||
$this->putString($entry->skin->getFullSkinId());
|
||||
|
||||
$this->putSkin($entry->skin);
|
||||
$this->putBool($entry->isTeacher);
|
||||
$this->putBool($entry->isHost);
|
||||
}else{
|
||||
|
@ -41,49 +41,12 @@ class PlayerSkinPacket extends DataPacket{
|
||||
|
||||
protected function decodePayload(){
|
||||
$this->uuid = $this->getUUID();
|
||||
|
||||
$skinId = $this->getString();
|
||||
$skinResourcePatch = $this->getString();
|
||||
$skinData = $this->getImage();
|
||||
$animationCount = $this->getLInt();
|
||||
$animations = [];
|
||||
for($i = 0; $i < $animationCount; ++$i){
|
||||
$animations[] = new SkinAnimation($this->getImage(), $this->getLInt(), $this->getLFloat());
|
||||
}
|
||||
$capeData = $this->getImage();
|
||||
$geometryData = $this->getString();
|
||||
$animationData = $this->getString();
|
||||
$premium = $this->getBool();
|
||||
$persona = $this->getBool();
|
||||
$capeOnClassic = $this->getBool();
|
||||
$capeId = $this->getString();
|
||||
$fullSkinId = $this->getString();
|
||||
|
||||
$this->skin = new Skin(
|
||||
$skinId, $skinResourcePatch, $skinData, $animations, $capeData, $geometryData, $animationData, $premium, $persona, $capeOnClassic, $capeId
|
||||
);
|
||||
$this->skin = $this->getSkin();
|
||||
}
|
||||
|
||||
protected function encodePayload(){
|
||||
$this->putUUID($this->uuid);
|
||||
|
||||
$this->putString($this->skin->getSkinId());
|
||||
$this->putString($this->skin->getSkinResourcePatch());
|
||||
$this->putImage($this->skin->getSkinData());
|
||||
$this->putLInt(count($this->skin->getAnimations()));
|
||||
foreach($this->skin->getAnimations() as $animation){
|
||||
$this->putImage($animation->getImage());
|
||||
$this->putLInt($animation->getType());
|
||||
$this->putLFloat($animation->getFrames());
|
||||
}
|
||||
$this->putImage($this->skin->getCapeData());
|
||||
$this->putString($this->skin->getGeometryData());
|
||||
$this->putString($this->skin->getAnimationData());
|
||||
$this->putBool($this->skin->getPremium());
|
||||
$this->putBool($this->skin->getPersona());
|
||||
$this->putBool($this->skin->getCapeOnClassic());
|
||||
$this->putString($this->skin->getCapeId());
|
||||
$this->putString($this->skin->getFullSkinId());
|
||||
$this->putSkin($this->skin);
|
||||
}
|
||||
|
||||
public function handle(NetworkSession $session) : bool{
|
||||
|
Reference in New Issue
Block a user