Merge pull request #5 from dktapps/drew-1.13

more 1.13
This commit is contained in:
Stephen 2019-11-12 14:19:31 -05:00 committed by GitHub
commit 7f3460190b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 5 deletions

View File

@ -114,14 +114,20 @@ class NetworkBinaryStream extends BinaryStream{
$this->putLInt($animation->getType());
$this->putLFloat($animation->getFrames());
}
$this->putSkinImage(new SkinImage(0, 0, $skin->getCapeData()));
if($skin->getCapeData() !== ""){
$this->putSkinImage(new SkinImage(32, 64, $skin->getCapeData()));
}else{
$this->putSkinImage(new SkinImage(0, 0, ""));
}
$this->putString($skin->getGeometryData());
$this->putString(""); //animation data
$this->putBool(false); //isPremium
$this->putBool(false); //isPersona
$this->putBool(false); //isCapeOnClassic
$this->putString(""); //capeId
$this->putString(""); //fullskinId
//this has to be unique or the client will do stupid things
$this->putString(UUID::fromRandom()->toString()); //full skin ID
}
private function getSkinImage() : SkinImage{

View File

@ -74,6 +74,8 @@ class AddPlayerPacket extends DataPacket{
/** @var string */
public $deviceId = ""; //TODO: fill player's device ID (???)
/** @var int */
public $buildPlatform = -1;
protected function decodePayload(){
$this->uuid = $this->getUUID();
@ -103,6 +105,7 @@ class AddPlayerPacket extends DataPacket{
}
$this->deviceId = $this->getString();
$this->buildPlatform = $this->getLInt();
}
protected function encodePayload(){
@ -133,6 +136,7 @@ class AddPlayerPacket extends DataPacket{
}
$this->putString($this->deviceId);
$this->putLInt($this->buildPlatform);
}
public function handle(NetworkSession $session) : bool{

View File

@ -27,15 +27,32 @@ namespace pocketmine\network\mcpe\protocol;
use pocketmine\network\mcpe\NetworkSession;
class MultiplayerSettingsPacket extends DataPacket{
class MultiplayerSettingsPacket extends DataPacket/* implements ServerboundPacket*/{ //TODO: this might be clientbound too, but unsure
public const NETWORK_ID = ProtocolInfo::MULTIPLAYER_SETTINGS_PACKET;
public const ACTION_ENABLE_MULTIPLAYER = 0;
public const ACTION_DISABLE_MULTIPLAYER = 1;
public const ACTION_REFRESH_JOIN_CODE = 2;
/** @var int */
private $action;
public static function create(int $action) : self{
$result = new self;
$result->action = $action;
return $result;
}
public function getAction() : int{
return $this->action;
}
protected function decodePayload() : void{
//TODO
$this->action = $this->getVarInt();
}
protected function encodePayload() : void{
//TODO
$this->putVarInt($this->action);
}
public function handle(NetworkSession $handler) : bool{