Compare commits
	
		
			1 Commits
		
	
	
		
			main
			...
			conquest-p
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| aaa985e1ae | 
@ -6,6 +6,7 @@ import { addMissionInventoryUpdates, addMissionRewards } from "@/src/services/mi
 | 
				
			|||||||
import { getInventory } from "@/src/services/inventoryService";
 | 
					import { getInventory } from "@/src/services/inventoryService";
 | 
				
			||||||
import { getInventoryResponse } from "./inventoryController";
 | 
					import { getInventoryResponse } from "./inventoryController";
 | 
				
			||||||
import { logger } from "@/src/utils/logger";
 | 
					import { logger } from "@/src/utils/logger";
 | 
				
			||||||
 | 
					import { IMissionInventoryUpdateResponse } from "@/src/types/missionTypes";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
**** INPUT ****
 | 
					**** INPUT ****
 | 
				
			||||||
@ -78,7 +79,7 @@ export const missionInventoryUpdateController: RequestHandler = async (req, res)
 | 
				
			|||||||
    const inventoryResponse = await getInventoryResponse(inventory, true);
 | 
					    const inventoryResponse = await getInventoryResponse(inventory, true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //TODO: figure out when to send inventory. it is needed for many cases.
 | 
					    //TODO: figure out when to send inventory. it is needed for many cases.
 | 
				
			||||||
    res.json({
 | 
					    const response: IMissionInventoryUpdateResponse = {
 | 
				
			||||||
        InventoryJson: JSON.stringify(inventoryResponse),
 | 
					        InventoryJson: JSON.stringify(inventoryResponse),
 | 
				
			||||||
        InventoryChanges: inventoryChanges,
 | 
					        InventoryChanges: inventoryChanges,
 | 
				
			||||||
        MissionRewards,
 | 
					        MissionRewards,
 | 
				
			||||||
@ -87,7 +88,12 @@ export const missionInventoryUpdateController: RequestHandler = async (req, res)
 | 
				
			|||||||
        //FusionPoints: inventoryChanges?.FusionPoints, // This in combination with InventoryJson or InventoryChanges seems to just double the number of endo shown, so unsure when this is needed.
 | 
					        //FusionPoints: inventoryChanges?.FusionPoints, // This in combination with InventoryJson or InventoryChanges seems to just double the number of endo shown, so unsure when this is needed.
 | 
				
			||||||
        SyndicateXPItemReward,
 | 
					        SyndicateXPItemReward,
 | 
				
			||||||
        AffiliationMods
 | 
					        AffiliationMods
 | 
				
			||||||
    });
 | 
					    };
 | 
				
			||||||
 | 
					    if (missionReport.ConquestMissionsCompleted !== undefined) {
 | 
				
			||||||
 | 
					        response.ConquestCompletedMissionsCount =
 | 
				
			||||||
 | 
					            missionReport.ConquestMissionsCompleted == 2 ? 0 : missionReport.ConquestMissionsCompleted + 1;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    res.json(response);
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 | 
				
			|||||||
@ -43,7 +43,7 @@ import { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/invento
 | 
				
			|||||||
import { getEntriesUnsafe } from "@/src/utils/ts-utils";
 | 
					import { getEntriesUnsafe } from "@/src/utils/ts-utils";
 | 
				
			||||||
import { IEquipmentClient } from "@/src/types/inventoryTypes/commonInventoryTypes";
 | 
					import { IEquipmentClient } from "@/src/types/inventoryTypes/commonInventoryTypes";
 | 
				
			||||||
import { handleStoreItemAcquisition } from "./purchaseService";
 | 
					import { handleStoreItemAcquisition } from "./purchaseService";
 | 
				
			||||||
import { IMissionReward } from "../types/missionTypes";
 | 
					import { IMissionCredits, IMissionReward } from "../types/missionTypes";
 | 
				
			||||||
import { crackRelic } from "@/src/helpers/relicHelper";
 | 
					import { crackRelic } from "@/src/helpers/relicHelper";
 | 
				
			||||||
import { createMessage } from "./inboxService";
 | 
					import { createMessage } from "./inboxService";
 | 
				
			||||||
import kuriaMessage50 from "@/static/fixed_responses/kuriaMessages/fiftyPercent.json";
 | 
					import kuriaMessage50 from "@/static/fixed_responses/kuriaMessages/fiftyPercent.json";
 | 
				
			||||||
@ -885,13 +885,6 @@ export const addMissionRewards = async (
 | 
				
			|||||||
    return { inventoryChanges, MissionRewards, credits, AffiliationMods, SyndicateXPItemReward };
 | 
					    return { inventoryChanges, MissionRewards, credits, AffiliationMods, SyndicateXPItemReward };
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
interface IMissionCredits {
 | 
					 | 
				
			||||||
    MissionCredits: number[];
 | 
					 | 
				
			||||||
    CreditBonus: number[];
 | 
					 | 
				
			||||||
    TotalCredits: number[];
 | 
					 | 
				
			||||||
    DailyMissionBonus?: boolean;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
//creditBonus is not entirely accurate.
 | 
					//creditBonus is not entirely accurate.
 | 
				
			||||||
//TODO: consider ActiveBoosters
 | 
					//TODO: consider ActiveBoosters
 | 
				
			||||||
export const addCredits = (
 | 
					export const addCredits = (
 | 
				
			||||||
 | 
				
			|||||||
@ -1,3 +1,5 @@
 | 
				
			|||||||
 | 
					import { IAffiliationMods, IInventoryChanges } from "./purchaseTypes";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const inventoryFields = ["RawUpgrades", "MiscItems", "Consumables", "Recipes"] as const;
 | 
					export const inventoryFields = ["RawUpgrades", "MiscItems", "Consumables", "Recipes"] as const;
 | 
				
			||||||
export type IInventoryFieldType = (typeof inventoryFields)[number];
 | 
					export type IInventoryFieldType = (typeof inventoryFields)[number];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -11,3 +13,20 @@ export interface IMissionReward {
 | 
				
			|||||||
    FromEnemyCache?: boolean;
 | 
					    FromEnemyCache?: boolean;
 | 
				
			||||||
    IsStrippedItem?: boolean;
 | 
					    IsStrippedItem?: boolean;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export interface IMissionCredits {
 | 
				
			||||||
 | 
					    MissionCredits: number[];
 | 
				
			||||||
 | 
					    CreditBonus: number[];
 | 
				
			||||||
 | 
					    TotalCredits: number[];
 | 
				
			||||||
 | 
					    DailyMissionBonus?: boolean;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export interface IMissionInventoryUpdateResponse extends Partial<IMissionCredits> {
 | 
				
			||||||
 | 
					    ConquestCompletedMissionsCount?: number;
 | 
				
			||||||
 | 
					    InventoryJson?: string;
 | 
				
			||||||
 | 
					    MissionRewards?: IMissionReward[];
 | 
				
			||||||
 | 
					    InventoryChanges?: IInventoryChanges;
 | 
				
			||||||
 | 
					    FusionPoints?: number;
 | 
				
			||||||
 | 
					    SyndicateXPItemReward?: number;
 | 
				
			||||||
 | 
					    AffiliationMods?: IAffiliationMods[];
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -125,6 +125,7 @@ export type IMissionInventoryUpdateRequest = {
 | 
				
			|||||||
    wagerTier?: number; // the index
 | 
					    wagerTier?: number; // the index
 | 
				
			||||||
    creditsFee?: number; // the index
 | 
					    creditsFee?: number; // the index
 | 
				
			||||||
    InvasionProgress?: IInvasionProgressClient[];
 | 
					    InvasionProgress?: IInvasionProgressClient[];
 | 
				
			||||||
 | 
					    ConquestMissionsCompleted?: number;
 | 
				
			||||||
} & {
 | 
					} & {
 | 
				
			||||||
    [K in TEquipmentKey]?: IEquipmentClient[];
 | 
					    [K in TEquipmentKey]?: IEquipmentClient[];
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user