Files
OldThink/Content.IntegrationTests/Tests/DeviceNetwork/DeviceNetworkTestSystem.cs

33 lines
957 B
C#
Raw Normal View History

using Content.Server.DeviceNetwork;
using Content.Server.DeviceNetwork.Components;
using Content.Server.DeviceNetwork.Systems;
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();
2022-04-09 00:27:10 +12:00
SubscribeLocalEvent<DeviceNetworkComponent, DeviceNetworkPacketEvent>(OnPacketReceived);
}
public void SendBaselineTestEvent(EntityUid uid)
{
RaiseLocalEvent(uid, new DeviceNetworkPacketEvent(0, "", 0, "", uid, new NetworkPayload()));
}
2022-04-09 00:27:10 +12:00
private void OnPacketReceived(EntityUid uid, DeviceNetworkComponent component, DeviceNetworkPacketEvent args)
{
LastPayload = args.Data;
}
}
}