]> git.smokeofanarchy.ru Git - space-station-14.git/commit
Create DeviceNetworkJammerComponent & System as a general way for entities to act...
authornikthechampiongr <32041239+nikthechampiongr@users.noreply.github.com>
Mon, 25 Mar 2024 01:59:16 +0000 (03:59 +0200)
committerGitHub <noreply@github.com>
Mon, 25 Mar 2024 01:59:16 +0000 (21:59 -0400)
commit266cc85f57c883b3a604a66da91d94bb1e18ec5d
tree9f8eb6a19d9abe01b0ad289578d4bd9b5cb5e4a4
parent49dbead354a500a99eddab8d794beb590efd9958
Create DeviceNetworkJammerComponent & System as a general way for entities to act as jammers (#26342)

* Add DeviceNetworkJammerComponent & System

Allows for entities to "jam" DeviceNetwork packets.

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.

* Make JammerSystem for the radio jammer use the DeviceNetworkJammer. Remove redundant event.

* Replace calls to TryDistance with InRange
Content.Server/DeviceNetwork/Systems/DeviceNetworkJammerSystem.cs [new file with mode: 0644]
Content.Server/DeviceNetwork/Systems/DeviceNetworkSystem.cs
Content.Server/DeviceNetwork/Systems/SingletonDeviceNetServerSystem.cs
Content.Server/Medical/SuitSensors/SuitSensorComponent.cs
Content.Server/Medical/SuitSensors/SuitSensorSystem.cs
Content.Server/Radio/EntitySystems/JammerSystem.cs
Content.Shared/DeviceNetwork/Components/DeviceNetworkJammerComponent.cs [new file with mode: 0644]