Delta-v/Content.Server/Administration/Commands
Pieter-Jan Briers b7f297f612 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-12-29 11:39:03 -06:00
..
AGhostCommand.cs Better Admin Tooling and New Curator Toys (#4577) 2025-10-30 01:52:30 +00:00
AddBodyPartCommand.cs Upstream Merge (June / July) attempt 2 electric boogaloo (#4607) 2025-11-06 18:22:39 +00:00
AddEntityStorageCommand.cs predict morgue and crematorium (#39293) 2025-11-23 15:22:29 -06:00
AddMechanismCommand.cs Refactoring body system to use containers and general body cleanup (#20202) 2023-09-27 21:59:12 +02:00
AddPolymorphActionCommand.cs Cleanup AddPolymorphActionCommand and LEC conversion. (#38853) 2025-11-23 15:22:34 -06:00
AddReagent.cs upstream merge 7/9 (#1762) 2024-09-10 01:20:38 +10: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-08-07 19:16:26 +02:00
AnnounceUiCommand.cs Command resolve mega pr 6 (#38398) 2025-08-07 19:16:26 +02:00
BanCommand.cs Random spontaneous cleanup PR (#25131) 2024-02-18 23:02:29 +01:00
BanExemptionCommands.cs Clean up command perms (#28451) 2024-06-01 18:01:58 +02:00
BanListCommand.cs Upstream Merge (June / July) attempt 2 electric boogaloo (#4607) 2025-11-06 18:22:39 +00:00
BanPanelCommand.cs fix(Commands): Improve Localization of commands. Standardize some behaviors. (#30362) 2024-08-11 15:19:51 +01:00
CameraCommand.cs Upstream Merge (June / July) attempt 2 electric boogaloo (#4607) 2025-11-06 18:22:39 +00:00
ChangeCvarCommand.cs "New player" admin logging improvements (#35961) 2025-03-23 16:17:16 +00:00
ClearBluespaceLockerLinks.cs Content update for NetEntities (#18935) 2023-09-27 21:59:12 +02:00
ControlMob.cs Add autocomplete to controlmob (#36234) 2025-04-06 21:35:56 +01:00
DSay.cs Upstream Merge (June / July) attempt 2 electric boogaloo (#4607) 2025-11-06 18:22:39 +00:00
DeAdminCommand.cs Command resolve mega pr 6 (#38398) 2025-08-07 19:16:26 +02:00
DeleteComponent.cs Command resolve mega pr 6 (#38398) 2025-08-07 19:16:26 +02:00
DepartmentBanCommand.cs Cleanup some easy-to-fix static logger warnings (#37820) 2025-08-05 16:46:49 +02:00
DirtyCommand.cs Upstream Merge (June / July) attempt 2 electric boogaloo (#4607) 2025-11-06 18:22:39 +00: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-09-01 03:36:44 +01:00
ExplosionCommand.cs Fix usages of TryIndex() (#39124) 2025-12-29 11:39:03 -06:00
FaxUiCommand.cs Command resolve mega pr 6 (#38398) 2025-08-07 19:16:26 +02:00
FollowCommand.cs Upstream Merge (June / July) attempt 2 electric boogaloo (#4607) 2025-11-06 18:22:39 +00:00
ForceGhostCommand.cs upstream merge 27/04/2025 (#3596) 2025-05-06 19:35:03 -04:00
JobWhitelistCommands.cs fix(cmd-Jobwhitelistadd): Fixed typo in Loc.GetString (#30355) 2024-08-09 18:08:09 +01:00
LinkBluespaceLocker.cs predict morgue and crematorium (#39293) 2025-11-23 15:22:29 -06:00
LoadGameMapCommand.cs Command resolve mega pr 6 (#38398) 2025-08-07 19:16:26 +02:00
OSay.cs Content update for NetEntities (#18935) 2023-09-27 21:59:12 +02:00
OpenAdminLogsCommand.cs Command resolve mega pr 6 (#38398) 2025-08-07 19:16:26 +02:00
OpenAdminNotesCommand.cs Upstream Merge (June / July) attempt 2 electric boogaloo (#4607) 2025-11-06 18:22:39 +00:00
OpenPermissionsCommand.cs Command resolve mega pr 6 (#38398) 2025-08-07 19:16:26 +02:00
OpenUserVisibleNotesCommand.cs fix(Commands): Improve Localization of commands. Standardize some behaviors. (#30362) 2024-08-11 15:19:51 +01:00
OwoifyCommand.cs Replace EntityUid parsing with NetEntity (#23474) 2024-01-26 21:29:52 +01:00
PanicBunkerCommand.cs Upstream Merge (June / July) attempt 2 electric boogaloo (#4607) 2025-11-06 18:22:39 +00:00
PardonCommand.cs Command resolve mega pr 6 (#38398) 2025-08-07 19:16:26 +02:00
PersistenceSaveCommand.cs MapManager warnings cleanup Server Edition 2003 (#36781) 2025-08-07 01:36:00 +02:00
PlayGlobalSoundCommand.cs Fix playglobalsound autocompletion (#26167) 2024-03-27 18:28:32 +01:00
PlayTimeCommands.cs Fix `playtime_addrole` command printing the wrong time (#28783) 2024-07-05 20:27:53 +02:00
PlayerPanelCommand.cs Implement a playerpanel (#30238) 2024-08-09 19:04:58 +01:00
PromoteHostCommand.cs Command resolve mega pr batch 5 (#38389) 2025-08-07 19:16:44 +02:00
ReAdminCommand.cs Command resolve mega pr batch 5 (#38389) 2025-08-07 19:16:44 +02:00
ReadyAll.cs Resolve `'EntitySystem.Get<T>()' is obsolete` in content (#27936) 2024-05-18 13:58:55 +02:00
RemoveBodyPartCommand.cs Refactoring body system to use containers and general body cleanup (#20202) 2023-09-27 21:59:12 +02:00
RemoveEntityStorageCommand.cs predict morgue and crematorium (#39293) 2025-11-23 15:22:29 -06:00
RemoveExtraComponents.cs Command resolve mega pr batch 5 (#38389) 2025-08-07 19:16:44 +02:00
RemoveMechanismCommand.cs Refactoring body system to use containers and general body cleanup (#20202) 2023-09-27 21:59:12 +02:00
RoleBanCommand.cs Cleanup some easy-to-fix static logger warnings (#37820) 2025-08-05 16:46:49 +02:00
RoleBanListCommand.cs Integrate Modern HWID into content 2024-11-29 19:18:11 +01:00
RoleUnbanCommand.cs Command resolve mega pr batch 5 (#38389) 2025-08-07 19:16:44 +02:00
SetAdminOOC.cs Command resolve mega pr batch 5 (#38389) 2025-08-07 19:16:44 +02:00
SetMindCommand.cs Command resolve mega pr batch 5 (#38389) 2025-08-07 19:16:44 +02:00
SetOutfitCommand.cs Relocate SetOutfit method to ServerClothingSystem and LEC setoutfit command. (#38391) 2025-08-07 19:30:19 +02:00
SetSolutionCapacity.cs upstream merge 7/9 (#1762) 2024-09-10 01:20:38 +10:00
SetSolutionTemperature.cs upstream merge 7/9 (#1762) 2024-09-10 01:20:38 +10:00
SetSolutionThermalEnergy.cs upstream merge 7/9 (#1762) 2024-09-10 01:20:38 +10: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-08-07 19:16:44 +02:00
StealthminCommand.cs Upstream Merge (June / July) attempt 2 electric boogaloo (#4607) 2025-11-06 18:22:39 +00:00
StripAllCommand.cs Upstream Merge (June / July) attempt 2 electric boogaloo (#4607) 2025-11-06 18:22:39 +00:00
ThrowScoreboardCommand.cs Resolve `'EntitySystem.Get<T>()' is obsolete` in content (#27936) 2024-05-18 13:58:55 +02:00
VariantizeCommand.cs Fix variantize command not respecting tile rotation (#39314) 2025-11-23 15:22:13 -06:00
WarpCommand.cs Predict warp point location examines. (#39402) 2025-11-23 15:22:16 -06:00