fish-station/Content.Server/Administration
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
..
BanList Integrate Modern HWID into content 2024-11-12 01:51:54 +01:00
Commands Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
Components Move HeadstandComponent to Shared (#39377) 2025-08-04 23:00:19 +02:00
Logs Fix admin logs going to admin chat (#40141) 2025-09-05 20:54:05 +02:00
Managers Admin spring cleaning (#36190) 2025-04-14 14:06:36 +10:00
Notes Cleanup some easy-to-fix static logger warnings (#37820) 2025-05-25 23:20:08 +02:00
Systems Combine AdminFrozenSystem in shared. (#39885) 2025-08-25 15:49:27 +02:00
Toolshed adjreagent now accepts float (#38134) 2025-06-07 23:47:37 -04:00
UI Admin Tool: Observe entities in an extra viewport (#36969) 2025-07-25 18:53:01 +02:00
AdminCommandAttribute.cs Toolshed (#17895) 2023-08-02 16:09:08 -05:00
AdminPermsChangedEventArgs.cs Un-revert IPlayerManager refactor (#21244) 2023-10-28 09:59:53 +11: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-05-26 23:27:31 -07:00
ContentNetworkResourceManager.cs Un-revert IPlayerManager refactor (#21244) 2023-10-28 09:59:53 +11:00
PlayerLocator.cs Integrate Modern HWID into content 2024-11-12 01:51:54 +01:00
PlayerPanelEui.cs PlayerPanel Follow button (#36466) 2025-04-12 22:00:46 +02:00
QuickDialogSystem.cs Obsolete refactor - ConnectedClient to Channel (#24409) 2024-01-23 09:14:13 +11:00
QuickDialogSystem.OpenDialog.cs Obsolete refactor - ConnectedClient to Channel (#24409) 2024-01-23 09:14:13 +11:00
ServerApi.cs Panic Bunker uses minutes not hours (#28805) 2024-06-09 22:45:47 +02:00
ServerApi.Utility.cs Game server admin API (#26880) 2024-04-14 20:13:29 +10:00