1
mirror of https://github.com/thepeacockproject/Peacock synced 2024-11-29 09:15:11 +01:00
Peacock/components/candle
moonysolari de98595db1
Fix snowdrop having graduation's challenges (#217)
* fix snowdrop having graduation's challenges

* add exception for snowdrop

* Revert "fix snowdrop having graduation's challenges"

This reverts commit 6c53961157.

* also fix for h2

---------

Co-authored-by: Anthony Fuller <24512050+AnthonyFuller@users.noreply.github.com>
2023-04-16 06:22:06 +01:00
..
challengeHelpers.ts Add global escalation challenges (#210) 2023-04-14 23:41:43 +01:00
challengeService.ts Fix snowdrop having graduation's challenges (#217) 2023-04-16 06:22:06 +01:00
masteryService.ts feat: initial support for mastery progression (#161) 2023-04-05 20:19:28 +01:00
progressionService.ts Update AreaDiscovered challenges during evergreen missions (#196) 2023-04-10 04:50:58 +01:00
README.md Added featured contracts challenges (#186) 2023-04-06 17:05:36 +01:00

Candle

Lighting the way through the new era of Hitman.

Candle is the subsystem for handling Challenges, Progression, and XP.

Credits

Thanks to Moo for the name suggestion.

Loading challenges

Challenge data reside in files in contractdata ending in _CHALLENGES.json. When building, the packResources function in buildTasks.mjs will take all such files and pack them into files in the resources/challenges folder.

Then, when the server starts, challenge data is loaded from the files in the resources/challenges folder into the memory, via the _loadResources function in controller.ts. It calls the _handleChallengeResources function that in turn calls challengeService.registerGroup and challengeService.registerChallenge to register the challenge group and the respective challenges.

These two registration functions initialize two data structures, groups: Map<string, Map<string, SavedChallengeGroup>>, which maps parentLocationIds to Maps of groupIds to SavedChallengeGroup objects for this group of this parent location, and groupContents: Map<string, Map<string, Set<string>>>, which maps parentLocationIds to Maps of groupIds to Sets of challenge Ids in this group of this parent location. All subsequent operations on challenges write to or read from these two Maps.