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

SpaceNinjaServer

A simple server for a small space ninja game

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

XFEstudio/SpaceNinjaServer

feat: track EudicoHeists in CompletedJobChains (#1531)

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

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

代码差异

4 个文件 +31 -2
Modified src/models/inventoryModels/inventoryModel.ts +1 -1
@@ -1415,7 +1415,7 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
1415 1415
1416 1416 //https://warframe.fandom.com/wiki/Heist
1417 1417 //ProfitTaker(1-4) Example:"LocationTag": "EudicoHeists", "Jobs":Mission name
1418 CompletedJobChains: [completedJobChainsSchema],
1418 CompletedJobChains: { type: [completedJobChainsSchema], default: undefined },
1419 1419 //Night Wave Challenge
1420 1420 SeasonChallengeHistory: [seasonChallengeHistorySchema],
1421 1421
Modified src/services/missionInventoryUpdateService.ts +22 -0
@@ -143,6 +143,28 @@ export const addMissionInventoryUpdates = async (
143 143 if (inventoryUpdates.RewardInfo.NemesisAbandonedRewards) {
144 144 inventory.NemesisAbandonedRewards = inventoryUpdates.RewardInfo.NemesisAbandonedRewards;
145 145 }
146 if (inventoryUpdates.MissionStatus == "GS_SUCCESS" && inventoryUpdates.RewardInfo.jobId) {
147 // e.g. for Profit-Taker Phase 1:
148 // JobTier: -6,
149 // jobId: '/Lotus/Types/Gameplay/Venus/Jobs/Heists/HeistProfitTakerBountyOne_-6_SolarisUnitedHub1_663a71c80000000000000025_EudicoHeists',
150 // This is sent multiple times, with JobStage starting at 0 and incrementing each time, but only the final upload has GS_SUCCESS.
151
152 // eslint-disable-next-line @typescript-eslint/no-unused-vars
153 const [bounty, tier, hub, id, tag] = inventoryUpdates.RewardInfo.jobId.split("_");
154 if (tag == "EudicoHeists") {
155 inventory.CompletedJobChains ??= [];
156 let chain = inventory.CompletedJobChains.find(x => x.LocationTag == tag);
157 if (!chain) {
158 chain =
159 inventory.CompletedJobChains[
160 inventory.CompletedJobChains.push({ LocationTag: tag, Jobs: [] }) - 1
161 ];
162 }
163 if (!chain.Jobs.includes(bounty)) {
164 chain.Jobs.push(bounty);
165 }
166 }
167 }
146 168 }
147 169 for (const [key, value] of getEntriesUnsafe(inventoryUpdates)) {
148 170 if (value === undefined) {
Modified src/types/inventoryTypes/inventoryTypes.ts +1 -1
@@ -292,7 +292,7 @@ export interface IInventoryClient extends IDailyAffiliations, InventoryClientEqu
292 292 RecentVendorPurchases?: IRecentVendorPurchaseClient[];
293 293 NodeIntrosCompleted: string[];
294 294 GuildId?: IOid;
295 CompletedJobChains: ICompletedJobChain[];
295 CompletedJobChains?: ICompletedJobChain[];
296 296 SeasonChallengeHistory: ISeasonChallenge[];
297 297 EquippedInstrument?: string;
298 298 InvasionChainProgress: IInvasionChainProgress[];
Modified src/types/requestTypes.ts +7 -0
@@ -143,6 +143,13 @@ export interface IRewardInfo {
143 143 PurgatoryRewardQualifications?: string;
144 144 rewardSeed?: number;
145 145 periodicMissionTag?: string;
146
147 // for bounties, only EOM_AFK and node are given from above, plus:
148 JobTier?: string;
149 jobId?: string;
150 JobStage?: string;
151 Q?: boolean; // always false?
152 CheckpointCounter?: number; // starts at 1, is incremented with each job stage upload, and does not reset when starting a new job
146 153 }
147 154
148 155 export type IMissionStatus = "GS_SUCCESS" | "GS_FAILURE" | "GS_DUMPED" | "GS_QUIT" | "GS_INTERRUPTED";