using Content.Server.DeviceNetwork.Components; using Content.Shared.DeviceNetwork.Events; using JetBrains.Annotations; namespace Content.Server.DeviceNetwork.Systems { [UsedImplicitly] public sealed class WiredNetworkSystem : EntitySystem { public override void Initialize() { base.Initialize(); SubscribeLocalEvent(OnBeforePacketSent); } /// /// Checks if both devices are on the same grid /// 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) } }