XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFESpaceNinjaServer

fix: don't use inventory projection in updateChallengeProgress (#4314)

Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/4314 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>

49afcdc3
Sainan <63328889+Sainan@users.noreply.github.com>
提交于

代码差异

2 个文件 +5 -6
Modified src/controllers/api/updateChallengeProgressController.ts +1 -4
@@ -16,10 +16,7 @@ export const updateChallengeProgressController: RequestHandler = async (req, res
16 16 const account = await getAccountForRequest(req);
17 17 logger.debug(`challenge report:`, challenges);
18 18
19 const inventory = await getInventory(
20 account._id,
21 "ChallengesFixVersion ChallengeProgress SeasonChallengeHistory Affiliations CalendarProgress nightwaveStandingMultiplier FlavourItems"
22 );
19 const inventory = await getInventory(account._id, undefined); // Challenge completion can give any item in theory
23 20 let affiliationMods: IAffiliationMods[] = [];
24 21 const inventoryChanges: IInventoryChanges = {};
25 22 if (challenges.ChallengeProgress) {
Modified src/services/inventoryService.ts +4 -2
@@ -2782,7 +2782,7 @@ export const addCalendarProgress = (inventory: TInventoryDatabaseDocument, value
2782 2782 };
2783 2783
2784 2784 export const addKahlProgress = (
2785 inventory: TInventoryDatabaseDocument,
2785 inventory: Pick<TInventoryDatabaseDocument, "Affiliations" | "MiscItems">,
2786 2786 value: IWeeklyMissionChallengeInfo[],
2787 2787 inventoryChanges: IInventoryChanges
2788 2788 ): void => {
@@ -3097,7 +3097,9 @@ export const getDialogue = (
3097 3097 return dialogue;
3098 3098 };
3099 3099
3100 export const getCalendarProgress = (inventory: TInventoryDatabaseDocument): ICalendarProgress => {
3100 export const getCalendarProgress = (
3101 inventory: Pick<TInventoryDatabaseDocument, "CalendarProgress">
3102 ): ICalendarProgress => {
3101 3103 const currentSeason = getWorldState().KnownCalendarSeasons[0];
3102 3104
3103 3105 if (!inventory.CalendarProgress) {