mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +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 */
|
||||
public $forceMoveSync = false;
|
||||
|
||||
protected ?string $lastRequestedFullSkinId = null;
|
||||
|
||||
public function __construct(
|
||||
private Player $player,
|
||||
private NetworkSession $session,
|
||||
@ -745,6 +747,14 @@ class InGamePacketHandler extends PacketHandler{
|
||||
}
|
||||
|
||||
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");
|
||||
try{
|
||||
$skin = SkinAdapterSingleton::get()->fromSkinData($packet->skin);
|
||||
|
Loading…
x
Reference in New Issue
Block a user