Commit Graph

8 Commits

Author SHA1 Message Date
nikthechampiongr 9a378a6b06
Fix radio jammer not blocking suit sensors. (#26632)
As it turns out, they are not in fact on their own netid. They are
actually just on wireless. The way I had tested my previous pr led to
this mistake being made. I originally had the radio jammer block
wireless as well, but decided to take out under the flase assumption
that it suit sensors were actually on their own netid and did not
require the ability to block all wireless packets at the last moment.

(cherry picked from commit 29c81bcc052ab53c5b10d9a5dbe1c761745e3d1e)
2024-04-07 14:23:46 +02:00
nikthechampiongr 11d85b8796
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

(cherry picked from commit 266cc85f57c883b3a604a66da91d94bb1e18ec5d)
2024-03-27 18:35:36 +01:00
nikthechampiongr 554aa0774b
Make radio jammer block suit sensors (#26046)
* Make radio jammer block suit sensors

* Fix stupid

Use CancellableEventArgs instead of doing what the hell I was doing before.

* Address Reviews.

Change the event from a CancellableEntityEventArgs to a ByRefEvent.

(cherry picked from commit dce24dfd03b3ddfe1044297edf9d35bc9f75c523)
2024-03-17 15:07:58 +01:00
Tayrtahn 3f54180d28
Hotfix for errors in handheld lights and radio jammers (#25880)
(cherry picked from commit e5536e0652ab3605701627474d6450f0884a079c)
2024-03-07 01:52:49 +01:00
Tayrtahn a8d082374d
Remove all obsolete BatteryComponent method calls (#25871)
Removed all obsolete, non-ECS method calls to BatteryComponent

(cherry picked from commit 2935e5bd780d6cd08897521ba0b54adccb3fd0da)
2024-03-07 01:52:46 +01:00
Slava0135 811b35a1cf
display item charge on examine (#16116) 2023-05-05 22:44:21 +10:00
Slava0135 8aef835d33
radio systems replace all entity query with enumerator (#15449) 2023-04-23 18:29:08 +10:00
Slava0135 7886d27dda
Add radio jammer (#14369) 2023-04-14 12:50:19 -07:00