Delta-v/Content.Server/Administration
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
..
BanList Integrate Modern HWID into content 2024-11-29 19:18:11 +01:00
Commands Fix usages of TryIndex() (#39124) 2025-12-29 11:39:03 -06:00
Components Move `HeadstandComponent` to Shared (#39377) 2025-11-23 15:22:16 -06:00
Logs Fix admin logs going to admin chat (#40141) 2025-12-29 11:39:01 -06:00
Managers upstream merge 27/04/2025 (#3596) 2025-05-06 19:35:03 -04:00
Notes Cleanup some easy-to-fix static logger warnings (#37820) 2025-08-05 16:46:49 +02:00
Systems Combine AdminFrozenSystem in shared. (#39885) 2025-11-23 15:22:31 -06:00
Toolshed adjreagent now accepts float (#38134) 2025-08-07 01:35:46 +02:00
UI Upstream Merge (June / July) attempt 2 electric boogaloo (#4607) 2025-11-06 18:22:39 +00:00
AdminCommandAttribute.cs Toolshed (#17895) 2023-08-02 16:09:08 -05:00
AdminPermsChangedEventArgs.cs Un-revert IPlayerManager refactor (#21244) 2023-10-31 19:00:44 +01:00
AdminRank.cs Remove redundant #nullable enable (#4275) 2021-07-16 17:37:09 -07:00
BanPanelEui.cs Sanitize admin UI input for role bans (#35422) 2025-08-05 17:14:23 +02:00
ContentNetworkResourceManager.cs Un-revert IPlayerManager refactor (#21244) 2023-10-31 19:00:44 +01:00
PlayerLocator.cs Integrate Modern HWID into content 2024-11-29 19:18:11 +01:00
PlayerPanelEui.cs upstream merge 27/04/2025 (#3596) 2025-05-06 19:35:03 -04:00
QuickDialogSystem.OpenDialog.cs Obsolete refactor - ConnectedClient to Channel (#24409) 2024-01-27 23:44:02 +01:00
QuickDialogSystem.cs Obsolete refactor - ConnectedClient to Channel (#24409) 2024-01-27 23:44:02 +01:00
ServerApi.Utility.cs Game server admin API (#26880) 2024-04-21 21:58:13 +02:00
ServerApi.cs Discord AHelp Reply System (#2315) 2025-01-04 00:31:42 +00:00