## Mirror of PR #26342: [Create DeviceNetworkJammerComponent & System as
a general way for entities to act as
jammers](https://github.com/space-wizards/space-station-14/pull/26342)
from <img src="https://avatars.githubusercontent.com/u/10567778?v=4"
alt="space-wizards" width="22"/>
[space-wizards](https://github.com/space-wizards)/[space-station-14](https://github.com/space-wizards/space-station-14)
###### `266cc85f57c883b3a604a66da91d94bb1e18ec5d`
PR opened by <img
src="https://avatars.githubusercontent.com/u/32041239?v=4"
width="16"/><a href="https://github.com/nikthechampiongr">
nikthechampiongr</a> at 2024-03-22 19:17:23 UTC
---
PR changed 7 files with 91 additions and 25 deletions.
The PR had the following labels:
- Status: Needs Review
---
<details open="true"><summary><h1>Original Body</h1></summary>
> <!-- Please read these guidelines before opening your PR:
https://docs.spacestation14.io/en/getting-started/pr-guideline -->
> <!-- The text between the arrows are comments - they will not be
visible on your PR. -->
>
> ## About the PR
> <!-- What did you change in this PR? -->
> This PR creates the DeviceNetworkJammerComponent & System as a general
way for entities to act as jammers for the DeviceNetwork.
>
> Additionally it adjusts the JammerSystem for the radio jammer to use
this, and rips out the previous special code for jamming suit sensors.
>
> As a result of this, the radio jammer can now additionally jam the
suit sensor server itself from receiving DeviceNetwork packets.
>
> ## Why / Balance
> <!-- Why was it changed? Link any discussions or issues here. Please
discuss how this would affect game balance. -->
> This pr was requested by a maintainer.
>
> Additionally a general jamming system can have some utility in the
future. E.g. an artifact effect.
> ## Technical details
> <!-- If this is a code change, summarize at high level how your new
code works. This makes it easier to review. -->
>
> Whenever a device attempts to send a packet, the
> DeviceNetworkJammerSystem listens for the BeforePacketSentEvent.
> From there if any entity with the jammer component is within range of
> either the sender or receiver of the packet the event will be
cancelled.
> Additionally jammers can only block packets in certain networks. If a
> packet is not being transmitted in one of the networks it can block
then
> even if the jammer is in range the event will not be cancelled.
>
> The range is stored in the jammer component along with the networks it
> can jam.
>
> Jammable network ids are stored as strings which seems to be how
custom
> networks are stored (E.g. network ids for suit sensors).
>
> To allow for all of this, the BeforePacketSentEvent was modified to
> provide the NetworkId.
>
> The JammerSystem now needs to get the networkid for suit sensors for
use in the DeviceNetwork. The previous event subscription for jamming
suit sensors have been removed along with the event.
>
> I wish I could use this to jam radios as well but radios are magic and
do not use device networks.
>
> ## Media
> <!--
> PRs which make ingame changes (adding clothing, items, new features,
etc) are required to have media attached that showcase the changes.
> Small fixes/refactors are exempt.
> Any media may be used in SS14 progress reports, with clear credit
given.
>
> If you're unsure whether your PR will require media, ask a maintainer.
>
> Check the box below to confirm that you have in fact seen this (put an
X in the brackets, like [X]):
> -->
>
> - [x] I have added screenshots/videos to this PR showcasing its
changes ingame, **or** this PR does not require an ingame showcase
>
> **Changelog**
> <!--
> Make players aware of new features and changes that could affect how
they play the game by adding a Changelog entry. Please read the
Changelog guidelines located at:
https://docs.spacestation14.io/en/getting-started/pr-guideline#changelog
> -->
>
> <!--
> Make sure to take this Changelog template out of the comment block in
order for it to show up.
> 🆑
> - add: Added fun!
> - remove: Removed fun!
> - tweak: Changed fun!
> - fix: Fixed fun!
> -->
> no cl no fun
</details>
Signed-off-by: VMSolidus <evilexecutive@gmail.com>
Co-authored-by: SimpleStation14 <Unknown>
Co-authored-by: VMSolidus <evilexecutive@gmail.com>
* Implement device network device shutdown subscribtion
Implement removing devices from device lists when they get deleted
* Improve name and doc comment for DeviceShutDownEvent
* Change ShutdownSubscriber data field tag
* Change UpdateRemovalSubscription name to UpdateShutdownSubscription
* Implement DeviceList
Implement NetworkConfigurator
I sould really get into the habit of making smaller commits
* Remove ApcNetworkComponent from vents, scrubbers anf firelocks
* Change BeforeBroadcastAttemptEvent#Recepients to readonly IReadonlySet and add a ModifiedRecepients field
* Address revievs in NetworkConfigurationSystem
* Fix red and green button styles
* Change NetworkConfiguratorSystem#UpdateState to remove saved entites that don't exist anymore
* Add AtmosDevices device net id
* Add const strings for style classes
Fix wrong margin for NetworkConfiguratorConfigurationMenu
* Hello? Github?
* Add access check before opening the configuration ui
* Address reviews
* Fix call to access reader
* You shall not live again IgnoreComponent
* Fix interaction verb check
* Fix configuration window not closing when target gets deleted / out of range
* Change device is already saved message to say 'network device: ... is already saves'
* Apply suggestions from code review
Co-authored-by: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
* Fix applied suggestion
Co-authored-by: wrexbe <81056464+wrexbe@users.noreply.github.com>
Co-authored-by: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
* Remove WireNet node group from cables
Implement extension cable components and system
Remove connection over distance logic from ApcPower... components
* Add extension cable components to prototypes
* Implement ApcNetwork
Implement ApcNetSwitch
* Fix ignoredComponents.cs
* Add friend attribute to new components
* Add construction graph for a light switch
* Address reviews
* Fix broken test
* Move ConnectionType enum to DeviceNetworkComponent
Change netId data definition to use the ConnectionType enum values
Co-authored-by: Julian Giebel <j.giebel@netrocks.info>
* Work on DeviceNetworkSystem
* Implement device networking as ecs
Remove mailing unit code for now
Remove device network metadata
* Implement integration tests for device networking
* Remove manual updating DeviceNetworkSystem and use WaitRunTicks
* Fix wrong component name in ignored components
* Apply suggestions from code review
Co-authored-by: mirrorcult <notzombiedude@gmail.com>
* Rename NetworkUtils to DeviceNetworkConstants
Change connection type constants to enum
Remove create function from network payload class
* Change broken nodegroup check in wirenet to grid check
* Change ComponentManager to entity manager in DeviceNetworkSystem
* Fix smaller mistakes
* Wtf random test fail pls run them again smh
* Fix DataField in DeviceNetworkComponent
* Fix yaml in DeviceNetworkTest
* Fix DeviceNetworkComponent DeviceNetId property
Co-authored-by: Julian Giebel <j.giebel@netrocks.info>
Co-authored-by: mirrorcult <notzombiedude@gmail.com>