mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-12 22:45:28 +00:00
InGamePacketHandler: do not process repeated skin change requests for the same full skin ID
this fixes a feedback loop with persona skins in 1.19.60.
This commit is contained in:
parent
40b90bb722
commit
475888b031
@ -149,6 +149,8 @@ class InGamePacketHandler extends PacketHandler{
|
|||||||
/** @var bool */
|
/** @var bool */
|
||||||
public $forceMoveSync = false;
|
public $forceMoveSync = false;
|
||||||
|
|
||||||
|
protected ?string $lastRequestedFullSkinId = null;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private Player $player,
|
private Player $player,
|
||||||
private NetworkSession $session,
|
private NetworkSession $session,
|
||||||
@ -745,6 +747,14 @@ class InGamePacketHandler extends PacketHandler{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function handlePlayerSkin(PlayerSkinPacket $packet) : bool{
|
public function handlePlayerSkin(PlayerSkinPacket $packet) : bool{
|
||||||
|
if($packet->skin->getFullSkinId() === $this->lastRequestedFullSkinId){
|
||||||
|
//TODO: HACK! In 1.19.60, the client sends its skin back to us if we sent it a skin different from the one
|
||||||
|
//it's using. We need to prevent this from causing a feedback loop.
|
||||||
|
$this->session->getLogger()->debug("Refused duplicate skin change request");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
$this->lastRequestedFullSkinId = $packet->skin->getFullSkinId();
|
||||||
|
|
||||||
$this->session->getLogger()->debug("Processing skin change request");
|
$this->session->getLogger()->debug("Processing skin change request");
|
||||||
try{
|
try{
|
||||||
$skin = SkinAdapterSingleton::get()->fromSkinData($packet->skin);
|
$skin = SkinAdapterSingleton::get()->fromSkinData($packet->skin);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user