fish-station/Content.Server
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
..
Access Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
Actions Cleanup duplicate dependency in AddActionCommand (#38360) 2025-06-16 21:02:35 +02:00
Acz
Administration Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
Advertise/EntitySystems Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
Afk Command resolve mega pr batch 5 (#38389) 2025-06-17 22:49:58 +02:00
Alert Fix alerts mispredict + log spam (#36004) 2025-03-22 12:41:16 +01:00
AlertLevel Trigger Refactor (#39034) 2025-08-03 21:20:37 +02:00
Ame Clean up all missing EntitySystem proxy method uses (#38353) 2025-06-26 16:50:49 -07:00
Animals Cleanup warnings: CS0414 (#39748) 2025-08-19 09:42:54 +02:00
Announcements Cleanup: Remove redundant prototype name specifications (#35793) 2025-03-19 19:30:31 +01:00
Anomaly Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
Antag remove Session from MindComponent (#34753) 2025-04-19 00:23:01 +02:00
Arcade Replace usages of customTypeSerializer PrototypeIdListSerializer with something that doesn't take 20 separate words to type out (#37959) 2025-07-10 05:06:51 +02:00
Armor Move PriceCalculationEvent and EstimatedPriceCalculationEvent to shared (#37782) 2025-05-24 19:36:38 +02:00
Atmos Atmos dP Guidebook Entry (#40194) 2025-09-07 17:10:39 +02:00
Audio Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
Beam remove usages of obsolete EntityUid method variants (#35106) 2025-02-16 03:06:23 +01:00
Bed Stasis bed cleanup and bugfixes. (#38762) 2025-07-06 02:59:31 +02:00
Bible Clean up all missing EntitySystem proxy method uses (#38353) 2025-06-26 16:50:49 -07:00
Body Alerts Cleanup and API (#39544) 2025-09-05 12:45:48 +03:00
Botany Rejig LogStringHandler (#30706) 2025-09-05 14:22:49 +02:00
Buckle/Systems
Camera
CardboardBox
Cargo Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
CartridgeLoader Replace ValidatePrototypeId uses with ProtoId or EntProtoId (#38814) 2025-07-07 21:57:05 +02:00
Changeling/Systems Changeling cleanup and bugfix (#39843) 2025-08-24 15:50:19 +02:00
CharacterInfo
Charges Action charges refactor (#33993) 2025-04-18 13:45:48 +10:00
Chat Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
Chemistry Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
Chunking
Clock
Cloning Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
Clothing Relocate SetOutfit method to ServerClothingSystem and LEC setoutfit command. (#38391) 2025-06-19 01:50:10 +02:00
Cluwne Stunnable New Status and Cleanup (#38618) 2025-07-21 19:22:11 +02:00
Codewords Clean up all missing EntitySystem proxy method uses (#38353) 2025-06-26 16:50:49 -07:00
CombatMode Refactor disarms (#36546) 2025-04-19 11:38:22 +10:00
Commands Move some Station methods into shared (#38976) 2025-08-08 11:22:34 -04:00
Communications Fix communications console thinking it can announce in the first 5 seconds after spawning it (#38305) 2025-07-18 13:21:51 +02:00
Configurable Predict dumping (#32394) 2025-04-19 16:20:40 +10:00
Connection Fix some misc warnings (#37858) 2025-05-27 19:54:19 -04:00
Construction Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
Containers make throw insert container code more clear (#36873) 2025-05-07 15:08:28 +02:00
Coordinates
CPUJob/JobQueues/Queues
Crayon Clean up all missing EntitySystem proxy method uses (#38353) 2025-06-26 16:50:49 -07:00
CrewManifest Move some Station methods into shared (#38976) 2025-08-08 11:22:34 -04:00
CriminalRecords/Systems Fix ninjas not being able to hack criminal records (#36299) 2025-04-04 19:46:59 +02:00
Cuffs
Damage Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
Database Revert "Admin Log Browser Improvements (#39130)" 2025-08-31 17:50:37 +02:00
Decals Kills TurfHelpers (#37939) 2025-06-21 11:23:19 -04:00
Defusable Trigger Refactor (#39034) 2025-08-03 21:20:37 +02:00
Delivery Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
Destructible Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
DeviceLinking Trigger Refactor (#39034) 2025-08-03 21:20:37 +02:00
DeviceNetwork Clean up all missing EntitySystem proxy method uses (#38353) 2025-06-26 16:50:49 -07:00
Dice Predicted dice rolls (#34863) 2025-02-14 16:46:25 +01:00
Discord Switch Discord integration to use NetCord instead of Discord.Net (#38400) 2025-06-17 19:03:24 +02:00
Disposal Cleanup: Remove `TryInsert method from the DisposableSystem` and use event subscriptions instead (#38819) 2025-07-07 12:13:35 -07:00
DoAfter
Doors Access Reader Refactor (#37772) 2025-06-05 19:28:55 -04:00
Dragon Kills TurfHelpers (#37939) 2025-06-21 11:23:19 -04:00
Drowsiness Stunnable New Status and Cleanup (#38618) 2025-07-21 19:22:11 +02:00
Drunk
Effects
Electrocution [NEW STATUS SYSTEM] Drunkenness, Stuttering, Slurred Speech, and Bloodloss (#38678) 2025-08-18 16:26:29 -04:00
Emoting Changeling devour and transform (#34002) 2025-08-06 21:55:49 +02:00
Emp Predict EMP Examine (#39419) 2025-08-06 16:25:24 +02:00
Engineering Clean up all missing EntitySystem proxy method uses (#38353) 2025-06-26 16:50:49 -07:00
Ensnaring Fix #38935: Remove empty EnsnaringComponent.cs file (#39112) 2025-07-21 17:20:37 +02:00
EntityEffects Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
EntityList Replace usages of customTypeSerializer PrototypeIdListSerializer with something that doesn't take 20 separate words to type out (#37959) 2025-07-10 05:06:51 +02:00
Entry Dynamic anomaly scanner texture (#37585) 2025-09-04 22:11:03 +03:00
EUI Cleanup some easy-to-fix static logger warnings (#37820) 2025-05-25 23:20:08 +02:00
Examine Clean up all missing EntitySystem proxy method uses (#38353) 2025-06-26 16:50:49 -07:00
Explosion Moving FlammableComponent to Shared (#39870) 2025-08-24 13:46:23 -07:00
Fax Clean up all missing EntitySystem proxy method uses (#38353) 2025-06-26 16:50:49 -07:00
Flash Predict Flashes (#37640) 2025-06-23 13:32:56 +02:00
Fluids EVENT BASED WEIGHTLESSNESS (#37971) 2025-08-19 14:35:09 -04:00
Forensics Predict InjectorSystem (#39976) 2025-09-01 18:24:37 +03:00
GameTicking Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
Gateway Validate remaining ProtoId strings (#38747) 2025-07-04 22:55:45 +02:00
Gatherable EntityLootTable deleted (#37604) 2025-05-19 19:53:29 +10:00
Ghost Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
GhostKick Trigger Refactor (#39034) 2025-08-03 21:20:37 +02:00
Gibbing/Systems Paradox Clone (#35794) 2025-03-13 10:09:07 -07:00
Gravity EVENT BASED WEIGHTLESSNESS (#37971) 2025-08-19 14:35:09 -04:00
GridPreloader Refactor map loading & saving 2024-12-23 02:42:17 +13:00
Guardian Fix for holoparasite's ability to attack the host through mech (#36659) 2025-06-14 20:22:45 +03:00
Guidebook
GuideGenerator
Hands/Systems [Cleanup] Remove FellDownEvent (#39762) 2025-08-27 22:43:55 +02:00
Holiday CompFactory updates (#37559) 2025-05-20 01:08:55 -04:00
Holopad Trigger Refactor (#39034) 2025-08-03 21:20:37 +02:00
Holosign Clean up all missing EntitySystem proxy method uses (#38353) 2025-06-26 16:50:49 -07:00
HotPotato Trigger Refactor (#39034) 2025-08-03 21:20:37 +02:00
Humanoid Clean up all missing EntitySystem proxy method uses (#38353) 2025-06-26 16:50:49 -07:00
IconSmoothing
IdentityManagement fix clone appearance (#37130) 2025-05-02 21:26:12 -04:00
IgnitionSource Trigger Refactor (#39034) 2025-08-03 21:20:37 +02:00
ImmovableRod Clean up all missing EntitySystem proxy method uses (#38353) 2025-06-26 16:50:49 -07:00
Implants Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
Info Tweaks to ShowRulesCommand structure, localization, and autocomplete. (#38855) 2025-07-11 13:48:58 -04:00
Instruments Stunnable New Status and Cleanup (#38618) 2025-07-21 19:22:11 +02:00
Interaction Command resolve and LEC conversion batch 3 (#38378) 2025-06-17 11:39:42 +02:00
Inventory Fix forensics not being applied to held items (#30609) 2025-04-18 21:02:41 -04:00
IoC Revert "Added button and manager for in game bug reports (Part 1)" (#39872) 2025-08-28 01:46:24 -07:00
IP
Item Predicted multihanded component (#36712) 2025-04-19 18:05:20 +10:00
ItemRecall Wizard Item Recall Spell (#34411) 2025-02-08 16:56:08 -05:00
Jittering
Jobs Replace usages of customTypeSerializer PrototypeIdListSerializer with something that doesn't take 20 separate words to type out (#37959) 2025-07-10 05:06:51 +02:00
KillTracking
Kitchen Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
Labels/Label Predict Labels (#36406) 2025-04-10 22:19:48 -07:00
LandMines Trigger Refactor (#39034) 2025-08-03 21:20:37 +02:00
Lathe Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
Light Predict PoweredLights (#36541) 2025-08-11 23:06:28 +02:00
Lightning
Lube
Machines/EntitySystems Add multipart machines system (#35969) 2025-06-02 17:02:41 +03:00
Magic Refactor magic speak system to be a component added to actions (#36328) 2025-05-04 13:34:19 -04:00
MagicMirror Fix localization error when trying to change hair on someone with a hat (#38907) 2025-07-10 19:37:25 +02:00
Mapping Replace ValidatePrototypeId uses with ProtoId or EntProtoId (#38814) 2025-07-07 21:57:05 +02:00
Maps Move some Station methods into shared (#38976) 2025-08-08 11:22:34 -04:00
MapText
MassMedia Clean up all missing EntitySystem proxy method uses (#38353) 2025-06-26 16:50:49 -07:00
Materials Fix industrial reagent grinder bug, second attempt (#39690) 2025-08-16 21:54:15 +02:00
Mech Migrate all mechs to PartAssembly and remove legacy MechAssemblySystem (#39027) 2025-08-31 15:54:45 +03:00
Medical Fix radiation vomit for dead mobs (#40020) 2025-09-01 17:07:37 -07:00
Mind make objectives use yml defined mind filters (#36030) 2025-08-08 17:58:46 +02:00
Mindshield Cleanup subdermal implant code (#39755) 2025-08-20 13:52:03 +02:00
Mining "New player" admin logging improvements (#35961) 2025-03-20 20:56:51 +01:00
Mobs last words error fix (#39245) 2025-07-28 14:56:48 +02:00
Morgue predict morgue and crematorium (#39293) 2025-08-21 16:49:50 -07:00
Motd
MouseRotator
Movement fix: Register OnRequestMovePulledObject under the right system (#38484) 2025-07-09 05:44:21 +02:00
NameIdentifier Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
Ninja Move mind role components to shared (#39606) 2025-08-13 12:51:46 +02:00
NodeContainer Layering for atmospheric pipes (#36124) 2025-06-01 22:01:43 -07:00
NPC Moving FlammableComponent to Shared (#39870) 2025-08-24 13:46:23 -07:00
Nuke Move some Station methods into shared (#38976) 2025-08-08 11:22:34 -04:00
NukeOps
Nutrition [HOTFIX] Fix Burgers (#39773) 2025-09-06 02:19:19 -07:00
Objectives Cleanup warnings: CS0414 (#39748) 2025-08-19 09:42:54 +02:00
PAI pAI Software Catalog (#36857) 2025-04-23 16:55:35 -07:00
Paper
Parallax Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
ParticleAccelerator Add multipart machines system (#35969) 2025-06-02 17:02:41 +03:00
Payload/EntitySystems Make Modular Grenades with Chemical payload respect their trigger delay (#39905) 2025-08-27 00:26:13 +02:00
PDA Chameleon controller implant (Clothing fast switch) (#33887) 2025-05-30 12:07:25 +02:00
Physics Optimizations from server profile (#38290) 2025-07-26 11:44:34 +02:00
Pinpointer Predict Nav Beacon Examine (#39408) 2025-08-05 23:20:43 +02:00
Placement "New player" admin logging improvements (#35961) 2025-03-20 20:56:51 +01:00
Players Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
PneumaticCannon Stunnable New Status and Cleanup (#38618) 2025-07-21 19:22:11 +02:00
Pointing Clean up all missing EntitySystem proxy method uses (#38353) 2025-06-26 16:50:49 -07:00
Points Various system spring cleaning (#36206) 2025-04-16 13:08:22 +02:00
Polymorph Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
Popups Add PopupPredictedCursor and fix doubled popups on vending machines (#36655) 2025-04-18 14:01:46 +10:00
Power Bug fix for APCPowerReceiverBattery (#40188) 2025-09-07 16:52:27 +02:00
PowerCell Fix PowerCellDrawComponent draw rate (#38562) 2025-06-25 09:38:57 -04:00
PowerSink Clean up all missing EntitySystem proxy method uses (#38353) 2025-06-26 16:50:49 -07:00
Prayer Clean up all missing EntitySystem proxy method uses (#38353) 2025-06-26 16:50:49 -07:00
Preferences/Managers Cleanup some easy-to-fix static logger warnings (#37820) 2025-05-25 23:20:08 +02:00
Procedural Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
Projectiles Clean up all missing EntitySystem proxy method uses (#38353) 2025-06-26 16:50:49 -07:00
Puppet
Radiation Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
Radio Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
RandomAppearance
RandomMetadata Make RandomMetadata properly support localization (#36343) 2025-04-06 11:12:39 -07:00
RatKing Localize rat king commands datasets (#35780) 2025-03-11 22:49:32 -07:00
Remotes Allow the Command & Super door remotes to use the access of their user. (Re-creation of PR due to changes to game balance) (#35536) 2025-06-29 18:21:14 +02:00
RequiresGrid
Research Replace usages of customTypeSerializer PrototypeIdListSerializer with something that doesn't take 20 separate words to type out (#37959) 2025-07-10 05:06:51 +02:00
Resist predict morgue and crematorium (#39293) 2025-08-21 16:49:50 -07:00
Respawn Kills TurfHelpers (#37939) 2025-06-21 11:23:19 -04:00
Revenant predict morgue and crematorium (#39293) 2025-08-21 16:49:50 -07:00
Revolutionary Fix warden being and qm being not considered head for tot kill head objective (#32721) 2024-10-18 11:43:05 +02:00
Robotics/Systems Better robotics console (#38023) 2025-08-11 21:57:39 +03:00
Roles Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
Rootable Predict healing and bloodstream (#38690) 2025-07-02 19:20:31 -04:00
Rotation
RoundEnd Move some Station methods into shared (#38976) 2025-08-08 11:22:34 -04:00
Salvage Move some Station methods into shared (#38976) 2025-08-08 11:22:34 -04:00
Sandbox Revert "Fix bug with pipe color" (#39135) 2025-08-04 13:10:54 -07:00
Screens Predict dumping (#32394) 2025-04-19 16:20:40 +10:00
Security Genpop wall lockers (#38102) 2025-06-07 17:51:38 +02:00
SensorMonitoring Predict dumping (#32394) 2025-04-19 16:20:40 +10:00
Sericulture
ServerInfo Add telegram to the server info-links (#33459) 2024-11-22 16:38:41 +01:00
ServerUpdates System to automatically restart server after certain uptime. (#32814) 2024-10-20 16:46:22 +02:00
Shuttles Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
Silicons Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
Singularity Cleanup warnings: CS0414 (#39748) 2025-08-19 09:42:54 +02:00
Solar Clean up all missing EntitySystem proxy method uses (#38353) 2025-06-26 16:50:49 -07:00
Sound Trigger Refactor (#39034) 2025-08-03 21:20:37 +02:00
Spawners Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
Species/Systems Clean up all missing EntitySystem proxy method uses (#38353) 2025-06-26 16:50:49 -07:00
Speech Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
Spider NPC spiders sometimes spin webs 🕷️🕸️ (#38319) 2025-07-17 12:34:00 -04:00
SprayPainter Revert "Fix bug with pipe color" (#39135) 2025-08-04 13:10:54 -07:00
Spreader Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
Sprite Move scale command to content and turn it into a toolshed command (#39349) 2025-08-06 14:33:21 +02:00
Stack predict StackSystem GetVerbsEvent (#39741) 2025-08-18 16:49:25 -07:00
Station Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
StationEvents Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
StationRecords More filters for station records (#37213) 2025-05-06 12:21:16 -04:00
Stealth
Storage predict morgue and crematorium (#39293) 2025-08-21 16:49:50 -07:00
Store Clean up all missing EntitySystem proxy method uses (#38353) 2025-06-26 16:50:49 -07:00
StoreDiscount/Systems Replace ValidatePrototypeId uses with ProtoId or EntProtoId (#38814) 2025-07-07 21:57:05 +02:00
Strip Fix forensics not being applied to held items (#30609) 2025-04-18 21:02:41 -04:00
Stunnable Crawling Fixes Part 4: Can't crawl when weightless. (#39099) 2025-08-19 12:18:05 -07:00
SubFloor Predict pipe anchoring and unanchroing (#35977) 2025-03-21 12:43:35 +03:00
SurveillanceCamera Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
Tabletop Fix tabletop grids rarely spawning on top of another (#39327) 2025-08-01 23:48:40 +02:00
Telephone Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
Teleportation Wizard Teleport Scroll (Teleport Location ECS) (#36424) 2025-04-28 19:42:24 +02:00
Temperature Replace ValidatePrototypeId uses with ProtoId or EntProtoId (#38814) 2025-07-07 21:57:05 +02:00
Tesla
Thief Move mind role components to shared (#39606) 2025-08-13 12:51:46 +02:00
Tiles Fix tile-events returns (#37502) 2025-05-16 14:22:20 +02:00
Tips Optimizations from server profile (#38290) 2025-07-26 11:44:34 +02:00
Tools Predict passive welding fuel consumption (#38876) 2025-07-31 00:38:38 +02:00
Toolshed/Commands add scale:multiplyvector toolshed command (#39424) 2025-08-06 19:23:05 +02:00
Traitor Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
Traits Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
Trigger/Systems Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
TurretController Sentry turrets - Part 6: Sentry turret control panels (#35235) 2025-05-26 16:00:50 +03:00
Turrets Predict RepairableSystem (#38886) 2025-07-10 04:39:34 +02:00
UserInterface Fix showvalue Ui for melee weapons (#38703) 2025-08-06 15:01:49 -07:00
VendingMachines Replace AdvertiseComponent with DatasetVocalizerComponent (#38887) 2025-07-10 11:12:24 -07:00
Verbs Clean up all missing EntitySystem proxy method uses (#38353) 2025-06-26 16:50:49 -07:00
Vocalization Buff parrot learn rates and radio chatter (#38984) 2025-07-14 09:55:27 -07:00
VoiceMask Add voice locks to various hidden syndicate items (#39310) 2025-08-10 11:10:13 -07:00
VoiceTrigger Trigger Refactor (#39034) 2025-08-03 21:20:37 +02:00
Voting Show customvote title in chat on finish (#39137) 2025-07-23 10:15:29 -04:00
Wagging Changeling devour and transform (#34002) 2025-08-06 21:55:49 +02:00
Weapons Inflatable Module (#35100) 2025-08-23 15:15:28 -07:00
Weather Cleanup remaining IMapManager.MapExists uses (#37851) 2025-05-26 18:45:55 +02:00
Whitelist Command resolves. (#38519) 2025-06-23 02:40:55 +02:00
Wieldable Add conditional camera offset based on cursor - Hristov Rework, Part 1 (#31626) 2025-01-28 00:20:45 +01:00
Wires Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
Worldgen Replace usages of customTypeSerializer PrototypeIdListSerializer with something that doesn't take 20 separate words to type out (#37959) 2025-07-10 05:06:51 +02:00
Xenoarchaeology Moving FlammableComponent to Shared (#39870) 2025-08-24 13:46:23 -07:00
Zombies Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
AssemblyInfo.cs
Content.Server.csproj Treat duplicate dependency warnings as errors (#38480) 2025-06-22 00:25:20 +02:00
Content.Server.csproj.DotSettings
GlobalUsings.cs
Program.cs