diff --git a/Content.Server/GameObjects/Components/Access/AccessReaderComponent.cs b/Content.Server/GameObjects/Components/Access/AccessReaderComponent.cs index 1652a3863f..24fbb5e26c 100644 --- a/Content.Server/GameObjects/Components/Access/AccessReaderComponent.cs +++ b/Content.Server/GameObjects/Components/Access/AccessReaderComponent.cs @@ -6,9 +6,13 @@ using Content.Server.GameObjects.Components.GUI; using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.Interfaces; using Content.Server.Interfaces.GameObjects.Components.Items; +using Content.Shared.Access; using Content.Shared.GameObjects.Components.Inventory; using JetBrains.Annotations; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; +using Robust.Shared.Log; +using Robust.Shared.Prototypes; using Robust.Shared.Serialization; using Robust.Shared.ViewVariables; @@ -103,6 +107,20 @@ namespace Content.Server.GameObjects.Components.Access return Array.Empty(); } + public override void Initialize() + { + base.Initialize(); + + var proto = IoCManager.Resolve(); + foreach (var level in AccessLists.SelectMany(c => c).Union(DenyTags)) + { + if (!proto.HasIndex(level)) + { + Logger.ErrorS("access", $"Invalid access level: {level}"); + } + } + } + public override void ExposeData(ObjectSerializer serializer) { base.ExposeData(serializer); diff --git a/Resources/Prototypes/AccessLevels/cargo.yml b/Resources/Prototypes/AccessLevels/cargo.yml index 4f42b57183..5c97b16051 100644 --- a/Resources/Prototypes/AccessLevels/cargo.yml +++ b/Resources/Prototypes/AccessLevels/cargo.yml @@ -1,5 +1,5 @@ -- type: accessLevel - id: Quartermaster +#- type: accessLevel +# id: Quartermaster - type: accessLevel id: Cargo diff --git a/Resources/Prototypes/AccessLevels/engineering.yml b/Resources/Prototypes/AccessLevels/engineering.yml index d4ed2400f6..5da12d0981 100644 --- a/Resources/Prototypes/AccessLevels/engineering.yml +++ b/Resources/Prototypes/AccessLevels/engineering.yml @@ -1,6 +1,6 @@ -- type: accessLevel - id: ChiefEngineer - name: Chief Engineer +#- type: accessLevel +# id: ChiefEngineer +# name: Chief Engineer - type: accessLevel id: Engineering diff --git a/Resources/Prototypes/AccessLevels/medical.yml b/Resources/Prototypes/AccessLevels/medical.yml index a34269f712..37190ad2b9 100644 --- a/Resources/Prototypes/AccessLevels/medical.yml +++ b/Resources/Prototypes/AccessLevels/medical.yml @@ -1,6 +1,6 @@ -- type: accessLevel - id: ChiefMedicalOfficer - name: Chief Medical Officer +#- type: accessLevel +# id: ChiefMedicalOfficer +# name: Chief Medical Officer - type: accessLevel id: Medical diff --git a/Resources/Prototypes/AccessLevels/research.yml b/Resources/Prototypes/AccessLevels/research.yml index 774c325aa0..605641f9dc 100644 --- a/Resources/Prototypes/AccessLevels/research.yml +++ b/Resources/Prototypes/AccessLevels/research.yml @@ -1,6 +1,6 @@ -- type: accessLevel - id: ResearchDirector - name: Research Director +#- type: accessLevel +# id: ResearchDirector +# name: Research Director - type: accessLevel id: Research diff --git a/Resources/Prototypes/AccessLevels/security.yml b/Resources/Prototypes/AccessLevels/security.yml index d60271910a..4302263634 100644 --- a/Resources/Prototypes/AccessLevels/security.yml +++ b/Resources/Prototypes/AccessLevels/security.yml @@ -1,12 +1,12 @@ -- type: accessLevel - id: HeadOfSecurity - name: Head of Security +#- type: accessLevel +# id: HeadOfSecurity +# name: Head of Security - type: accessLevel id: Security -- type: accessLevel - id: Brig +#- type: accessLevel +# id: Brig -- type: accessLevel - id: Detective +#- type: accessLevel +# id: Detective diff --git a/Resources/Prototypes/AccessLevels/service.yml b/Resources/Prototypes/AccessLevels/service.yml index 392e3806fb..c509e8df6f 100644 --- a/Resources/Prototypes/AccessLevels/service.yml +++ b/Resources/Prototypes/AccessLevels/service.yml @@ -1,11 +1,11 @@ -- type: accessLevel - id: Bar +#- type: accessLevel +# id: Bar -- type: accessLevel - id: Kitchen +#- type: accessLevel +# id: Kitchen -- type: accessLevel - id: Hydroponics +#- type: accessLevel +# id: Hydroponics - type: accessLevel id: Service diff --git a/Resources/Prototypes/Entities/Constructible/Power/vending_machines.yml b/Resources/Prototypes/Entities/Constructible/Power/vending_machines.yml index 3780fddc96..c378ff584d 100644 --- a/Resources/Prototypes/Entities/Constructible/Power/vending_machines.yml +++ b/Resources/Prototypes/Entities/Constructible/Power/vending_machines.yml @@ -76,7 +76,7 @@ broken: true - type: WiresVisualizer - type: AccessReader - access: [["Bar"]] + access: [["Service"]] - type: entity parent: VendingMachine @@ -236,7 +236,7 @@ broken: true - type: WiresVisualizer - type: AccessReader - access: [["Kitchen"]] + access: [["Service"]] - type: entity parent: VendingMachine @@ -417,7 +417,7 @@ broken: true - type: WiresVisualizer - type: AccessReader - access: [["Hydroponics"]] + access: [["Service"]] - type: entity parent: VendingMachine @@ -525,7 +525,7 @@ broken: true - type: WiresVisualizer - type: AccessReader - access: [["Hydroponics"]] + access: [["Service"]] - type: entity parent: VendingMachine diff --git a/Resources/Prototypes/Entities/Constructible/Storage/Closets/Secure/bar.yml b/Resources/Prototypes/Entities/Constructible/Storage/Closets/Secure/bar.yml index 9eb47b1d76..2977b66400 100644 --- a/Resources/Prototypes/Entities/Constructible/Storage/Closets/Secure/bar.yml +++ b/Resources/Prototypes/Entities/Constructible/Storage/Closets/Secure/bar.yml @@ -9,4 +9,4 @@ - type: StorageVisualizer state: cabinet - type: AccessReader - access: [["Bar"]] + access: [["Service"]] diff --git a/Resources/Prototypes/Entities/Constructible/Storage/Closets/Secure/engineering.yml b/Resources/Prototypes/Entities/Constructible/Storage/Closets/Secure/engineering.yml index 15fc26e921..dfa5745b63 100644 --- a/Resources/Prototypes/Entities/Constructible/Storage/Closets/Secure/engineering.yml +++ b/Resources/Prototypes/Entities/Constructible/Storage/Closets/Secure/engineering.yml @@ -9,7 +9,7 @@ - type: StorageVisualizer state: ce - type: AccessReader - access: [ [ "ChiefEngineer" ] ] + access: [ [ "Engineering", "Command" ] ] # Electrical supplies - type: entity diff --git a/Resources/Prototypes/Entities/Constructible/Storage/Closets/Secure/hydroponics.yml b/Resources/Prototypes/Entities/Constructible/Storage/Closets/Secure/hydroponics.yml index 44bf4b3564..24e5a50fc7 100644 --- a/Resources/Prototypes/Entities/Constructible/Storage/Closets/Secure/hydroponics.yml +++ b/Resources/Prototypes/Entities/Constructible/Storage/Closets/Secure/hydroponics.yml @@ -8,4 +8,4 @@ - type: StorageVisualizer state: hydro - type: AccessReader - access: [ [ "Hydroponics" ] ] + access: [ [ "Service" ] ] diff --git a/Resources/Prototypes/Entities/Constructible/Storage/Closets/Secure/medical.yml b/Resources/Prototypes/Entities/Constructible/Storage/Closets/Secure/medical.yml index 07b0a00a50..da1b9081a1 100644 --- a/Resources/Prototypes/Entities/Constructible/Storage/Closets/Secure/medical.yml +++ b/Resources/Prototypes/Entities/Constructible/Storage/Closets/Secure/medical.yml @@ -50,4 +50,4 @@ - type: StorageVisualizer state: cmo - type: AccessReader - access: [ [ "ChiefMedicalOfficer" ] ] + access: [ [ "Medical", "Command" ] ] diff --git a/Resources/Prototypes/Entities/Constructible/Storage/Closets/Secure/scientist.yml b/Resources/Prototypes/Entities/Constructible/Storage/Closets/Secure/scientist.yml index ab2ec18270..1130a31566 100644 --- a/Resources/Prototypes/Entities/Constructible/Storage/Closets/Secure/scientist.yml +++ b/Resources/Prototypes/Entities/Constructible/Storage/Closets/Secure/scientist.yml @@ -8,7 +8,7 @@ - type: StorageVisualizer state: rd - type: AccessReader - access: [ [ "ResearchDirector" ] ] + access: [ [ "Research", "Command" ] ] - type: entity id: LockerScientist diff --git a/Resources/Prototypes/Entities/Constructible/Storage/Closets/Secure/security.yml b/Resources/Prototypes/Entities/Constructible/Storage/Closets/Secure/security.yml index 0821e363ea..93af4d4fb1 100644 --- a/Resources/Prototypes/Entities/Constructible/Storage/Closets/Secure/security.yml +++ b/Resources/Prototypes/Entities/Constructible/Storage/Closets/Secure/security.yml @@ -9,7 +9,7 @@ - type: StorageVisualizer state: hos - type: AccessReader - access: [["HeadOfSecurity"]] + access: [["Security", "Command"]] # Warden - type: entity diff --git a/Resources/Prototypes/Entities/Constructible/Storage/Crates/crate_types.yml b/Resources/Prototypes/Entities/Constructible/Storage/Crates/crate_types.yml index 9e94d6636a..ef6c861def 100644 --- a/Resources/Prototypes/Entities/Constructible/Storage/Crates/crate_types.yml +++ b/Resources/Prototypes/Entities/Constructible/Storage/Crates/crate_types.yml @@ -375,7 +375,7 @@ parent: CrateGeneric components: - type: AccessReader - access: [["Science"]] + access: [["Research"]] - type: SecureEntityStorage - type: Sprite sprite: Constructible/Storage/Crates/scicrate_secure.rsi diff --git a/Resources/Prototypes/Roles/Jobs/Cargo/quartermaster.yml b/Resources/Prototypes/Roles/Jobs/Cargo/quartermaster.yml index 3d9eabe13b..28a6d9ec87 100644 --- a/Resources/Prototypes/Roles/Jobs/Cargo/quartermaster.yml +++ b/Resources/Prototypes/Roles/Jobs/Cargo/quartermaster.yml @@ -1,26 +1,26 @@ -- type: job - id: Quartermaster - name: "quartermaster" - positions: 1 - spawnPositions: 1 - startingGear: QuartermasterGear - departments: - - Cargo - icon: "QuarterMaster" - access: - - Cargo - - Quartermaster - - Maintenance - -- type: startingGear - id: QuartermasterGear - equipment: - head: ClothingHeadHatCargosoft - innerclothing: ClothingUniformJumpsuitQM - backpack: ClothingBackpackFilled - shoes: ClothingShoesColorBrown - idcard: QuartermasterPDA - ears: ClothingHeadsetCargo - innerclothingskirt: ClothingUniformJumpskirtQM - satchel: ClothingBackpackSatchelFilled - duffelbag: ClothingBackpackDuffelFilled +#- type: job +# id: Quartermaster +# name: "quartermaster" +# positions: 1 +# spawnPositions: 1 +# startingGear: QuartermasterGear +# departments: +# - Cargo +# icon: "QuarterMaster" +# access: +# - Cargo +# - Quartermaster +# - Maintenance +# +#- type: startingGear +# id: QuartermasterGear +# equipment: +# head: ClothingHeadHatCargosoft +# innerclothing: ClothingUniformJumpsuitQM +# backpack: ClothingBackpackFilled +# shoes: ClothingShoesColorBrown +# idcard: QuartermasterPDA +# ears: ClothingHeadsetCargo +# innerclothingskirt: ClothingUniformJumpskirtQM +# satchel: ClothingBackpackSatchelFilled +# duffelbag: ClothingBackpackDuffelFilled diff --git a/Resources/Prototypes/Roles/Jobs/Civilian/bartender.yml b/Resources/Prototypes/Roles/Jobs/Civilian/bartender.yml index c62541346d..4801cbc799 100644 --- a/Resources/Prototypes/Roles/Jobs/Civilian/bartender.yml +++ b/Resources/Prototypes/Roles/Jobs/Civilian/bartender.yml @@ -8,7 +8,6 @@ icon: "Bartender" access: - Service - - Bar - Maintenance - type: startingGear diff --git a/Resources/Prototypes/Roles/Jobs/Civilian/botanist.yml b/Resources/Prototypes/Roles/Jobs/Civilian/botanist.yml index 0320603fd3..ed4761d99d 100644 --- a/Resources/Prototypes/Roles/Jobs/Civilian/botanist.yml +++ b/Resources/Prototypes/Roles/Jobs/Civilian/botanist.yml @@ -9,7 +9,6 @@ icon: "Botanist" access: - Service - - Hydroponics - Maintenance - type: startingGear diff --git a/Resources/Prototypes/Roles/Jobs/Civilian/chef.yml b/Resources/Prototypes/Roles/Jobs/Civilian/chef.yml index a49a15e6ab..092a640647 100644 --- a/Resources/Prototypes/Roles/Jobs/Civilian/chef.yml +++ b/Resources/Prototypes/Roles/Jobs/Civilian/chef.yml @@ -8,7 +8,6 @@ icon: "Chef" access: - Service - - Kitchen - Maintenance - type: startingGear diff --git a/Resources/Prototypes/Roles/Jobs/Command/captain.yml b/Resources/Prototypes/Roles/Jobs/Command/captain.yml index 165ef640b9..8c0bbb9666 100644 --- a/Resources/Prototypes/Roles/Jobs/Command/captain.yml +++ b/Resources/Prototypes/Roles/Jobs/Command/captain.yml @@ -16,21 +16,13 @@ - HeadOfPersonnel - Command - Security - - HeadOfSecurity - Brig - - Detective - - ChiefEngineer - Engineering - - ChiefMedicalOfficer - Medical - - Quartermaster - Cargo - ResearchDirector - Research - - Bar - - Kitchen - Service - - Hydroponics - Maintenance - External - Janitor diff --git a/Resources/Prototypes/Roles/Jobs/Engineering/chief_engineer.yml b/Resources/Prototypes/Roles/Jobs/Engineering/chief_engineer.yml index 6bcff4639b..79b1962d8e 100644 --- a/Resources/Prototypes/Roles/Jobs/Engineering/chief_engineer.yml +++ b/Resources/Prototypes/Roles/Jobs/Engineering/chief_engineer.yml @@ -11,7 +11,6 @@ access: - Maintenance - Engineering - - ChiefEngineer - Command - External diff --git a/Resources/Prototypes/Roles/Jobs/Medical/chief_medical_officer.yml b/Resources/Prototypes/Roles/Jobs/Medical/chief_medical_officer.yml index 4b06c0559a..e8012a9ee4 100644 --- a/Resources/Prototypes/Roles/Jobs/Medical/chief_medical_officer.yml +++ b/Resources/Prototypes/Roles/Jobs/Medical/chief_medical_officer.yml @@ -12,7 +12,6 @@ icon: "ChiefMedicalOfficer" access: - Medical - - ChiefMedicalOfficer - Command - Maintenance diff --git a/Resources/Prototypes/Roles/Jobs/Science/research_director.yml b/Resources/Prototypes/Roles/Jobs/Science/research_director.yml index e418eb00a0..6eb7a707ff 100644 --- a/Resources/Prototypes/Roles/Jobs/Science/research_director.yml +++ b/Resources/Prototypes/Roles/Jobs/Science/research_director.yml @@ -10,7 +10,6 @@ icon: "ResearchDirector" access: - Research - - ResearchDirector - Command - Maintenance diff --git a/Resources/Prototypes/Roles/Jobs/Security/head_of_security.yml b/Resources/Prototypes/Roles/Jobs/Security/head_of_security.yml index ffb90f4f16..ad86a7c29b 100644 --- a/Resources/Prototypes/Roles/Jobs/Security/head_of_security.yml +++ b/Resources/Prototypes/Roles/Jobs/Security/head_of_security.yml @@ -10,9 +10,7 @@ icon: "HeadOfSecurity" access: - Command - - HeadOfSecurity - Brig - - Detective - Security - Maintenance - Service