-
-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fast backpack replication & PlayerOwnerInventoryController change (#306)
This pull request adds / changes the following: - Sets PlayerOwnerInventoryController to PlayerInventoryController to avoid situations like all guns jamming, this seemingly has no other regression from when I tested it - Replicates dropping a backpack as soon as possible to other clients rather than when the animation is complete
- Loading branch information
Showing
4 changed files
with
101 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
Source/Coop/NetworkPacket/Player/Inventory/PlayerInventoryDropBackpackPacket.cs.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using StayInTarkov.Coop.Players; | ||
|
||
namespace StayInTarkov.Coop.NetworkPacket.Player.Inventory | ||
{ | ||
/// <summary> | ||
/// Goal: Backpack dropping in Polymorphing an inventory operation is too slow and only happens after the animation has already played | ||
/// This causes an issue because the host still has to sync up by the time the client might have already picked up a new bag. | ||
/// This Packet and the code referencing it fixes that. | ||
/// </summary> | ||
internal class PlayerInventoryDropBackpackPacket : ItemPlayerPacket | ||
{ | ||
public PlayerInventoryDropBackpackPacket() : base("", "", "", nameof(PlayerInventoryDropBackpackPacket)) | ||
{ | ||
} | ||
|
||
public override byte[] Serialize() | ||
{ | ||
return base.Serialize(); | ||
} | ||
|
||
public override ISITPacket Deserialize(byte[] bytes) | ||
{ | ||
return base.Deserialize(bytes); | ||
} | ||
|
||
protected override void Process(CoopPlayerClient client) | ||
{ | ||
client.DropBackpack(); | ||
} | ||
} | ||
} |