Skip to content

Commit

Permalink
Device-list limiting (#30997)
Browse files Browse the repository at this point in the history
* PDA can no longer be linked to multitool

* Ignore previous commit, it would've broken things

* Added SavableAddress field to DeviceNetwork component and PDA for testing. Still need to implement

* System works, borg and pda addresses cannot be saved, but they still connect to the net.

* Suit sensors can no longer be added to network configurators, still work for monitoring purposes.

---------

Co-authored-by: Zachary Yona <[email protected]>
  • Loading branch information
2 people authored and sleepyyapril committed Jan 14, 2025
1 parent 7df15b2 commit 943982d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ public enum DeviceNetIdDefaults
[DataField("sendBroadcastAttemptEvent")]
public bool SendBroadcastAttemptEvent = false;

/// <summary>
/// Whether this device's address can be saved to device-lists
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("savableAddress")]
public bool SavableAddress = true;

/// <summary>
/// A list of device-lists that this device is on.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ private void TryAddNetworkDevice(EntityUid configuratorUid, EntityUid? targetUid
if (!targetUid.HasValue || !Resolve(targetUid.Value, ref device, false))
return;

//This checks if the device is marked as having a savable address,
//to avoid adding pdas and whatnot to air alarms. This flag is true
//by default, so this will only prevent devices from being added to
//network configurator lists if manually set to false in the prototype
if (!device.SavableAddress)
return;

var address = device.Address;
if (string.IsNullOrEmpty(address))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
- type: DeviceNetwork
deviceNetId: Wireless
transmitFrequencyId: SuitSensor
savableAddress: false
- type: WirelessNetworkConnection
range: 1200
- type: StationLimitedNetwork
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@
deviceNetId: Wireless
receiveFrequencyId: CyborgControl
transmitFrequencyId: RoboticsConsole
savableAddress: false
- type: OnUseTimerTrigger
delay: 10
examinable: false
Expand Down

0 comments on commit 943982d

Please sign in to comment.