InGamePacketHandler: Ignore LevelSoundEventPacket completely

This commit is contained in:
Dylan K. Taylor 2020-10-06 18:26:57 +01:00
parent 531c6344fe
commit 69cad3e694
2 changed files with 1 additions and 18 deletions

View File

@ -817,23 +817,6 @@ class InGamePacketHandler extends PacketHandler{
return false; //TODO return false; //TODO
} }
public function handleLevelSoundEvent(LevelSoundEventPacket $packet) : bool{
//TODO: we want to block out this packet completely, but we don't yet know the full scope of sounds that the client sends us from here
switch($packet->sound){
case LevelSoundEventPacket::SOUND_ATTACK:
case LevelSoundEventPacket::SOUND_ATTACK_NODAMAGE:
case LevelSoundEventPacket::SOUND_ATTACK_STRONG: //TODO: reassess this, seems like the regular attack is never used ??
case LevelSoundEventPacket::SOUND_HIT: //block punch, maybe entity attack too?
case LevelSoundEventPacket::SOUND_LAND:
case LevelSoundEventPacket::SOUND_FALL:
case LevelSoundEventPacket::SOUND_FALL_SMALL:
case LevelSoundEventPacket::SOUND_FALL_BIG:
return true;
}
$this->player->getWorld()->broadcastPacketToViewers($this->player->getPosition(), $packet);
return true;
}
public function handleNetworkStackLatency(NetworkStackLatencyPacket $packet) : bool{ public function handleNetworkStackLatency(NetworkStackLatencyPacket $packet) : bool{
return true; //TODO: implement this properly - this is here to silence debug spam from MCPE dev builds return true; //TODO: implement this properly - this is here to silence debug spam from MCPE dev builds
} }

View File

@ -28,7 +28,7 @@ namespace pocketmine\network\mcpe\protocol;
use pocketmine\math\Vector3; use pocketmine\math\Vector3;
use pocketmine\network\mcpe\protocol\serializer\PacketSerializer; use pocketmine\network\mcpe\protocol\serializer\PacketSerializer;
class LevelSoundEventPacket extends DataPacket implements ClientboundPacket, ServerboundPacket{ class LevelSoundEventPacket extends DataPacket implements ClientboundPacket, GarbageServerboundPacket{
public const NETWORK_ID = ProtocolInfo::LEVEL_SOUND_EVENT_PACKET; public const NETWORK_ID = ProtocolInfo::LEVEL_SOUND_EVENT_PACKET;
public const SOUND_ITEM_USE_ON = 0; public const SOUND_ITEM_USE_ON = 0;