mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 21:48:58 +03:00
* Predict two-way levers Annoys me the rare occasions I touch cargo. Doesn't predict the signal but at least the lever responds immediately. * space * a (cherry picked from commit 05a2ddff1cc415c3bdf1e15ef3a2c953bcb5384b)
32 lines
956 B
C#
32 lines
956 B
C#
using Content.Server.DeviceNetwork.Components;
|
|
using Content.Server.DeviceNetwork.Systems;
|
|
using Content.Shared.DeviceNetwork;
|
|
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.Reflection;
|
|
|
|
namespace Content.IntegrationTests.Tests.DeviceNetwork
|
|
{
|
|
[Reflect(false)]
|
|
public sealed class DeviceNetworkTestSystem : EntitySystem
|
|
{
|
|
public NetworkPayload LastPayload = default;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<DeviceNetworkComponent, DeviceNetworkPacketEvent>(OnPacketReceived);
|
|
}
|
|
|
|
public void SendBaselineTestEvent(EntityUid uid)
|
|
{
|
|
RaiseLocalEvent(uid, new DeviceNetworkPacketEvent(0, "", 0, "", uid, new NetworkPayload()));
|
|
}
|
|
|
|
private void OnPacketReceived(EntityUid uid, DeviceNetworkComponent component, DeviceNetworkPacketEvent args)
|
|
{
|
|
LastPayload = args.Data;
|
|
}
|
|
}
|
|
}
|