Predict inventory slot interactions. (#6033)

This commit is contained in:
Leon Friedrich
2022-01-30 13:50:10 +13:00
committed by GitHub
parent c465715273
commit 47e597ca47
9 changed files with 138 additions and 140 deletions

View File

@@ -1,26 +0,0 @@
using System;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
namespace Content.Shared.Inventory.Events;
[NetSerializable, Serializable]
public class TryEquipNetworkMessage : EntityEventArgs
{
public readonly EntityUid Actor;
public readonly EntityUid Target;
public readonly EntityUid ItemUid;
public readonly string Slot;
public readonly bool Silent;
public readonly bool Force;
public TryEquipNetworkMessage(EntityUid actor, EntityUid target, EntityUid itemUid, string slot, bool silent, bool force)
{
Actor = actor;
Target = target;
ItemUid = itemUid;
Slot = slot;
Silent = silent;
Force = force;
}
}

View File

@@ -1,24 +0,0 @@
using System;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
namespace Content.Shared.Inventory.Events;
[NetSerializable, Serializable]
public class TryUnequipNetworkMessage : EntityEventArgs
{
public readonly EntityUid Actor;
public readonly EntityUid Target;
public readonly string Slot;
public readonly bool Silent;
public readonly bool Force;
public TryUnequipNetworkMessage(EntityUid actor, EntityUid target, string slot, bool silent, bool force)
{
Actor = actor;
Target = target;
Slot = slot;
Silent = silent;
Force = force;
}
}

View File

@@ -7,12 +7,12 @@ namespace Content.Shared.Inventory.Events;
[NetSerializable, Serializable]
public class UseSlotNetworkMessage : EntityEventArgs
{
public readonly EntityUid Uid;
// The slot-owner is implicitly the client that is sending this message.
// Otherwise clients could start forcefully undressing other clients.
public readonly string Slot;
public UseSlotNetworkMessage(EntityUid uid, string slot)
public UseSlotNetworkMessage(string slot)
{
Uid = uid;
Slot = slot;
}
}