Nix some client-sided sounds, control them from the server

this is a necessary step to knock out the implicit assumption that every player is using the same protocol.
This commit is contained in:
Dylan K. Taylor
2020-05-01 11:52:32 +01:00
parent 6f38031121
commit 1969766b70
6 changed files with 193 additions and 0 deletions

View File

@@ -754,6 +754,14 @@ class InGamePacketHandler extends PacketHandler{
}
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_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;
}

View File

@@ -44,6 +44,7 @@ class AddActorPacket extends DataPacket implements ClientboundPacket{
* TODO: remove this on 4.0
*/
public const LEGACY_ID_MAP_BC = [
-1 => ":",
EntityLegacyIds::NPC => "minecraft:npc",
EntityLegacyIds::PLAYER => "minecraft:player",
EntityLegacyIds::WITHER_SKELETON => "minecraft:wither_skeleton",