diff --git a/Fika.Core/Networking/FikaClient.cs b/Fika.Core/Networking/FikaClient.cs index 72a5ac7c..fd321609 100644 --- a/Fika.Core/Networking/FikaClient.cs +++ b/Fika.Core/Networking/FikaClient.cs @@ -85,7 +85,6 @@ public void Init() packetProcessor.SubscribeNetSerializable(OnWeatherPacketReceived); packetProcessor.SubscribeNetSerializable(OnBTRPacketReceived); packetProcessor.SubscribeNetSerializable(OnBTRInteractionPacketReceived); - packetProcessor.SubscribeNetSerializable(OnDeathPacketReceived); packetProcessor.SubscribeNetSerializable(OnMinePacketReceived); packetProcessor.SubscribeNetSerializable(OnBorderZonePacketReceived); packetProcessor.SubscribeNetSerializable(OnSendCharacterPacketReceived); @@ -258,14 +257,6 @@ private void OnMinePacketReceived(MinePacket packet) } } - private void OnDeathPacketReceived(DeathPacket packet) - { - if (Players.TryGetValue(packet.NetId, out CoopPlayer playerToApply)) - { - playerToApply.HandleDeathPatchet(packet); - } - } - private void OnBTRInteractionPacketReceived(BTRInteractionPacket packet) { if (Players.TryGetValue(packet.NetId, out CoopPlayer player)) diff --git a/Fika.Core/Networking/FikaServer.cs b/Fika.Core/Networking/FikaServer.cs index 391f45ca..a901c444 100644 --- a/Fika.Core/Networking/FikaServer.cs +++ b/Fika.Core/Networking/FikaServer.cs @@ -90,7 +90,6 @@ public async Task Init() packetProcessor.SubscribeNetSerializable(OnWeatherPacketReceived); packetProcessor.SubscribeNetSerializable(OnBTRInteractionPacketReceived); packetProcessor.SubscribeNetSerializable(OnBTRServicePacketReceived); - packetProcessor.SubscribeNetSerializable(OnDeathPacketReceived); packetProcessor.SubscribeNetSerializable(OnMinePacketReceived); packetProcessor.SubscribeNetSerializable(OnBorderZonePacketReceived); packetProcessor.SubscribeNetSerializable(OnSendCharacterPacketReceived); @@ -260,17 +259,6 @@ private void OnMinePacketReceived(MinePacket packet, NetPeer peer) } } - private void OnDeathPacketReceived(DeathPacket packet, NetPeer peer) - { - if (Players.TryGetValue(packet.NetId, out CoopPlayer playerToApply)) - { - playerToApply.HandleDeathPatchet(packet); - } - - _dataWriter.Reset(); - SendDataToAll(_dataWriter, ref packet, DeliveryMethod.ReliableOrdered, peer); - } - private void OnBTRServicePacketReceived(BTRServicePacket packet, NetPeer peer) { if (coopHandler.serverBTR != null) diff --git a/Fika.Core/Networking/Packets/Player/DeathPacket.cs b/Fika.Core/Networking/Packets/Player/DeathPacket.cs deleted file mode 100644 index d16f7536..00000000 --- a/Fika.Core/Networking/Packets/Player/DeathPacket.cs +++ /dev/null @@ -1,35 +0,0 @@ -using LiteNetLib.Utils; -using static Fika.Core.Networking.FikaSerialization; - -namespace Fika.Core.Networking -{ - public struct DeathPacket(int netId) : INetSerializable - { - public int NetId = netId; - public RagdollPacket RagdollPacket; - public bool HasInventory = false; - public EquipmentClass Equipment; - - public void Deserialize(NetDataReader reader) - { - NetId = reader.GetInt(); - RagdollPacket = RagdollPacket.Deserialize(reader); - HasInventory = reader.GetBool(); - if (HasInventory) - { - Equipment = (EquipmentClass)reader.GetItem(); - } - } - - public void Serialize(NetDataWriter writer) - { - writer.Put(NetId); - RagdollPacket.Serialize(writer, RagdollPacket); - writer.Put(HasInventory); - if (HasInventory) - { - writer.PutItem(Equipment); - } - } - } -}