feat: acquisition of peely pix + free pack for first visit
All checks were successful
Build / build (22) (push) Successful in 39s
Build / build (18) (push) Successful in 1m13s
Build / build (18) (pull_request) Successful in 42s
Build / build (20) (pull_request) Successful in 1m10s
Build / build (20) (push) Successful in 1m8s
Build / build (22) (pull_request) Successful in 1m7s

This commit is contained in:
Sainan 2025-03-23 01:11:08 +01:00
parent b8e3be5018
commit 5426fe0874
6 changed files with 221 additions and 6 deletions

View File

@ -10,8 +10,7 @@ import { IGenericUpdate } from "@/src/types/genericUpdate";
const genericUpdateController: RequestHandler = async (request, response) => {
const accountId = await getAccountIdForRequest(request);
const update = getJSONfromString<IGenericUpdate>(String(request.body));
await updateGeneric(update, accountId);
response.json(update);
response.json(await updateGeneric(update, accountId));
};
export { genericUpdateController };

View File

@ -28,7 +28,7 @@ import {
IUpgradeClient,
ICrewShipWeaponClient
} from "@/src/types/inventoryTypes/inventoryTypes";
import { IGenericUpdate } from "../types/genericUpdate";
import { IGenericUpdate, IUpdateNodeIntrosResponse } from "../types/genericUpdate";
import {
IMissionInventoryUpdateRequest,
IThemeUpdateRequest,
@ -559,6 +559,7 @@ export const addItem = async (
switch (typeName.substr(1).split("/")[2]) {
case "Mods": // Legendary Core
case "CosmeticEnhancers": // Traumatic Peculiar
case "Stickers":
{
const changes = [
{
@ -876,7 +877,7 @@ export const updateStandingLimit = (
};
// TODO: AffiliationMods support (Nightwave).
export const updateGeneric = async (data: IGenericUpdate, accountId: string): Promise<void> => {
export const updateGeneric = async (data: IGenericUpdate, accountId: string): Promise<IUpdateNodeIntrosResponse> => {
const inventory = await getInventory(accountId);
// Make it an array for easier parsing.
@ -884,6 +885,19 @@ export const updateGeneric = async (data: IGenericUpdate, accountId: string): Pr
data.NodeIntrosCompleted = [data.NodeIntrosCompleted];
}
const inventoryChanges: IInventoryChanges = {};
for (const node of data.NodeIntrosCompleted) {
if (node == "KayaFirstVisitPack") {
inventoryChanges.MiscItems = [
{
ItemType: "/Lotus/Types/Items/MiscItems/1999FixedStickersPack",
ItemCount: 1
}
];
addMiscItems(inventory, inventoryChanges.MiscItems);
}
}
// Combine the two arrays into one.
data.NodeIntrosCompleted = inventory.NodeIntrosCompleted.concat(data.NodeIntrosCompleted);
@ -892,6 +906,11 @@ export const updateGeneric = async (data: IGenericUpdate, accountId: string): Pr
inventory.NodeIntrosCompleted = nodes;
await inventory.save();
return {
MissionRewards: [],
InventoryChanges: inventoryChanges
};
};
export const updateTheme = async (data: IThemeUpdateRequest, accountId: string): Promise<void> => {

View File

@ -51,10 +51,10 @@ export const handlePurchase = async (
logger.debug("purchase request", purchaseRequest);
const prePurchaseInventoryChanges: IInventoryChanges = {};
if (purchaseRequest.PurchaseParams.Source == 7) {
if (purchaseRequest.PurchaseParams.Source == 7 && purchaseRequest.PurchaseParams.ExtraPurchaseInfoJson) {
const manifest = getVendorManifestByOid(purchaseRequest.PurchaseParams.SourceId!);
if (manifest) {
const ItemId = (JSON.parse(purchaseRequest.PurchaseParams.ExtraPurchaseInfoJson!) as { ItemId: string })
const ItemId = (JSON.parse(purchaseRequest.PurchaseParams.ExtraPurchaseInfoJson) as { ItemId: string })
.ItemId;
const offer = manifest.VendorInfo.ItemManifest.find(x => x.Id.$oid == ItemId);
if (!offer) {

View File

@ -19,6 +19,7 @@ import HubsIronwakeDondaVendorManifest from "@/static/fixed_responses/getVendorI
import HubsPerrinSequenceWeaponVendorManifest from "@/static/fixed_responses/getVendorInfo/HubsPerrinSequenceWeaponVendorManifest.json";
import HubsRailjackCrewMemberVendorManifest from "@/static/fixed_responses/getVendorInfo/HubsRailjackCrewMemberVendorManifest.json";
import MaskSalesmanManifest from "@/static/fixed_responses/getVendorInfo/MaskSalesmanManifest.json";
import Nova1999ConquestShopManifest from "@/static/fixed_responses/getVendorInfo/Nova1999ConquestShopManifest.json";
import OstronFishmongerVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json";
import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronPetVendorManifest.json";
import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronProspectorVendorManifest.json";
@ -69,6 +70,7 @@ const vendorManifests: IVendorManifest[] = [
HubsPerrinSequenceWeaponVendorManifest,
HubsRailjackCrewMemberVendorManifest,
MaskSalesmanManifest,
Nova1999ConquestShopManifest,
OstronFishmongerVendorManifest,
OstronPetVendorManifest,
OstronProspectorVendorManifest,

View File

@ -1,4 +1,11 @@
import { IInventoryChanges } from "./purchaseTypes";
export interface IGenericUpdate {
NodeIntrosCompleted: string | string[];
// AffiliationMods: any[];
}
export interface IUpdateNodeIntrosResponse {
MissionRewards: [];
InventoryChanges: IInventoryChanges;
}

View File

@ -0,0 +1,188 @@
{
"VendorInfo": {
"_id": {
"$oid": "67dadc30e4b6e0e5979c8d6a"
},
"TypeName": "/Lotus/Types/Game/VendorManifests/TheHex/Nova1999ConquestShopManifest",
"ItemManifest": [
{
"StoreItem": "/Lotus/StoreItems/Types/BoosterPacks/1999StickersPackEchoesArchimedea",
"ItemPrices": [
{
"ItemCount": 10,
"ItemType": "/Lotus/Types/Items/MiscItems/1999ConquestBucks",
"ProductCategory": "MiscItems"
}
],
"Bin": "BIN_0",
"QuantityMultiplier": 1,
"Expiry": {
"$date": {
"$numberLong": "2051240400000"
}
},
"AllowMultipurchase": true,
"Id": {
"$oid": "67db32b983b2ad79a9c1c18c"
}
},
{
"StoreItem": "/Lotus/StoreItems/Types/BoosterPacks/1999StickersPackEchoesArchimedeaFree",
"ItemPrices": [
{
"ItemCount": 1,
"ItemType": "/Lotus/Types/Items/MiscItems/1999FreeStickersPack",
"ProductCategory": "MiscItems"
}
],
"Bin": "BIN_0",
"QuantityMultiplier": 1,
"Expiry": {
"$date": {
"$numberLong": "2051240400000"
}
},
"AllowMultipurchase": true,
"Id": {
"$oid": "67db32b983b2ad79a9c1c18d"
}
},
{
"StoreItem": "/Lotus/StoreItems/Types/BoosterPacks/1999StickersPackEchoesArchimedeaFixed",
"ItemPrices": [
{
"ItemCount": 1,
"ItemType": "/Lotus/Types/Items/MiscItems/1999FixedStickersPack",
"ProductCategory": "MiscItems"
}
],
"Bin": "BIN_0",
"QuantityMultiplier": 1,
"Expiry": {
"$date": {
"$numberLong": "2051240400000"
}
},
"AllowMultipurchase": true,
"Id": {
"$oid": "67db32b983b2ad79a9c1c18e"
}
},
{
"StoreItem": "/Lotus/Types/StoreItems/Packages/SyndicateVosforPack",
"ItemPrices": [
{
"ItemCount": 6,
"ItemType": "/Lotus/Types/Items/MiscItems/1999ConquestBucks",
"ProductCategory": "MiscItems"
}
],
"Bin": "BIN_0",
"QuantityMultiplier": 1,
"Expiry": {
"$date": {
"$numberLong": "2051240400000"
}
},
"AllowMultipurchase": true,
"Id": {
"$oid": "67db32b983b2ad79a9c1c18f"
}
},
{
"StoreItem": "/Lotus/StoreItems/Types/Items/ShipDecos/StickerPictureFrame",
"ItemPrices": [
{
"ItemCount": 10,
"ItemType": "/Lotus/Types/Items/MiscItems/1999ConquestBucks",
"ProductCategory": "MiscItems"
}
],
"Bin": "BIN_0",
"QuantityMultiplier": 1,
"Expiry": {
"$date": {
"$numberLong": "2051240400000"
}
},
"AllowMultipurchase": true,
"Id": {
"$oid": "67db32b983b2ad79a9c1c190"
}
},
{
"StoreItem": "/Lotus/StoreItems/Upgrades/CosmeticEnhancers/Utility/AbilityRadiationProcsCreateUniversalOrbsOnKill",
"ItemPrices": [
{
"ItemCount": 5,
"ItemType": "/Lotus/Types/Items/MiscItems/1999ConquestBucks",
"ProductCategory": "MiscItems"
}
],
"Bin": "BIN_1",
"QuantityMultiplier": 1,
"Expiry": {
"$date": {
"$numberLong": "2051240400000"
}
},
"PurchaseQuantityLimit": 1,
"AllowMultipurchase": false,
"Id": {
"$oid": "67db32b983b2ad79a9c1c191"
}
},
{
"StoreItem": "/Lotus/StoreItems/Upgrades/CosmeticEnhancers/Offensive/AbilityHeatProcsGiveCritChance",
"ItemPrices": [
{
"ItemCount": 5,
"ItemType": "/Lotus/Types/Items/MiscItems/1999ConquestBucks",
"ProductCategory": "MiscItems"
}
],
"Bin": "BIN_1",
"QuantityMultiplier": 1,
"Expiry": {
"$date": {
"$numberLong": "2051240400000"
}
},
"PurchaseQuantityLimit": 1,
"AllowMultipurchase": false,
"Id": {
"$oid": "67db32b983b2ad79a9c1c192"
}
},
{
"StoreItem": "/Lotus/StoreItems/Upgrades/CosmeticEnhancers/Defensive/InvulnerabilityOnDeathOnMercyKill",
"ItemPrices": [
{
"ItemCount": 5,
"ItemType": "/Lotus/Types/Items/MiscItems/1999ConquestBucks",
"ProductCategory": "MiscItems"
}
],
"Bin": "BIN_1",
"QuantityMultiplier": 1,
"Expiry": {
"$date": {
"$numberLong": "2051240400000"
}
},
"PurchaseQuantityLimit": 1,
"AllowMultipurchase": false,
"Id": {
"$oid": "67db32b983b2ad79a9c1c193"
}
}
],
"PropertyTextHash": "CB7D0E807FD5E2BCD059195201D963B9",
"RequiredGoalTag": "",
"Expiry": {
"$date": {
"$numberLong": "2051240400000"
}
}
}
}