fix: loc-pin saving
This commit is contained in:
parent
76964585eb
commit
b543392f34
@ -36,7 +36,10 @@ import {
|
|||||||
IPeriodicMissionCompletionDatabase,
|
IPeriodicMissionCompletionDatabase,
|
||||||
IPeriodicMissionCompletionResponse,
|
IPeriodicMissionCompletionResponse,
|
||||||
ILoreFragmentScan,
|
ILoreFragmentScan,
|
||||||
IEvolutionProgress
|
IEvolutionProgress,
|
||||||
|
ICustomMarkers,
|
||||||
|
IMarkerInfo,
|
||||||
|
IMarker
|
||||||
} from "../../types/inventoryTypes/inventoryTypes";
|
} from "../../types/inventoryTypes/inventoryTypes";
|
||||||
import { IOid } from "../../types/commonTypes";
|
import { IOid } from "../../types/commonTypes";
|
||||||
import {
|
import {
|
||||||
@ -578,6 +581,35 @@ const evolutionProgressSchema = new Schema<IEvolutionProgress>(
|
|||||||
{ _id: false }
|
{ _id: false }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const markerSchema = new Schema<IMarker>(
|
||||||
|
{
|
||||||
|
anchorName: String,
|
||||||
|
color: Number,
|
||||||
|
label: String,
|
||||||
|
x: Number,
|
||||||
|
y: Number,
|
||||||
|
z: Number,
|
||||||
|
showInHud: Boolean
|
||||||
|
},
|
||||||
|
{ _id: false }
|
||||||
|
);
|
||||||
|
|
||||||
|
const markerInfoSchema = new Schema<IMarkerInfo>(
|
||||||
|
{
|
||||||
|
icon: String,
|
||||||
|
markers: [markerSchema]
|
||||||
|
},
|
||||||
|
{ _id: false }
|
||||||
|
);
|
||||||
|
|
||||||
|
const CustomMarkersSchema = new Schema<ICustomMarkers>(
|
||||||
|
{
|
||||||
|
tag: String,
|
||||||
|
markerInfos: [markerInfoSchema]
|
||||||
|
},
|
||||||
|
{ _id: false }
|
||||||
|
);
|
||||||
|
|
||||||
const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
|
const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
|
||||||
{
|
{
|
||||||
accountOwnerId: Schema.Types.ObjectId,
|
accountOwnerId: Schema.Types.ObjectId,
|
||||||
@ -900,6 +932,9 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
|
|||||||
//https://warframe.fandom.com/wiki/Incarnon
|
//https://warframe.fandom.com/wiki/Incarnon
|
||||||
EvolutionProgress: { type: [evolutionProgressSchema], default: undefined },
|
EvolutionProgress: { type: [evolutionProgressSchema], default: undefined },
|
||||||
|
|
||||||
|
//https://warframe.fandom.com/wiki/Loc-Pin
|
||||||
|
CustomMarkers: [CustomMarkersSchema],
|
||||||
|
|
||||||
//Unknown and system
|
//Unknown and system
|
||||||
DuviriInfo: DuviriInfoSchema,
|
DuviriInfo: DuviriInfoSchema,
|
||||||
Mailbox: MailboxSchema,
|
Mailbox: MailboxSchema,
|
||||||
|
@ -731,7 +731,11 @@ export const missionInventoryUpdate = async (data: IMissionInventoryUpdateReques
|
|||||||
Consumables,
|
Consumables,
|
||||||
Recipes,
|
Recipes,
|
||||||
Missions,
|
Missions,
|
||||||
FusionTreasures
|
FusionTreasures,
|
||||||
|
AffiliationChanges,
|
||||||
|
EvolutionProgress,
|
||||||
|
LastRegionPlayed,
|
||||||
|
CustomMarkers
|
||||||
} = data;
|
} = data;
|
||||||
const inventory = await getInventory(accountId);
|
const inventory = await getInventory(accountId);
|
||||||
|
|
||||||
@ -742,7 +746,7 @@ export const missionInventoryUpdate = async (data: IMissionInventoryUpdateReques
|
|||||||
inventory.FusionPoints += FusionPoints || 0;
|
inventory.FusionPoints += FusionPoints || 0;
|
||||||
|
|
||||||
// syndicate
|
// syndicate
|
||||||
data.AffiliationChanges?.forEach(affiliation => {
|
AffiliationChanges?.forEach(affiliation => {
|
||||||
const syndicate = inventory.Affiliations.find(x => x.Tag == affiliation.Tag);
|
const syndicate = inventory.Affiliations.find(x => x.Tag == affiliation.Tag);
|
||||||
if (syndicate !== undefined) {
|
if (syndicate !== undefined) {
|
||||||
syndicate.Standing =
|
syndicate.Standing =
|
||||||
@ -763,8 +767,8 @@ export const missionInventoryUpdate = async (data: IMissionInventoryUpdateReques
|
|||||||
equipmentKeys.forEach(key => addGearExpByCategory(inventory, data[key], key));
|
equipmentKeys.forEach(key => addGearExpByCategory(inventory, data[key], key));
|
||||||
|
|
||||||
// Incarnon Challenges
|
// Incarnon Challenges
|
||||||
if (data.EvolutionProgress) {
|
if (EvolutionProgress) {
|
||||||
for (const evoProgress of data.EvolutionProgress) {
|
for (const evoProgress of EvolutionProgress) {
|
||||||
const entry = inventory.EvolutionProgress
|
const entry = inventory.EvolutionProgress
|
||||||
? inventory.EvolutionProgress.find(entry => entry.ItemType == evoProgress.ItemType)
|
? inventory.EvolutionProgress.find(entry => entry.ItemType == evoProgress.ItemType)
|
||||||
: undefined;
|
: undefined;
|
||||||
@ -779,8 +783,22 @@ export const missionInventoryUpdate = async (data: IMissionInventoryUpdateReques
|
|||||||
}
|
}
|
||||||
|
|
||||||
// LastRegionPlayed
|
// LastRegionPlayed
|
||||||
if (data.LastRegionPlayed) {
|
if (LastRegionPlayed) {
|
||||||
inventory.LastRegionPlayed = data.LastRegionPlayed;
|
inventory.LastRegionPlayed = LastRegionPlayed;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CustomMarkers) {
|
||||||
|
CustomMarkers.forEach(markers => {
|
||||||
|
const map = inventory.CustomMarkers
|
||||||
|
? inventory.CustomMarkers.find(entry => entry.tag == markers.tag)
|
||||||
|
: undefined;
|
||||||
|
if (map) {
|
||||||
|
map.markerInfos = markers.markerInfos;
|
||||||
|
} else {
|
||||||
|
inventory.CustomMarkers ??= [];
|
||||||
|
inventory.CustomMarkers.push(markers);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// other
|
// other
|
||||||
|
@ -277,6 +277,7 @@ export interface IInventoryResponse {
|
|||||||
LastInventorySync: IOid;
|
LastInventorySync: IOid;
|
||||||
NextRefill: IMongoDate; // Next time argon crystals will have a decay tick
|
NextRefill: IMongoDate; // Next time argon crystals will have a decay tick
|
||||||
FoundToday?: IMiscItem[]; // for Argon Crystals
|
FoundToday?: IMiscItem[]; // for Argon Crystals
|
||||||
|
CustomMarkers: ICustomMarkers[];
|
||||||
ActiveLandscapeTraps: any[];
|
ActiveLandscapeTraps: any[];
|
||||||
EvolutionProgress?: IEvolutionProgress[];
|
EvolutionProgress?: IEvolutionProgress[];
|
||||||
RepVotes: any[];
|
RepVotes: any[];
|
||||||
@ -916,3 +917,23 @@ export interface IEvolutionProgress {
|
|||||||
Rank: number;
|
Rank: number;
|
||||||
ItemType: string;
|
ItemType: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface ICustomMarkers {
|
||||||
|
tag: string;
|
||||||
|
markerInfos: IMarkerInfo[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IMarkerInfo {
|
||||||
|
icon: string;
|
||||||
|
markers: IMarker[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IMarker {
|
||||||
|
anchorName: string;
|
||||||
|
color: number;
|
||||||
|
label?: string;
|
||||||
|
x: number;
|
||||||
|
y: number;
|
||||||
|
z: number;
|
||||||
|
showInHud: boolean;
|
||||||
|
}
|
||||||
|
@ -13,7 +13,8 @@ import {
|
|||||||
ISeasonChallenge,
|
ISeasonChallenge,
|
||||||
TSolarMapRegion,
|
TSolarMapRegion,
|
||||||
TEquipmentKey,
|
TEquipmentKey,
|
||||||
IFusionTreasure
|
IFusionTreasure,
|
||||||
|
ICustomMarkers
|
||||||
} from "./inventoryTypes/inventoryTypes";
|
} from "./inventoryTypes/inventoryTypes";
|
||||||
|
|
||||||
export interface IArtifactsRequest {
|
export interface IArtifactsRequest {
|
||||||
@ -70,6 +71,7 @@ export interface IMissionInventoryUpdateRequest {
|
|||||||
Missions?: IMission;
|
Missions?: IMission;
|
||||||
EvolutionProgress?: IEvolutionProgress[];
|
EvolutionProgress?: IEvolutionProgress[];
|
||||||
LastRegionPlayed?: TSolarMapRegion;
|
LastRegionPlayed?: TSolarMapRegion;
|
||||||
|
CustomMarkers?: ICustomMarkers[];
|
||||||
|
|
||||||
FusionPoints?: number; // Not a part of the request, but we put it in this struct as an intermediate storage.
|
FusionPoints?: number; // Not a part of the request, but we put it in this struct as an intermediate storage.
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user