first commit

This commit is contained in:
2025-07-06 00:23:46 +02:00
commit 38f50c8819
1788 changed files with 112878 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
using NitroxClient.Communication.Packets.Processors.Abstract;
using NitroxClient.GameLogic;
using NitroxModel.DataStructures.Util;
using NitroxModel.Packets;
namespace NitroxClient.Communication.Packets.Processors;
public class MutePlayerProcessor : ClientPacketProcessor<MutePlayer>
{
private readonly PlayerManager playerManager;
public delegate void PlayerMuted(ushort playerId, bool muted);
public PlayerMuted OnPlayerMuted;
public MutePlayerProcessor(PlayerManager playerManager)
{
this.playerManager = playerManager;
}
public override void Process(MutePlayer packet)
{
// We only need to notice if that's another player than local player
Optional<RemotePlayer> player = playerManager.Find(packet.PlayerId);
if (player.HasValue)
{
player.Value.PlayerContext.IsMuted = packet.Muted;
}
OnPlayerMuted(packet.PlayerId, packet.Muted);
}
}