Dock device link port (#27646)

* Add dock device link port

* SpawnAndDeleteAllEntitiesInTheSameSpot moment

* The fuck is TryStopNukeOpsFromConstantlyFailing??

Do we have a new test that can randomly fail?
This commit is contained in:
0x6273
2024-05-06 05:59:01 +02:00
committed by GitHub
parent 1ecc36b049
commit c7a5587e07
5 changed files with 55 additions and 2 deletions

View File

@@ -0,0 +1,28 @@
using Content.Server.DeviceLinking.Systems;
using Content.Server.Shuttles.Components;
using Content.Server.Shuttles.Events;
namespace Content.Server.Shuttles.Systems;
public sealed class DockingSignalControlSystem : EntitySystem
{
[Dependency] private readonly DeviceLinkSystem _deviceLinkSystem = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<DockingSignalControlComponent, DockEvent>(OnDocked);
SubscribeLocalEvent<DockingSignalControlComponent, UndockEvent>(OnUndocked);
}
private void OnDocked(Entity<DockingSignalControlComponent> ent, ref DockEvent args)
{
_deviceLinkSystem.SendSignal(ent, ent.Comp.DockStatusSignalPort, signal: true);
}
private void OnUndocked(Entity<DockingSignalControlComponent> ent, ref UndockEvent args)
{
_deviceLinkSystem.SendSignal(ent, ent.Comp.DockStatusSignalPort, signal: false);
}
}