CatStation/Content.Server/DeviceNetwork/Systems/WiredNetworkSystem.cs
DrSmugleaf 65f5f67cd5
Make every EntitySystem partial (#45220)
* Make every EntitySystem partial

* Oobs thats for a diff PR

* Also oops on that one

* Test systems

* git are we fr

* Update file templates

* cleanup empty classes while we are here

* forgor

---------

Co-authored-by: AJCM-git <ajcm_mail@disroot.org>
2026-08-14 18:24:47 +00:00

32 lines
1.1 KiB
C#

using Content.Server.DeviceNetwork.Components;
using Content.Shared.DeviceNetwork.Events;
using JetBrains.Annotations;
namespace Content.Server.DeviceNetwork.Systems
{
[UsedImplicitly]
public sealed partial class WiredNetworkSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<WiredNetworkComponent, BeforePacketSentEvent>(OnBeforePacketSent);
}
/// <summary>
/// Checks if both devices are on the same grid
/// </summary>
private void OnBeforePacketSent(EntityUid uid, WiredNetworkComponent component, BeforePacketSentEvent args)
{
if (Transform(uid).GridUid != args.SenderTransform.GridUid)
{
args.Cancel();
}
}
//Things to do in a future PR:
//Abstract out the connection between the apcExtensionCable and the apcPowerReceiver
//Traverse the power cables using path traversal
//Cache an optimized representation of the traversed path (Probably just cache Devices)
}
}