]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Device-list limiting (#30997)
authorZachary Yona <58833995+Magicalus@users.noreply.github.com>
Mon, 19 Aug 2024 03:13:03 +0000 (23:13 -0400)
committerGitHub <noreply@github.com>
Mon, 19 Aug 2024 03:13:03 +0000 (21:13 -0600)
* 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 <magicalusf@gmail.com>
Content.Server/DeviceNetwork/Components/DeviceNetworkComponent.cs
Content.Server/DeviceNetwork/Systems/NetworkConfiguratorSystem.cs
Resources/Prototypes/Entities/Clothing/Uniforms/base_clothinguniforms.yml
Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml
Resources/Prototypes/Entities/Objects/Devices/pda.yml

index 3a68fffbcc29f8c46ad677e636eaa6a86d6e3072..186da57e5d127fa98a6dcc051028432a87910948 100644 (file)
@@ -102,6 +102,13 @@ namespace Content.Server.DeviceNetwork.Components
         [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>
index 59b58c69338bae6d7acca534c5f8502c05881bc4..0dc4f45d9e0b76fd58ab694fabee6b2e3998b1ca 100644 (file)
@@ -106,6 +106,13 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
         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))
         {
index 0329f82b5b199b113a9c32977c88feade6063c91..04ce60bed618f6cf2246404c5ee0c6ca19ad7b9b 100644 (file)
@@ -47,6 +47,7 @@
   - type: DeviceNetwork
     deviceNetId: Wireless
     transmitFrequencyId: SuitSensor
+    savableAddress: false
   - type: WirelessNetworkConnection
     range: 1200
   - type: StationLimitedNetwork
index 371c102eb0aeb2637f897ebaf54436c88f539de0..b701bbd8f480418e1b6921245cf0df8d915a45a8 100644 (file)
     deviceNetId: Wireless
     receiveFrequencyId: CyborgControl
     transmitFrequencyId: RoboticsConsole
+    savableAddress: false
   - type: OnUseTimerTrigger
     delay: 10
     examinable: false
index 5bf68b6fd6820bf89eb8fb4ce2d43b5bde102b73..ac564eac66be13a98420ca815caa53ecced58e83 100644 (file)
@@ -67,6 +67,7 @@
     deviceNetId: Wireless
     receiveFrequencyId: PDA
     prefix: device-address-prefix-console
+    savableAddress: false
   - type: WirelessNetworkConnection
     range: 500
   - type: CartridgeLoader