fire alarms will now attempt to register and sync against all connected devices whenever a device list is updated
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
using Content.Server.AlertLevel;
|
using Content.Server.AlertLevel;
|
||||||
using Content.Server.Atmos.Monitor.Components;
|
using Content.Server.Atmos.Monitor.Components;
|
||||||
|
using Content.Server.DeviceNetwork.Systems;
|
||||||
using Content.Server.Power.Components;
|
using Content.Server.Power.Components;
|
||||||
using Content.Server.Power.EntitySystems;
|
using Content.Server.Power.EntitySystems;
|
||||||
using Content.Shared.AlertLevel;
|
using Content.Shared.AlertLevel;
|
||||||
@@ -12,15 +13,23 @@ namespace Content.Server.Atmos.Monitor.Systems
|
|||||||
{
|
{
|
||||||
public sealed class FireAlarmSystem : EntitySystem
|
public sealed class FireAlarmSystem : EntitySystem
|
||||||
{
|
{
|
||||||
|
[Dependency] private readonly AtmosDeviceNetworkSystem _atmosDevNet = default!;
|
||||||
[Dependency] private readonly AtmosAlarmableSystem _atmosAlarmable = default!;
|
[Dependency] private readonly AtmosAlarmableSystem _atmosAlarmable = default!;
|
||||||
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
|
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
SubscribeLocalEvent<FireAlarmComponent, InteractHandEvent>(OnInteractHand);
|
SubscribeLocalEvent<FireAlarmComponent, InteractHandEvent>(OnInteractHand);
|
||||||
|
SubscribeLocalEvent<FireAlarmComponent, DeviceListUpdateEvent>(OnDeviceListSync);
|
||||||
SubscribeLocalEvent<FireAlarmComponent, GotEmaggedEvent>(OnEmagged);
|
SubscribeLocalEvent<FireAlarmComponent, GotEmaggedEvent>(OnEmagged);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnDeviceListSync(EntityUid uid, FireAlarmComponent component, DeviceListUpdateEvent args)
|
||||||
|
{
|
||||||
|
_atmosDevNet.Register(uid, null);
|
||||||
|
_atmosDevNet.Sync(uid, null);
|
||||||
|
}
|
||||||
|
|
||||||
private void OnInteractHand(EntityUid uid, FireAlarmComponent component, InteractHandEvent args)
|
private void OnInteractHand(EntityUid uid, FireAlarmComponent component, InteractHandEvent args)
|
||||||
{
|
{
|
||||||
if (!_interactionSystem.InRangeUnobstructed(args.User, args.Target))
|
if (!_interactionSystem.InRangeUnobstructed(args.User, args.Target))
|
||||||
|
|||||||
@@ -13,6 +13,8 @@
|
|||||||
deviceNetId: AtmosDevices
|
deviceNetId: AtmosDevices
|
||||||
receiveFrequencyId: AtmosMonitor
|
receiveFrequencyId: AtmosMonitor
|
||||||
transmitFrequencyId: AtmosMonitor
|
transmitFrequencyId: AtmosMonitor
|
||||||
|
sendBroadcastAttemptEvent: true
|
||||||
|
- type: DeviceList
|
||||||
- type: ApcNetworkConnection
|
- type: ApcNetworkConnection
|
||||||
- type: AtmosMonitor
|
- type: AtmosMonitor
|
||||||
monitorFire: true
|
monitorFire: true
|
||||||
|
|||||||
Reference in New Issue
Block a user