Einstein-Engines
Einstein-Engines copied to clipboard
Mirror: Create DeviceNetworkJammerComponent & System as a general way for entities to act as jammers
Mirror of PR #26342: Create DeviceNetworkJammerComponent & System as a general way for entities to act as jammers from
space-wizards/space-station-14
266cc85f57c883b3a604a66da91d94bb1e18ec5d
PR opened by nikthechampiongr 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
Original Body
About the 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
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
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
- [x] I have added screenshots/videos to this PR showcasing its changes ingame, or this PR does not require an ingame showcase
Changelog
no cl no fun