mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-21 13:04:40 +00:00
commit
7f3460190b
@ -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{
|
||||
|
@ -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{
|
||||
|
@ -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{
|
||||
|
Loading…
x
Reference in New Issue
Block a user