fish-station/Content.Server/Administration/Commands
Pieter-Jan Briers 0c97520276
Fix usages of TryIndex() (#39124)
* Fix usages of TryIndex()

Most usages of TryIndex() were using it incorrectly. Checking whether prototype IDs specified in prototypes actually existed before using them. This is not appropriate as it's just hiding bugs that should be getting caught by the YAML linter and other tools. (#39115)

This then resulted in TryIndex() getting modified to log errors (94f98073b0), which is incorrect as it causes false-positive errors in proper uses of the API: external data validation. (#39098)

This commit goes through and checks every call site of TryIndex() to see whether they were correct. Most call sites were replaced with the new Resolve(), which is suitable for these "defensive programming" use cases.

Fixes #39115

Breaking change: while doing this I noticed IdCardComponent and related systems were erroneously using ProtoId<AccessLevelPrototype> for job prototypes. This has been corrected.

* fix tests

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2025-09-09 18:17:56 +02:00
..
AddBodyPartCommand.cs AddBodyPartCommand localization. (#38612) 2025-06-28 13:11:08 +02:00
AddEntityStorageCommand.cs predict morgue and crematorium (#39293) 2025-08-21 16:49:50 -07:00
AddMechanismCommand.cs Refactoring body system to use containers and general body cleanup (#20202) 2023-09-21 17:23:02 +10:00
AddPolymorphActionCommand.cs Cleanup AddPolymorphActionCommand and LEC conversion. (#38853) 2025-09-03 22:16:43 +02:00
AddReagent.cs Replace instances of SolutionContainerSystem with SharedSolutionContainerSystem (#30084) 2024-09-02 13:26:04 +02:00
AdminLogBulk.cs Make AdminLogsSystem an IoC manager (#8492) 2022-05-28 23:41:17 -07:00
AdminWhoCommand.cs Command resolve mega pr 6 (#38398) 2025-06-17 19:22:03 +02:00
AGhostCommand.cs Modernize GhostComponent & Ghost API (#36858) 2025-04-23 20:28:10 +02:00
AnnounceUiCommand.cs Command resolve mega pr 6 (#38398) 2025-06-17 19:22:03 +02:00
BanCommand.cs Random spontaneous cleanup PR (#25131) 2024-02-13 16:48:39 -05:00
BanExemptionCommands.cs Clean up command perms (#28451) 2024-06-01 01:14:43 -07:00
BanListCommand.cs Command resolves. (#38519) 2025-06-23 02:40:55 +02:00
BanPanelCommand.cs fix(Commands): Improve Localization of commands. Standardize some behaviors. (#30362) 2024-08-11 19:46:57 +10:00
CameraCommand.cs Admin Tool: Observe entities in an extra viewport (#36969) 2025-07-25 18:53:01 +02:00
ChangeCvarCommand.cs "New player" admin logging improvements (#35961) 2025-03-20 20:56:51 +01:00
ClearBluespaceLockerLinks.cs Content update for NetEntities (#18935) 2023-09-11 09:42:41 +10:00
ControlMob.cs Add autocomplete to controlmob (#36234) 2025-04-03 05:32:14 +02:00
DeAdminCommand.cs Command resolve mega pr 6 (#38398) 2025-06-17 19:22:03 +02:00
DeleteComponent.cs Command resolve mega pr 6 (#38398) 2025-06-17 19:22:03 +02:00
DepartmentBanCommand.cs Cleanup some easy-to-fix static logger warnings (#37820) 2025-05-25 23:20:08 +02:00
DirtyCommand.cs Dsay Dirty and Follow commands converted to LEC and localized. (#38666) 2025-07-01 01:33:59 +02:00
DSay.cs Dsay Dirty and Follow commands converted to LEC and localized. (#38666) 2025-07-01 01:33:59 +02:00
EraseCommand.cs Allow for respawn and erase verb to be used on offline players. Also minor rewrite on respawn command and new erase command (#30433) 2024-08-31 21:38:03 +10:00
ExplosionCommand.cs Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
FaxUiCommand.cs Command resolve mega pr 6 (#38398) 2025-06-17 19:22:03 +02:00
FollowCommand.cs Dsay Dirty and Follow commands converted to LEC and localized. (#38666) 2025-07-01 01:33:59 +02:00
ForceGhostCommand.cs Admin spring cleaning (#36190) 2025-04-14 14:06:36 +10:00
JobWhitelistCommands.cs fix(cmd-Jobwhitelistadd): Fixed typo in Loc.GetString (#30355) 2024-07-25 23:55:44 -06:00
LinkBluespaceLocker.cs predict morgue and crematorium (#39293) 2025-08-21 16:49:50 -07:00
LoadGameMapCommand.cs Command resolve mega pr 6 (#38398) 2025-06-17 19:22:03 +02:00
OpenAdminLogsCommand.cs Command resolve mega pr 6 (#38398) 2025-06-17 19:22:03 +02:00
OpenAdminNotesCommand.cs Command resolves. (#38519) 2025-06-23 02:40:55 +02:00
OpenPermissionsCommand.cs Command resolve mega pr 6 (#38398) 2025-06-17 19:22:03 +02:00
OpenUserVisibleNotesCommand.cs fix(Commands): Improve Localization of commands. Standardize some behaviors. (#30362) 2024-08-11 19:46:57 +10:00
OSay.cs Content update for NetEntities (#18935) 2023-09-11 09:42:41 +10:00
OwoifyCommand.cs Replace EntityUid parsing with NetEntity (#23474) 2024-01-04 11:04:31 +11:00
PanicBunkerCommand.cs Content fix for LocalizedCommands Loc change (#38133) 2025-06-23 07:22:21 +02:00
PardonCommand.cs Command resolve mega pr 6 (#38398) 2025-06-17 19:22:03 +02:00
PersistenceSaveCommand.cs MapManager warnings cleanup Server Edition 2003 (#36781) 2025-06-09 02:09:42 +02:00
PlayerPanelCommand.cs Implement a playerpanel (#30238) 2024-08-09 15:33:25 +10:00
PlayGlobalSoundCommand.cs Fix playglobalsound autocompletion (#26167) 2024-03-24 14:15:26 +11:00
PlayTimeCommands.cs Fix playtime_addrole command printing the wrong time (#28783) 2024-06-12 23:31:21 -07:00
PromoteHostCommand.cs Command resolve mega pr batch 5 (#38389) 2025-06-17 22:49:58 +02:00
ReAdminCommand.cs Command resolve mega pr batch 5 (#38389) 2025-06-17 22:49:58 +02:00
ReadyAll.cs Resolve 'EntitySystem.Get<T>()' is obsolete in content (#27936) 2024-05-12 20:34:52 -04:00
RemoveBodyPartCommand.cs Refactoring body system to use containers and general body cleanup (#20202) 2023-09-21 17:23:02 +10:00
RemoveEntityStorageCommand.cs predict morgue and crematorium (#39293) 2025-08-21 16:49:50 -07:00
RemoveExtraComponents.cs Command resolve mega pr batch 5 (#38389) 2025-06-17 22:49:58 +02:00
RemoveMechanismCommand.cs Refactoring body system to use containers and general body cleanup (#20202) 2023-09-21 17:23:02 +10:00
RoleBanCommand.cs Cleanup some easy-to-fix static logger warnings (#37820) 2025-05-25 23:20:08 +02:00
RoleBanListCommand.cs Integrate Modern HWID into content 2024-11-12 01:51:54 +01:00
RoleUnbanCommand.cs Command resolve mega pr batch 5 (#38389) 2025-06-17 22:49:58 +02:00
SetAdminOOC.cs Command resolve mega pr batch 5 (#38389) 2025-06-17 22:49:58 +02:00
SetMindCommand.cs Command resolve mega pr batch 5 (#38389) 2025-06-17 22:49:58 +02:00
SetOutfitCommand.cs Relocate SetOutfit method to ServerClothingSystem and LEC setoutfit command. (#38391) 2025-06-19 01:50:10 +02:00
SetSolutionCapacity.cs Replace instances of SolutionContainerSystem with SharedSolutionContainerSystem (#30084) 2024-09-02 13:26:04 +02:00
SetSolutionTemperature.cs Replace instances of SolutionContainerSystem with SharedSolutionContainerSystem (#30084) 2024-09-02 13:26:04 +02:00
SetSolutionThermalEnergy.cs Replace instances of SolutionContainerSystem with SharedSolutionContainerSystem (#30084) 2024-09-02 13:26:04 +02:00
ShowGhostsCommand.cs view ghosts on round end (#11680) 2022-10-05 21:55:11 -05:00
ShuttleCommands.cs Command resolve mega pr batch 5 (#38389) 2025-06-17 22:49:58 +02:00
StealthminCommand.cs Command resolves. (#38519) 2025-06-23 02:40:55 +02:00
StripAllCommand.cs HandsSystem Refactor (#38438) 2025-06-25 15:13:03 +02:00
ThrowScoreboardCommand.cs Resolve 'EntitySystem.Get<T>()' is obsolete in content (#27936) 2024-05-12 20:34:52 -04:00
VariantizeCommand.cs Fix variantize command not respecting tile rotation (#39314) 2025-08-01 07:46:59 -04:00
WarpCommand.cs Predict warp point location examines. (#39402) 2025-08-05 20:26:41 +02:00