From 21692cd5e614f0ed95744832dc5efffbca982173 Mon Sep 17 00:00:00 2001 From: iertis Date: Thu, 2 Jan 2025 16:38:54 +0300 Subject: [PATCH 01/13] init --- Content.Shared/Access/AccessLevelPrototype.cs | 15 ++++++++++++++ .../Prototypes/AlertAccessesPrototype.cs | 20 +++++++++++++++++++ Resources/Prototypes/Access/security.yml | 1 + .../Access/AlertAccess/alert_access.yml | 6 ++++++ 4 files changed, 42 insertions(+) create mode 100644 Content.Shared/_Sunrise/AlertAccess/Prototypes/AlertAccessesPrototype.cs create mode 100644 Resources/Prototypes/_Sunrise/Access/AlertAccess/alert_access.yml diff --git a/Content.Shared/Access/AccessLevelPrototype.cs b/Content.Shared/Access/AccessLevelPrototype.cs index e3a3b426b09..88aaf715a76 100644 --- a/Content.Shared/Access/AccessLevelPrototype.cs +++ b/Content.Shared/Access/AccessLevelPrototype.cs @@ -1,4 +1,5 @@ using Robust.Shared.Prototypes; +using Content.Shared._Sunrise.AlertAccess; namespace Content.Shared.Access { @@ -18,6 +19,20 @@ public sealed partial class AccessLevelPrototype : IPrototype [DataField("name")] public string? Name { get; set; } + [DataField] + public string CurrentAlertLevel; + + [DataField("redAlertAccesses")] + public ProtoId RedAlertAccesses; + + [DataField("yellowAlertAccesses")] + public ProtoId YellowAlertAccesses; + + [DataField("gammaAlertAccesses")] + public ProtoId GammaAlertAccesses; + + [DataField("blueAlertAccesses")] + public ProtoId BlueAlertAccesses; public string GetAccessLevelName() { if (Name is { } name) diff --git a/Content.Shared/_Sunrise/AlertAccess/Prototypes/AlertAccessesPrototype.cs b/Content.Shared/_Sunrise/AlertAccess/Prototypes/AlertAccessesPrototype.cs new file mode 100644 index 00000000000..411045f5fd4 --- /dev/null +++ b/Content.Shared/_Sunrise/AlertAccess/Prototypes/AlertAccessesPrototype.cs @@ -0,0 +1,20 @@ +using Robust.Shared.Prototypes; +using Content.Shared.Access; + +namespace Content.Shared._Sunrise.AlertAccess +{ + /// + /// Defines a single access level that can be stored on ID cards and checked for. + /// + [Prototype("alertAccessesPrototype")] + public sealed partial class AlertAccessesPrototype : IPrototype + { + [ViewVariables] + [IdDataField] + public string ID { get; private set; } = default!; + + [DataField("access")] + public List> Access = new(); + + } +} diff --git a/Resources/Prototypes/Access/security.yml b/Resources/Prototypes/Access/security.yml index cfe94dd78af..3eee611d985 100644 --- a/Resources/Prototypes/Access/security.yml +++ b/Resources/Prototypes/Access/security.yml @@ -5,6 +5,7 @@ - type: accessLevel id: Security name: id-card-access-level-security + redAlertAccesses: SecurityRedAlertAccesses - type: accessLevel id: Armory diff --git a/Resources/Prototypes/_Sunrise/Access/AlertAccess/alert_access.yml b/Resources/Prototypes/_Sunrise/Access/AlertAccess/alert_access.yml new file mode 100644 index 00000000000..d475367b500 --- /dev/null +++ b/Resources/Prototypes/_Sunrise/Access/AlertAccess/alert_access.yml @@ -0,0 +1,6 @@ +- type: alertAccesses + id: SecurityRedAlertAccesses + access: + - Engineer + - Command + - Maintance From df217e197571b73cc46b43c753f8a21991c7e879 Mon Sep 17 00:00:00 2001 From: iertis Date: Sat, 4 Jan 2025 16:04:58 +0300 Subject: [PATCH 02/13] optimization --- Content.Shared/Access/AccessLevelPrototype.cs | 16 ++----------- .../Prototypes/AlertAccessesPrototype.cs | 20 ---------------- Resources/Prototypes/Access/security.yml | 8 ++++++- .../Access/AccessGroup/access_group.yml | 24 +++++++++++++++++++ .../Access/AlertAccess/alert_access.yml | 6 ----- 5 files changed, 33 insertions(+), 41 deletions(-) delete mode 100644 Content.Shared/_Sunrise/AlertAccess/Prototypes/AlertAccessesPrototype.cs create mode 100644 Resources/Prototypes/_Sunrise/Access/AccessGroup/access_group.yml delete mode 100644 Resources/Prototypes/_Sunrise/Access/AlertAccess/alert_access.yml diff --git a/Content.Shared/Access/AccessLevelPrototype.cs b/Content.Shared/Access/AccessLevelPrototype.cs index 88aaf715a76..77b53f6e10c 100644 --- a/Content.Shared/Access/AccessLevelPrototype.cs +++ b/Content.Shared/Access/AccessLevelPrototype.cs @@ -1,5 +1,4 @@ using Robust.Shared.Prototypes; -using Content.Shared._Sunrise.AlertAccess; namespace Content.Shared.Access { @@ -19,20 +18,9 @@ public sealed partial class AccessLevelPrototype : IPrototype [DataField("name")] public string? Name { get; set; } - [DataField] - public string CurrentAlertLevel; + [DataField("alertAccesses")] + public Dictionary> AlertAccesses = new(); - [DataField("redAlertAccesses")] - public ProtoId RedAlertAccesses; - - [DataField("yellowAlertAccesses")] - public ProtoId YellowAlertAccesses; - - [DataField("gammaAlertAccesses")] - public ProtoId GammaAlertAccesses; - - [DataField("blueAlertAccesses")] - public ProtoId BlueAlertAccesses; public string GetAccessLevelName() { if (Name is { } name) diff --git a/Content.Shared/_Sunrise/AlertAccess/Prototypes/AlertAccessesPrototype.cs b/Content.Shared/_Sunrise/AlertAccess/Prototypes/AlertAccessesPrototype.cs deleted file mode 100644 index 411045f5fd4..00000000000 --- a/Content.Shared/_Sunrise/AlertAccess/Prototypes/AlertAccessesPrototype.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Robust.Shared.Prototypes; -using Content.Shared.Access; - -namespace Content.Shared._Sunrise.AlertAccess -{ - /// - /// Defines a single access level that can be stored on ID cards and checked for. - /// - [Prototype("alertAccessesPrototype")] - public sealed partial class AlertAccessesPrototype : IPrototype - { - [ViewVariables] - [IdDataField] - public string ID { get; private set; } = default!; - - [DataField("access")] - public List> Access = new(); - - } -} diff --git a/Resources/Prototypes/Access/security.yml b/Resources/Prototypes/Access/security.yml index 3eee611d985..e096fd7e4ec 100644 --- a/Resources/Prototypes/Access/security.yml +++ b/Resources/Prototypes/Access/security.yml @@ -5,7 +5,13 @@ - type: accessLevel id: Security name: id-card-access-level-security - redAlertAccesses: SecurityRedAlertAccesses + alertAccesses: + red: + access: SecurityRedAlertAccesses + blue: + access: SecurityBlueAlertAccesses + gamma: + access: SecurityGammaAlertAccesses - type: accessLevel id: Armory diff --git a/Resources/Prototypes/_Sunrise/Access/AccessGroup/access_group.yml b/Resources/Prototypes/_Sunrise/Access/AccessGroup/access_group.yml new file mode 100644 index 00000000000..c9b37918633 --- /dev/null +++ b/Resources/Prototypes/_Sunrise/Access/AccessGroup/access_group.yml @@ -0,0 +1,24 @@ +- type: accessGroup + id: SecurityRedAlertAccesses + tags: + - Engineer + - Command + - Maintance + +- type: accessGroup + id: SecurityBlueAlertAccesses + tags: + - Maintance + +- type: accessGroup + id: SecurityGammaAlertAccesses + tags: + - Command + - Captain + - HeadOfPersonnel + - Cryogenics + - BlueShield + - Ntrep + +# Потом дополню доступы + diff --git a/Resources/Prototypes/_Sunrise/Access/AlertAccess/alert_access.yml b/Resources/Prototypes/_Sunrise/Access/AlertAccess/alert_access.yml deleted file mode 100644 index d475367b500..00000000000 --- a/Resources/Prototypes/_Sunrise/Access/AlertAccess/alert_access.yml +++ /dev/null @@ -1,6 +0,0 @@ -- type: alertAccesses - id: SecurityRedAlertAccesses - access: - - Engineer - - Command - - Maintance From 828341c40bdaf7f92ddfdaec403da862b3e99c54 Mon Sep 17 00:00:00 2001 From: iertis Date: Sat, 4 Jan 2025 16:16:31 +0300 Subject: [PATCH 03/13] some fixes --- Content.Shared/Access/AccessLevelPrototype.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Content.Shared/Access/AccessLevelPrototype.cs b/Content.Shared/Access/AccessLevelPrototype.cs index 77b53f6e10c..aeaf60e4eeb 100644 --- a/Content.Shared/Access/AccessLevelPrototype.cs +++ b/Content.Shared/Access/AccessLevelPrototype.cs @@ -19,7 +19,15 @@ public sealed partial class AccessLevelPrototype : IPrototype public string? Name { get; set; } [DataField("alertAccesses")] - public Dictionary> AlertAccesses = new(); + public Dictionary> AlertAccesses = new(); + + public enum CurrentAlertLevel : byte + { + blue, + red, + yellow, + gamma + } public string GetAccessLevelName() { From 76a93bad3ccafb59e7bd126e29c205cefad3484f Mon Sep 17 00:00:00 2001 From: iertis Date: Sun, 5 Jan 2025 15:04:06 +0300 Subject: [PATCH 04/13] checks --- Content.Shared/Access/AccessLevelPrototype.cs | 11 ---------- .../Components/AccessReaderComponent.cs | 11 ++++++++++ .../Access/Systems/AccessReaderSystem.cs | 22 +++++++++++++++++++ Resources/Prototypes/Access/security.yml | 7 ------ .../Devices/Electronics/door_access.yml | 2 ++ .../Access/AccessGroup/access_group.yml | 6 ++--- 6 files changed, 37 insertions(+), 22 deletions(-) diff --git a/Content.Shared/Access/AccessLevelPrototype.cs b/Content.Shared/Access/AccessLevelPrototype.cs index aeaf60e4eeb..e3a3b426b09 100644 --- a/Content.Shared/Access/AccessLevelPrototype.cs +++ b/Content.Shared/Access/AccessLevelPrototype.cs @@ -18,17 +18,6 @@ public sealed partial class AccessLevelPrototype : IPrototype [DataField("name")] public string? Name { get; set; } - [DataField("alertAccesses")] - public Dictionary> AlertAccesses = new(); - - public enum CurrentAlertLevel : byte - { - blue, - red, - yellow, - gamma - } - public string GetAccessLevelName() { if (Name is { } name) diff --git a/Content.Shared/Access/Components/AccessReaderComponent.cs b/Content.Shared/Access/Components/AccessReaderComponent.cs index 903ceab186d..804137e0fd6 100644 --- a/Content.Shared/Access/Components/AccessReaderComponent.cs +++ b/Content.Shared/Access/Components/AccessReaderComponent.cs @@ -20,6 +20,17 @@ public sealed partial class AccessReaderComponent : Component [DataField] public bool Enabled = true; + [ViewVariables(VVAccess.ReadWrite)] + [DataField("alertAccesses")] + public Dictionary> AlertAccesses = new(); + + public enum CurrentAlertLevel : byte + { + blue, + red, + yellow, + gamma + } /// /// The set of tags that will automatically deny an allowed check, if any of them are present. /// diff --git a/Content.Shared/Access/Systems/AccessReaderSystem.cs b/Content.Shared/Access/Systems/AccessReaderSystem.cs index f670ac860be..c7ecfc4efd4 100644 --- a/Content.Shared/Access/Systems/AccessReaderSystem.cs +++ b/Content.Shared/Access/Systems/AccessReaderSystem.cs @@ -166,6 +166,9 @@ public bool IsAllowed( if (!TryComp(entity, out AccessReaderComponent? containedReader)) continue; + if (AreAccessTagsAllowedAlert(access, containedReader)) + return true; + if (IsAllowed(access, stationKeys, entity, containedReader)) return true; } @@ -209,6 +212,25 @@ public bool AreAccessTagsAllowed(ICollection> acce return false; } + public bool AreAccessTagsAllowedAlert(ICollection> access, AccessReaderComponent reader) + { + foreach (var (stationCode, alertAccesses) in reader.AlertAccesses) + { + if (!_prototype.TryIndex(alertAccesses, out var accessTags)) + return false; + + if (accessTags == null) + return false; + + if (accessTags.Tags.Count == 0) + return false; + + if (accessTags.Tags.IsSubsetOf(access)) + return true; + } + return false; + } + /// /// Compares the given stationrecordkeys with the accessreader to see if it is allowed. /// diff --git a/Resources/Prototypes/Access/security.yml b/Resources/Prototypes/Access/security.yml index e096fd7e4ec..cfe94dd78af 100644 --- a/Resources/Prototypes/Access/security.yml +++ b/Resources/Prototypes/Access/security.yml @@ -5,13 +5,6 @@ - type: accessLevel id: Security name: id-card-access-level-security - alertAccesses: - red: - access: SecurityRedAlertAccesses - blue: - access: SecurityBlueAlertAccesses - gamma: - access: SecurityGammaAlertAccesses - type: accessLevel id: Armory diff --git a/Resources/Prototypes/Entities/Objects/Devices/Electronics/door_access.yml b/Resources/Prototypes/Entities/Objects/Devices/Electronics/door_access.yml index f75fa2584e2..c0bbb2e5275 100644 --- a/Resources/Prototypes/Entities/Objects/Devices/Electronics/door_access.yml +++ b/Resources/Prototypes/Entities/Objects/Devices/Electronics/door_access.yml @@ -22,6 +22,8 @@ components: - type: AccessReader access: [["Command"]] + alertAccesses: + red: RedAlertAccess # Service - type: entity diff --git a/Resources/Prototypes/_Sunrise/Access/AccessGroup/access_group.yml b/Resources/Prototypes/_Sunrise/Access/AccessGroup/access_group.yml index c9b37918633..9a3526ea38a 100644 --- a/Resources/Prototypes/_Sunrise/Access/AccessGroup/access_group.yml +++ b/Resources/Prototypes/_Sunrise/Access/AccessGroup/access_group.yml @@ -1,9 +1,7 @@ - type: accessGroup - id: SecurityRedAlertAccesses + id: RedAlertAccesses tags: - - Engineer - - Command - - Maintance + - Security - type: accessGroup id: SecurityBlueAlertAccesses From 1caab609962e312d6c34bcb9927119dded9f0e03 Mon Sep 17 00:00:00 2001 From: iertis Date: Mon, 6 Jan 2025 15:33:50 +0300 Subject: [PATCH 05/13] almost ready --- Content.Server/Access/Systems/AccessSystem.cs | 86 ++++++++++++++++++- .../Components/AccessReaderComponent.cs | 24 +++++- .../Access/Systems/AccessReaderSystem.cs | 24 +++--- .../Devices/Electronics/door_access.yml | 7 ++ .../Access/AccessGroup/access_group.yml | 22 +++-- 5 files changed, 140 insertions(+), 23 deletions(-) diff --git a/Content.Server/Access/Systems/AccessSystem.cs b/Content.Server/Access/Systems/AccessSystem.cs index f185d0ff980..81c7dca120a 100644 --- a/Content.Server/Access/Systems/AccessSystem.cs +++ b/Content.Server/Access/Systems/AccessSystem.cs @@ -1,7 +1,91 @@ using Content.Shared.Access.Systems; - +using Content.Shared.Access.Components; +using Content.Server.Station.Systems; +using Content.Server.AlertLevel; +using Content.Shared.Station.Components; namespace Content.Server.Access.Systems; public sealed class AccessSystem : SharedAccessSystem { + // + // Запускает обновление уровня аварийных доступов на всех сущностях с AccessReaderComponent + // + [Dependency] private readonly StationSystem _station = default!; + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnAlertLevelChanged); + } + + private void OnAlertLevelChanged(AlertLevelChangedEvent ev) + { + if (!TryComp(ev.Station, out var alert)) + return; + + if (alert.AlertLevels == null) + return; + + var query = EntityQueryEnumerator(); + while (query.MoveNext(out var uid, out var reader, out var xform)) + { + if (CompOrNull(xform.GridUid)?.Station != ev.Station) + continue; + + if (alert.AlertLevels == null) + return; + + if (!TryComp(uid, out var comp)) + return; + + if (comp.AlertAccesses.Count == 0) + continue; + + Update((uid, reader)); + Dirty(uid, reader); + } + } + + // + // Устанавливает значение из прототипа в зависимости от кода + // + public void Update(Entity entity) + { + + if (!TryComp(_station.GetOwningStation(entity.Owner), out var alerts)) + return; + + if (entity.Comp.AlertAccesses.Count == 0) + return; + + if (alerts.AlertLevels == null) + return; + + if (alerts.CurrentLevel.Contains("blue")) + { + entity.Comp.AlertAccesses.TryGetValue(AccessReaderComponent.CurrentAlertLevel.blue, out var value); + entity.Comp.Group = value; + } + else if (alerts.CurrentLevel.Contains("red")) + { + entity.Comp.AlertAccesses.TryGetValue(AccessReaderComponent.CurrentAlertLevel.red, out var value); + entity.Comp.Group = value; + Dirty(entity); + } + else if (alerts.CurrentLevel.Contains("yellow")) + { + entity.Comp.AlertAccesses.TryGetValue(AccessReaderComponent.CurrentAlertLevel.yellow, out var value); + entity.Comp.Group = value; + } + else if (alerts.CurrentLevel.Contains("gamma")) + { + entity.Comp.AlertAccesses.TryGetValue(AccessReaderComponent.CurrentAlertLevel.gamma, out var value); + entity.Comp.Group = value; + } + else // Все остальные доступы + { + entity.Comp.Group = string.Empty; + } + } } diff --git a/Content.Shared/Access/Components/AccessReaderComponent.cs b/Content.Shared/Access/Components/AccessReaderComponent.cs index 804137e0fd6..e414146a017 100644 --- a/Content.Shared/Access/Components/AccessReaderComponent.cs +++ b/Content.Shared/Access/Components/AccessReaderComponent.cs @@ -1,8 +1,11 @@ +using System.Text.RegularExpressions; using Content.Shared.StationRecords; +using Content.Shared.Weapons.Melee; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set; +using Robust.Shared.Toolshed.Syntax; namespace Content.Shared.Access.Components; @@ -20,10 +23,20 @@ public sealed partial class AccessReaderComponent : Component [DataField] public bool Enabled = true; + // Sunrise-start + + /// + /// Именно от Group происходит проверка аварийных доступов + /// [ViewVariables(VVAccess.ReadWrite)] - [DataField("alertAccesses")] - public Dictionary> AlertAccesses = new(); + [DataField] + public ProtoId Group { get; set; } = string.Empty; + [ViewVariables(VVAccess.ReadWrite)] + [DataField] + public Dictionary> AlertAccesses { get; set; } = new(); + + [Flags] public enum CurrentAlertLevel : byte { blue, @@ -31,6 +44,8 @@ public enum CurrentAlertLevel : byte yellow, gamma } + // Sunrise-end + /// /// The set of tags that will automatically deny an allowed check, if any of them are present. /// @@ -111,13 +126,15 @@ public sealed class AccessReaderComponentState : ComponentState public List>> AccessLists; + public ProtoId Group; // Sunrise-alertAccesses + public List<(NetEntity, uint)> AccessKeys; public Queue AccessLog; public int AccessLogLimit; - public AccessReaderComponentState(bool enabled, HashSet> denyTags, List>> accessLists, List<(NetEntity, uint)> accessKeys, Queue accessLog, int accessLogLimit) + public AccessReaderComponentState(bool enabled, HashSet> denyTags, List>> accessLists, ProtoId group, List<(NetEntity, uint)> accessKeys, Queue accessLog, int accessLogLimit) { Enabled = enabled; DenyTags = denyTags; @@ -125,6 +142,7 @@ public AccessReaderComponentState(bool enabled, HashSet> acce public bool AreAccessTagsAllowedAlert(ICollection> access, AccessReaderComponent reader) { - foreach (var (stationCode, alertAccesses) in reader.AlertAccesses) - { - if (!_prototype.TryIndex(alertAccesses, out var accessTags)) - return false; + if (reader.Group == string.Empty) + return false; - if (accessTags == null) - return false; + if (!_prototype.TryIndex(reader.Group, out var accessTags)) + return false; - if (accessTags.Tags.Count == 0) - return false; + if (accessTags == null) + return false; - if (accessTags.Tags.IsSubsetOf(access)) + if (accessTags.Tags.Count == 0) + return false; + foreach (var ent in accessTags.Tags) + { + if (access.Contains(ent)) return true; } + return false; } diff --git a/Resources/Prototypes/Entities/Objects/Devices/Electronics/door_access.yml b/Resources/Prototypes/Entities/Objects/Devices/Electronics/door_access.yml index c0bbb2e5275..0e2cf98938b 100644 --- a/Resources/Prototypes/Entities/Objects/Devices/Electronics/door_access.yml +++ b/Resources/Prototypes/Entities/Objects/Devices/Electronics/door_access.yml @@ -89,6 +89,10 @@ components: - type: AccessReader access: [["Janitor"]] + alertAccesses: + red: RedAlertAccesses + blue: BlueAlertAccesses + yellow: YellowAlertAccesses - type: entity parent: DoorElectronics @@ -105,6 +109,9 @@ components: - type: AccessReader access: [["Service"]] + alertAccess: + red: RedAlertAccesses + yellow: YellowAlertAccesses # Cargo - type: entity diff --git a/Resources/Prototypes/_Sunrise/Access/AccessGroup/access_group.yml b/Resources/Prototypes/_Sunrise/Access/AccessGroup/access_group.yml index 9a3526ea38a..3a2a0763c5d 100644 --- a/Resources/Prototypes/_Sunrise/Access/AccessGroup/access_group.yml +++ b/Resources/Prototypes/_Sunrise/Access/AccessGroup/access_group.yml @@ -2,21 +2,25 @@ id: RedAlertAccesses tags: - Security + - HeadOfSecurity - type: accessGroup - id: SecurityBlueAlertAccesses + id: BlueAlertAccesses tags: - - Maintance + - Security + - HeadOfSecurity - type: accessGroup - id: SecurityGammaAlertAccesses + id: YellowAlertAccesses tags: - - Command - - Captain - - HeadOfPersonnel - - Cryogenics - - BlueShield - - Ntrep + - Engineering + - HeadOfSecurity + +- type: accessGroup + id: GammaAlertAccesses + tags: + - Security + - HeadOfSecurity # Потом дополню доступы From 189121935581621b7ce003579b933c1c8504bab3 Mon Sep 17 00:00:00 2001 From: iertis Date: Mon, 6 Jan 2025 17:01:44 +0300 Subject: [PATCH 06/13] fixes --- Content.Server/Access/Systems/AccessSystem.cs | 55 +++++++++---------- .../Components/AccessReaderComponent.cs | 9 ++- .../Access/Systems/AccessReaderSystem.cs | 11 +++- .../Access/AccessGroup/access_group.yml | 13 ++++- 4 files changed, 51 insertions(+), 37 deletions(-) diff --git a/Content.Server/Access/Systems/AccessSystem.cs b/Content.Server/Access/Systems/AccessSystem.cs index 81c7dca120a..425bcdf850d 100644 --- a/Content.Server/Access/Systems/AccessSystem.cs +++ b/Content.Server/Access/Systems/AccessSystem.cs @@ -3,13 +3,11 @@ using Content.Server.Station.Systems; using Content.Server.AlertLevel; using Content.Shared.Station.Components; -namespace Content.Server.Access.Systems; + +namespace Content.Server.Access.Systems; //Sunrise-edited public sealed class AccessSystem : SharedAccessSystem { - // - // Запускает обновление уровня аварийных доступов на всех сущностях с AccessReaderComponent - // [Dependency] private readonly StationSystem _station = default!; public override void Initialize() @@ -18,9 +16,12 @@ public override void Initialize() SubscribeLocalEvent(OnAlertLevelChanged); } - + /// + /// Запускает обновление уровня аварийных доступов на всех сущностях с AccessReaderComponent + /// private void OnAlertLevelChanged(AlertLevelChangedEvent ev) { + if (!TryComp(ev.Station, out var alert)) return; @@ -30,6 +31,7 @@ private void OnAlertLevelChanged(AlertLevelChangedEvent ev) var query = EntityQueryEnumerator(); while (query.MoveNext(out var uid, out var reader, out var xform)) { + if (CompOrNull(xform.GridUid)?.Station != ev.Station) continue; @@ -47,9 +49,9 @@ private void OnAlertLevelChanged(AlertLevelChangedEvent ev) } } - // - // Устанавливает значение из прототипа в зависимости от кода - // + /// + /// Устанавливает значение из прототипа в зависимости от кода + /// public void Update(Entity entity) { @@ -62,30 +64,23 @@ public void Update(Entity entity) if (alerts.AlertLevels == null) return; - if (alerts.CurrentLevel.Contains("blue")) - { - entity.Comp.AlertAccesses.TryGetValue(AccessReaderComponent.CurrentAlertLevel.blue, out var value); - entity.Comp.Group = value; - } - else if (alerts.CurrentLevel.Contains("red")) + var alertLevels = new Dictionary { - entity.Comp.AlertAccesses.TryGetValue(AccessReaderComponent.CurrentAlertLevel.red, out var value); - entity.Comp.Group = value; - Dirty(entity); - } - else if (alerts.CurrentLevel.Contains("yellow")) - { - entity.Comp.AlertAccesses.TryGetValue(AccessReaderComponent.CurrentAlertLevel.yellow, out var value); - entity.Comp.Group = value; - } - else if (alerts.CurrentLevel.Contains("gamma")) - { - entity.Comp.AlertAccesses.TryGetValue(AccessReaderComponent.CurrentAlertLevel.gamma, out var value); - entity.Comp.Group = value; - } - else // Все остальные доступы + { "blue", AccessReaderComponent.CurrentAlertLevel.blue }, + { "red", AccessReaderComponent.CurrentAlertLevel.red }, + { "yellow", AccessReaderComponent.CurrentAlertLevel.yellow }, + { "gamma", AccessReaderComponent.CurrentAlertLevel.gamma } + }; + + entity.Comp.Group = string.Empty; // Значение по умолчанию + foreach (var level in alertLevels) { - entity.Comp.Group = string.Empty; + if (alerts.CurrentLevel.Contains(level.Key)) + { + entity.Comp.AlertAccesses.TryGetValue(level.Value, out var value); + entity.Comp.Group = value; + break; + } } } } diff --git a/Content.Shared/Access/Components/AccessReaderComponent.cs b/Content.Shared/Access/Components/AccessReaderComponent.cs index e414146a017..16211305b61 100644 --- a/Content.Shared/Access/Components/AccessReaderComponent.cs +++ b/Content.Shared/Access/Components/AccessReaderComponent.cs @@ -126,7 +126,7 @@ public sealed class AccessReaderComponentState : ComponentState public List>> AccessLists; - public ProtoId Group; // Sunrise-alertAccesses + public ProtoId Group; // Sunrise-alertAccesses, нужно для связывания клиента с сервером public List<(NetEntity, uint)> AccessKeys; @@ -134,7 +134,12 @@ public sealed class AccessReaderComponentState : ComponentState public int AccessLogLimit; - public AccessReaderComponentState(bool enabled, HashSet> denyTags, List>> accessLists, ProtoId group, List<(NetEntity, uint)> accessKeys, Queue accessLog, int accessLogLimit) + public AccessReaderComponentState(bool enabled, HashSet> denyTags, + List>> accessLists, + ProtoId group, + List<(NetEntity, uint)> accessKeys, + Queue accessLog, + int accessLogLimit) //Sunrise-edit { Enabled = enabled; DenyTags = denyTags; diff --git a/Content.Shared/Access/Systems/AccessReaderSystem.cs b/Content.Shared/Access/Systems/AccessReaderSystem.cs index a52d578dc88..390daa73b6b 100644 --- a/Content.Shared/Access/Systems/AccessReaderSystem.cs +++ b/Content.Shared/Access/Systems/AccessReaderSystem.cs @@ -43,7 +43,7 @@ public override void Initialize() private void OnGetState(EntityUid uid, AccessReaderComponent component, ref ComponentGetState args) { args.State = new AccessReaderComponentState(component.Enabled, component.DenyTags, component.AccessLists, component.Group, - _recordsSystem.Convert(component.AccessKeys), component.AccessLog, component.AccessLogLimit); + _recordsSystem.Convert(component.AccessKeys), component.AccessLog, component.AccessLogLimit); // Sunrise-edit } private void OnHandleState(EntityUid uid, AccessReaderComponent component, ref ComponentHandleState args) @@ -64,7 +64,7 @@ private void OnHandleState(EntityUid uid, AccessReaderComponent component, ref C component.AccessLists = new(state.AccessLists); component.DenyTags = new(state.DenyTags); component.AccessLog = new(state.AccessLog); - component.Group = new(state.Group); + component.Group = new(state.Group); // Sunrise-alertAccesses component.AccessLogLimit = state.AccessLogLimit; } @@ -167,8 +167,10 @@ public bool IsAllowed( if (!TryComp(entity, out AccessReaderComponent? containedReader)) continue; + // Sunrise-start if (AreAccessTagsAllowedAlert(access, containedReader)) return true; + // Sunrise-end if (IsAllowed(access, stationKeys, entity, containedReader)) return true; @@ -213,6 +215,10 @@ public bool AreAccessTagsAllowed(ICollection> acce return false; } + // Sunrise-start + /// + /// Сравнивает список аварийных доступов с доступами на карте. + /// public bool AreAccessTagsAllowedAlert(ICollection> access, AccessReaderComponent reader) { if (reader.Group == string.Empty) @@ -234,6 +240,7 @@ public bool AreAccessTagsAllowedAlert(ICollection> return false; } + // Sunrise-end /// /// Compares the given stationrecordkeys with the accessreader to see if it is allowed. diff --git a/Resources/Prototypes/_Sunrise/Access/AccessGroup/access_group.yml b/Resources/Prototypes/_Sunrise/Access/AccessGroup/access_group.yml index 3a2a0763c5d..60c06d8ff85 100644 --- a/Resources/Prototypes/_Sunrise/Access/AccessGroup/access_group.yml +++ b/Resources/Prototypes/_Sunrise/Access/AccessGroup/access_group.yml @@ -1,20 +1,27 @@ - type: accessGroup id: RedAlertAccesses tags: - - Security - HeadOfSecurity + - Security + - Armory + - Detective + - Cryogenics - type: accessGroup id: BlueAlertAccesses tags: - - Security - HeadOfSecurity + - Security + - Armory + - Detective + - Cryogenics - type: accessGroup id: YellowAlertAccesses tags: + - ChiefEngineer - Engineering - - HeadOfSecurity + - Atmospherics - type: accessGroup id: GammaAlertAccesses From b6ca0d49c3c1e7e657789f6b68a29283981a92b7 Mon Sep 17 00:00:00 2001 From: iertis Date: Mon, 6 Jan 2025 17:04:06 +0300 Subject: [PATCH 07/13] oops --- .../_Sunrise/Access/AccessGroup/access_group.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Resources/Prototypes/_Sunrise/Access/AccessGroup/access_group.yml b/Resources/Prototypes/_Sunrise/Access/AccessGroup/access_group.yml index 60c06d8ff85..f9467a8cbfd 100644 --- a/Resources/Prototypes/_Sunrise/Access/AccessGroup/access_group.yml +++ b/Resources/Prototypes/_Sunrise/Access/AccessGroup/access_group.yml @@ -5,29 +5,24 @@ - Security - Armory - Detective - - Cryogenics - type: accessGroup id: BlueAlertAccesses tags: - HeadOfSecurity - Security - - Armory - Detective - - Cryogenics - type: accessGroup id: YellowAlertAccesses tags: - ChiefEngineer - - Engineering - Atmospherics - type: accessGroup id: GammaAlertAccesses tags: - - Security - HeadOfSecurity - -# Потом дополню доступы + - Security + - Detective From 469a3da0f18f8a881049aaf776f45ef99b32e70d Mon Sep 17 00:00:00 2001 From: iertis Date: Mon, 6 Jan 2025 17:06:18 +0300 Subject: [PATCH 08/13] =?UTF-8?q?=D0=B2=D1=80=D0=BE=D0=B4=D0=B5=20=D0=B1?= =?UTF-8?q?=D0=B5=D1=81=D0=BF=D0=BE=D0=BB=D0=B5=D0=B7=D0=BD=D0=B0=D1=8F=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Content.Server/Access/Systems/AccessSystem.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/Content.Server/Access/Systems/AccessSystem.cs b/Content.Server/Access/Systems/AccessSystem.cs index 425bcdf850d..b4fe768e0d3 100644 --- a/Content.Server/Access/Systems/AccessSystem.cs +++ b/Content.Server/Access/Systems/AccessSystem.cs @@ -58,9 +58,6 @@ public void Update(Entity entity) if (!TryComp(_station.GetOwningStation(entity.Owner), out var alerts)) return; - if (entity.Comp.AlertAccesses.Count == 0) - return; - if (alerts.AlertLevels == null) return; From d59814da5b97d2240c63ec243cc269bdcbf7d8b6 Mon Sep 17 00:00:00 2001 From: iertis Date: Mon, 6 Jan 2025 18:46:30 +0300 Subject: [PATCH 09/13] final --- Content.Server/Access/Systems/AccessSystem.cs | 3 +- .../Components/AccessReaderComponent.cs | 3 +- .../Devices/Electronics/door_access.yml | 231 +++++++++++++++++- 3 files changed, 232 insertions(+), 5 deletions(-) diff --git a/Content.Server/Access/Systems/AccessSystem.cs b/Content.Server/Access/Systems/AccessSystem.cs index b4fe768e0d3..1533f877431 100644 --- a/Content.Server/Access/Systems/AccessSystem.cs +++ b/Content.Server/Access/Systems/AccessSystem.cs @@ -66,7 +66,8 @@ public void Update(Entity entity) { "blue", AccessReaderComponent.CurrentAlertLevel.blue }, { "red", AccessReaderComponent.CurrentAlertLevel.red }, { "yellow", AccessReaderComponent.CurrentAlertLevel.yellow }, - { "gamma", AccessReaderComponent.CurrentAlertLevel.gamma } + { "gamma", AccessReaderComponent.CurrentAlertLevel.gamma }, + { "delta", AccessReaderComponent.CurrentAlertLevel.delta } }; entity.Comp.Group = string.Empty; // Значение по умолчанию diff --git a/Content.Shared/Access/Components/AccessReaderComponent.cs b/Content.Shared/Access/Components/AccessReaderComponent.cs index 16211305b61..07008f92c82 100644 --- a/Content.Shared/Access/Components/AccessReaderComponent.cs +++ b/Content.Shared/Access/Components/AccessReaderComponent.cs @@ -42,7 +42,8 @@ public enum CurrentAlertLevel : byte blue, red, yellow, - gamma + gamma, + delta } // Sunrise-end diff --git a/Resources/Prototypes/Entities/Objects/Devices/Electronics/door_access.yml b/Resources/Prototypes/Entities/Objects/Devices/Electronics/door_access.yml index 0e2cf98938b..68225fbe94e 100644 --- a/Resources/Prototypes/Entities/Objects/Devices/Electronics/door_access.yml +++ b/Resources/Prototypes/Entities/Objects/Devices/Electronics/door_access.yml @@ -6,6 +6,12 @@ components: - type: AccessReader access: [["Captain"]] + # Sunrise-start + alertAccesses: + red: RedAlertAccesses + gamma: GammaAlertAccesses + delta: AllAccess + # Sunrise-end - type: entity parent: DoorElectronics @@ -14,6 +20,10 @@ components: - type: AccessReader access: [["HeadOfPersonnel"]] + # Sunrise-start + alertAccesses: + delta: AllAccess + # Sunrise-end - type: entity parent: DoorElectronics @@ -22,8 +32,14 @@ components: - type: AccessReader access: [["Command"]] + # Sunrise-start alertAccesses: - red: RedAlertAccess + red: RedAlertAccesses + gamma: GammaAlertAccesses + delta: AllAccess + # Sunrise-end + + # Service - type: entity @@ -33,6 +49,15 @@ components: - type: AccessReader access: [["Bar"]] + # Sunrise-start + alertAccesses: + red: RedAlertAccesses + yellow: YellowAlertAccesses + gamma: GammaAlertAccesses + delta: AllAccess + # Sunrise-end + + - type: entity parent: DoorElectronics @@ -41,6 +66,15 @@ components: - type: AccessReader access: [["Bar"], ["Kitchen"]] + # Sunrise-start + alertAccesses: + red: RedAlertAccesses + yellow: YellowAlertAccesses + gamma: GammaAlertAccesses + delta: AllAccess + # Sunrise-end + + - type: entity parent: DoorElectronics @@ -49,6 +83,14 @@ components: - type: AccessReader access: [["Hydroponics"]] + # Sunrise-start + alertAccesses: + red: RedAlertAccesses + yellow: YellowAlertAccesses + gamma: GammaAlertAccesses + delta: AllAccess + # Sunrise-end + - type: entity parent: DoorElectronics @@ -57,6 +99,15 @@ components: - type: AccessReader access: [["Chapel"]] + # Sunrise-start + alertAccesses: + red: RedAlertAccesses + yellow: YellowAlertAccesses + gamma: GammaAlertAccesses + delta: AllAccess + # Sunrise-end + + - type: entity parent: DoorElectronics @@ -65,6 +116,15 @@ components: - type: AccessReader access: [["Theatre"]] + # Sunrise-start + alertAccesses: + red: RedAlertAccesses + yellow: YellowAlertAccesses + gamma: GammaAlertAccesses + delta: AllAccess + # Sunrise-end + + - type: entity parent: DoorElectronics @@ -73,6 +133,15 @@ components: - type: AccessReader access: [["Kitchen"]] + # Sunrise-start + alertAccesses: + red: RedAlertAccesses + yellow: YellowAlertAccesses + gamma: GammaAlertAccesses + delta: AllAccess + # Sunrise-end + + - type: entity parent: DoorElectronics @@ -81,6 +150,15 @@ components: - type: AccessReader access: [["Kitchen"], ["Hydroponics"]] + # Sunrise-start + alertAccesses: + red: RedAlertAccesses + yellow: YellowAlertAccesses + gamma: GammaAlertAccesses + delta: AllAccess + # Sunrise-end + + - type: entity parent: DoorElectronics @@ -89,10 +167,14 @@ components: - type: AccessReader access: [["Janitor"]] + # Sunrise-start alertAccesses: red: RedAlertAccesses - blue: BlueAlertAccesses yellow: YellowAlertAccesses + gamma: GammaAlertAccesses + delta: AllAccess + # Sunrise-end + - type: entity parent: DoorElectronics @@ -101,6 +183,15 @@ components: - type: AccessReader access: [["Lawyer"]] + # Sunrise-start + alertAccesses: + red: RedAlertAccesses + yellow: YellowAlertAccesses + gamma: GammaAlertAccesses + delta: AllAccess + # Sunrise-end + + - type: entity parent: DoorElectronics @@ -109,9 +200,14 @@ components: - type: AccessReader access: [["Service"]] - alertAccess: + # Sunrise-start + alertAccesses: red: RedAlertAccesses yellow: YellowAlertAccesses + gamma: GammaAlertAccesses + delta: AllAccess + # Sunrise-end + # Cargo - type: entity @@ -121,6 +217,10 @@ components: - type: AccessReader access: [["Quartermaster"]] + # Sunrise-start + alertAccesses: + delta: AllAccess + # Sunrise-end - type: entity parent: DoorElectronics @@ -129,6 +229,14 @@ components: - type: AccessReader access: [["Salvage"]] + # Sunrise-start + alertAccesses: + red: RedAlertAccesses + yellow: YellowAlertAccesses + gamma: GammaAlertAccesses + delta: AllAccess + # Sunrise-end + - type: entity parent: DoorElectronics @@ -137,6 +245,14 @@ components: - type: AccessReader access: [["Cargo"]] + # Sunrise-start + alertAccesses: + red: RedAlertAccesses + yellow: YellowAlertAccesses + gamma: GammaAlertAccesses + delta: AllAccess + # Sunrise-end + # Engineering - type: entity @@ -146,6 +262,10 @@ components: - type: AccessReader access: [["ChiefEngineer"]] + # Sunrise-start + alertAccesses: + delta: AllAccess + # Sunrise-end - type: entity parent: DoorElectronics @@ -154,6 +274,13 @@ components: - type: AccessReader access: [["Atmospherics"]] + # Sunrise-start + alertAccesses: + red: RedAlertAccesses + gamma: GammaAlertAccesses + delta: AllAccess + # Sunrise-end + - type: entity parent: DoorElectronics @@ -162,6 +289,13 @@ components: - type: AccessReader access: [["Engineering"]] + # Sunrise-start + alertAccesses: + red: RedAlertAccesses + gamma: GammaAlertAccesses + delta: AllAccess + # Sunrise-end + # Science - type: entity @@ -171,6 +305,14 @@ components: - type: AccessReader access: [["Medical"], ["Detective"], ["Chapel"]] + # Sunrise-start + alertAccesses: + red: RedAlertAccesses + yellow: YellowAlertAccesses + gamma: GammaAlertAccesses + delta: AllAccess + # Sunrise-end + - type: entity parent: DoorElectronics @@ -179,6 +321,10 @@ components: - type: AccessReader access: [["ResearchDirector"]] + # Sunrise-start + alertAccesses: + delta: AllAccess + # Sunrise-end - type: entity parent: DoorElectronics @@ -187,6 +333,14 @@ components: - type: AccessReader access: [["Research"], ["Medical"]] + # Sunrise-start + alertAccesses: + red: RedAlertAccesses + yellow: YellowAlertAccesses + gamma: GammaAlertAccesses + delta: AllAccess + # Sunrise-end + - type: entity parent: DoorElectronics @@ -195,6 +349,13 @@ components: - type: AccessReader access: [["Research"]] + # Sunrise-start + alertAccesses: + red: RedAlertAccesses + yellow: YellowAlertAccesses + gamma: GammaAlertAccesses + delta: AllAccess + # Sunrise-end # Security - type: entity @@ -204,6 +365,11 @@ components: - type: AccessReader access: [["HeadOfSecurity"]] + # Sunrise-start + alertAccesses: + delta: AllAccess + # Sunrise-end + - type: entity parent: DoorElectronics @@ -212,6 +378,10 @@ components: - type: AccessReader access: [["Armory"]] + # Sunrise-start + alertAccesses: + delta: AllAccess + # Sunrise-end - type: entity parent: DoorElectronics @@ -220,6 +390,11 @@ components: - type: AccessReader access: [["Detective"]] + # Sunrise-start + alertAccesses: + red: RedAlertAccesses + gamma: GammaAlertAccesses + # Sunrise-end - type: entity parent: DoorElectronics @@ -228,6 +403,11 @@ components: - type: AccessReader access: [["Security"]] + # Sunrise-start + alertAccesses: + delta: AllAccess + # Sunrise-end + - type: entity parent: DoorElectronics @@ -236,6 +416,11 @@ components: - type: AccessReader access: [["Security"], ["Lawyer"]] + # Sunrise-start + alertAccesses: + delta: AllAccess + # Sunrise-end + - type: entity parent: DoorElectronics @@ -244,6 +429,11 @@ components: - type: AccessReader access: [["Brig"]] + # Sunrise-start + alertAccesses: + yellow: YellowAlertAccesses + delta: AllAccess + # Sunrise-end # Medical - type: entity @@ -253,6 +443,11 @@ components: - type: AccessReader access: [["ChiefMedicalOfficer"]] + # Sunrise-start + alertAccesses: + delta: AllAccess + # Sunrise-end + - type: entity parent: DoorElectronics @@ -261,6 +456,13 @@ components: - type: AccessReader access: [["Chemistry"]] + # Sunrise-start + alertAccesses: + red: RedAlertAccesses + yellow: YellowAlertAccesses + gamma: GammaAlertAccesses + delta: AllAccess + # Sunrise-end - type: entity parent: DoorElectronics @@ -269,6 +471,13 @@ components: - type: AccessReader access: [["Medical"]] + # Sunrise-start + alertAccesses: + red: RedAlertAccesses + yellow: YellowAlertAccesses + gamma: GammaAlertAccesses + delta: AllAccess + # Sunrise-end # Syndicate - type: entity @@ -303,6 +512,12 @@ components: - type: AccessReader access: [["External"]] + # Sunrise-start + alertAccesses: + red: RedAlertAccesses + gamma: GammaAlertAccesses + delta: AllAccess + # Sunrise-end - type: entity parent: DoorElectronics @@ -311,6 +526,11 @@ components: - type: AccessReader access: [["Maintenance"]] + # Sunrise-start + alertAccesses: + delta: AllAccess + # Sunrise-end + - type: entity parent: DoorElectronics @@ -319,3 +539,8 @@ components: - type: AccessReader access: [["Security"], ["Command"]] + # Sunrise-start + alertAccesses: + delta: AllAccess + # Sunrise-end + From 652b2a824d5e4f7aebac782190ec0b036f2cbaff Mon Sep 17 00:00:00 2001 From: iertis Date: Mon, 6 Jan 2025 18:53:06 +0300 Subject: [PATCH 10/13] =?UTF-8?q?=D0=B7=D0=B0=D0=B1=D1=8B=D0=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Locale/ru-RU/_strings/alert-levels/alert-levels.ftl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Resources/Locale/ru-RU/_strings/alert-levels/alert-levels.ftl b/Resources/Locale/ru-RU/_strings/alert-levels/alert-levels.ftl index 14f78a8ac70..19bc044aac8 100644 --- a/Resources/Locale/ru-RU/_strings/alert-levels/alert-levels.ftl +++ b/Resources/Locale/ru-RU/_strings/alert-levels/alert-levels.ftl @@ -9,19 +9,19 @@ alert-level-blue-announcement = На станции присутствует н alert-level-blue-instructions = Каждый сотрудник обязан носить свою ID-карту в своём КПК. Также членам экипажа рекомендуется проявлять бдительность и сообщать службе безопасности o любой подозрительной активности. alert-level-red = Красный alert-level-red-announcement = На станции присутствует известная угроза. Служба безопасности имеет право применять летальную силу по необходимости. Все члены экипажа, за исключением должностных лиц, обязаны проследовать в свои отделы и ожидать дальнейших инструкций до отмены кода. -alert-level-red-instructions = Экипаж обязан подчиняться правомерным приказам сотрудников Службы Безопасности. Переключите режим работы своего костюма в режим "Координаты" и находитесь в своём отделе. +alert-level-red-instructions = Экипаж обязан подчиняться правомерным приказам сотрудников Службы Безопасности. Переключите режим работы своего костюма в режим "Координаты" и находитесь в своём отделе. Доступы службы безопасности расширены. alert-level-violet = Фиолетовый alert-level-violet-announcement = На станции присутствует угроза вируса. Членам экипажа рекомендуется держать дистанцию между собой и соблюдать меры безопасности по предотвращению дальнейшего распространения вируса. alert-level-violet-instructions = Членам экипажа рекомендуется держать дистанцию между собой и соблюдать меры безопасности по предотвращению дальнейшего распространения вируса. Если вы чувствуете себя плохо - вам следует незамедлительно пройти на обследование, надев заранее стерильную маску. alert-level-yellow = Жёлтый -alert-level-yellow-announcement = На станции присутствует структурная или атмосферная угроза. Инженерно-техническому персоналу требуется немедленно предпринять меры по устранению угрозы. Всем остальным сотрудникам запрещено находиться в опасном участке. +alert-level-yellow-announcement = На станции присутствует структурная или атмосферная угроза. Инженерно-техническому персоналу выданы дополнительные доступы, им требуется немедленно предпринять меры по устранению угрозы. Всем остальным сотрудникам запрещено находиться в опасном участке. alert-level-yellow-instructions = Членам экипажа необходимо в срочном порядке покинуть опасную зону и, по возможности, оставаться на своих рабочих местах. alert-level-gamma = Гамма alert-level-gamma-announcement = Центральное командование объявило на станции уровень угрозы "Гамма". Служба безопасности должна постоянно иметь при себе оружие, гражданский персонал обязан немедленно обратиться к главам отделов для получения указаний к эвакуации. -alert-level-gamma-instructions = Гражданский персонал обязан немедленно обратиться к главам отделов для получения указаний к эвакуации. Корпорация Nanotrasen заверяет вас - опасность скоро будет нейтрализована. +alert-level-gamma-instructions = Гражданский персонал обязан немедленно обратиться к главам отделов для получения указаний к эвакуации. Корпорация Nanotrasen заверяет вас - опасность скоро будет нейтрализована. Доступы службы безопасности расширены. alert-level-delta = Дельта alert-level-delta-announcement = Станция находится под угрозой неминуемого уничтожения. Членам экипажа рекомендуется слушать глав отделов для получения дополнительной информации. Службе Безопасности приказано работать по протоколу Дельта. -alert-level-delta-instructions = Членам экипажа необходимо слушать глав отделов для получения дополнительной информации. От этого зависит ваше здоровье и безопасность. +alert-level-delta-instructions = Членам экипажа необходимо слушать глав отделов для получения дополнительной информации. От этого зависит ваше здоровье и безопасность. Доступ переведен в аварийный на всех шлюзах. alert-level-epsilon = Эпсилон alert-level-epsilon-announcement = Центральное командование объявило на станции уровень угрозы "Эпсилон". Все контракты расторгнуты. Спасибо, что выбрали Nanotrasen. alert-level-epsilon-instructions = Все контракты расторгнуты. From 2f02f93efd167814f284002092ae415ef4c521a0 Mon Sep 17 00:00:00 2001 From: iertis Date: Mon, 6 Jan 2025 18:55:32 +0300 Subject: [PATCH 11/13] =?UTF-8?q?=D0=BF=D0=B5=D1=80=D1=84=D0=B5=D0=BA?= =?UTF-8?q?=D1=86=D0=B8=D0=BE=D0=BD=D0=B8=D0=B7=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Resources/Locale/ru-RU/_strings/alert-levels/alert-levels.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/Locale/ru-RU/_strings/alert-levels/alert-levels.ftl b/Resources/Locale/ru-RU/_strings/alert-levels/alert-levels.ftl index 19bc044aac8..b95e46becc1 100644 --- a/Resources/Locale/ru-RU/_strings/alert-levels/alert-levels.ftl +++ b/Resources/Locale/ru-RU/_strings/alert-levels/alert-levels.ftl @@ -21,7 +21,7 @@ alert-level-gamma-announcement = Центральное командование alert-level-gamma-instructions = Гражданский персонал обязан немедленно обратиться к главам отделов для получения указаний к эвакуации. Корпорация Nanotrasen заверяет вас - опасность скоро будет нейтрализована. Доступы службы безопасности расширены. alert-level-delta = Дельта alert-level-delta-announcement = Станция находится под угрозой неминуемого уничтожения. Членам экипажа рекомендуется слушать глав отделов для получения дополнительной информации. Службе Безопасности приказано работать по протоколу Дельта. -alert-level-delta-instructions = Членам экипажа необходимо слушать глав отделов для получения дополнительной информации. От этого зависит ваше здоровье и безопасность. Доступ переведен в аварийный на всех шлюзах. +alert-level-delta-instructions = Членам экипажа необходимо слушать глав отделов для получения дополнительной информации. От этого зависит ваше здоровье и безопасность. Доступ на всех шлюзах переведен в аварийный. alert-level-epsilon = Эпсилон alert-level-epsilon-announcement = Центральное командование объявило на станции уровень угрозы "Эпсилон". Все контракты расторгнуты. Спасибо, что выбрали Nanotrasen. alert-level-epsilon-instructions = Все контракты расторгнуты. From 40747a1a8e7ac6a1d75061b281965b6b6b1229d9 Mon Sep 17 00:00:00 2001 From: iertis Date: Mon, 6 Jan 2025 19:00:31 +0300 Subject: [PATCH 12/13] varden --- .../Prototypes/_Sunrise/Access/AccessGroup/access_group.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/Resources/Prototypes/_Sunrise/Access/AccessGroup/access_group.yml b/Resources/Prototypes/_Sunrise/Access/AccessGroup/access_group.yml index f9467a8cbfd..2fcad8782a6 100644 --- a/Resources/Prototypes/_Sunrise/Access/AccessGroup/access_group.yml +++ b/Resources/Prototypes/_Sunrise/Access/AccessGroup/access_group.yml @@ -24,5 +24,6 @@ tags: - HeadOfSecurity - Security + - Armory - Detective From f7b97416db27f72ad146400ea37df3d9ef0b7a3c Mon Sep 17 00:00:00 2001 From: iertis Date: Mon, 6 Jan 2025 19:28:38 +0300 Subject: [PATCH 13/13] uh --- Content.Shared/Access/Components/AccessReaderComponent.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Content.Shared/Access/Components/AccessReaderComponent.cs b/Content.Shared/Access/Components/AccessReaderComponent.cs index 07008f92c82..17279ebced7 100644 --- a/Content.Shared/Access/Components/AccessReaderComponent.cs +++ b/Content.Shared/Access/Components/AccessReaderComponent.cs @@ -29,12 +29,11 @@ public sealed partial class AccessReaderComponent : Component /// Именно от Group происходит проверка аварийных доступов /// [ViewVariables(VVAccess.ReadWrite)] - [DataField] - public ProtoId Group { get; set; } = string.Empty; + public ProtoId Group = string.Empty; [ViewVariables(VVAccess.ReadWrite)] [DataField] - public Dictionary> AlertAccesses { get; set; } = new(); + public Dictionary> AlertAccesses = new(); [Flags] public enum CurrentAlertLevel : byte