forked from OpenWF/SpaceNinjaServer
feat: loc-pin saving (#879)
Closes #404 Co-authored-by: Sainan <sainan@calamity.inc> Reviewed-on: http://209.141.38.3/OpenWF/SpaceNinjaServer/pulls/879 Reviewed-by: Sainan <sainan@noreply.localhost> Co-authored-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com> Co-committed-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
This commit is contained in:
parent
53ce6ccce2
commit
5460ccf93d
@ -60,7 +60,10 @@ import {
|
||||
ITraits,
|
||||
IKubrowPetDetailsClient,
|
||||
IKubrowPetEggDatabase,
|
||||
IKubrowPetEggClient
|
||||
IKubrowPetEggClient,
|
||||
ICustomMarkers,
|
||||
IMarkerInfo,
|
||||
IMarker
|
||||
} from "../../types/inventoryTypes/inventoryTypes";
|
||||
import { IOid } from "../../types/commonTypes";
|
||||
import {
|
||||
@ -849,6 +852,35 @@ infestedFoundrySchema.set("toJSON", {
|
||||
}
|
||||
});
|
||||
|
||||
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>(
|
||||
{
|
||||
accountOwnerId: Schema.Types.ObjectId,
|
||||
@ -1133,6 +1165,9 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
|
||||
//https://warframe.fandom.com/wiki/Incarnon
|
||||
EvolutionProgress: { type: [evolutionProgressSchema], default: undefined },
|
||||
|
||||
//https://warframe.fandom.com/wiki/Loc-Pin
|
||||
CustomMarkers: { type: [CustomMarkersSchema], default: undefined },
|
||||
|
||||
//Unknown and system
|
||||
DuviriInfo: DuviriInfoSchema,
|
||||
Mailbox: MailboxSchema,
|
||||
|
@ -155,6 +155,20 @@ export const addMissionInventoryUpdates = (
|
||||
inventory.PlayerSkills.LPP_DRIFTER += value.LPP_DRIFTER;
|
||||
break;
|
||||
}
|
||||
case "CustomMarkers": {
|
||||
value.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);
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
default:
|
||||
// Equipment XP updates
|
||||
if (equipmentKeys.includes(key as TEquipmentKey)) {
|
||||
|
@ -343,6 +343,7 @@ export interface IInventoryClient extends IDailyAffiliations {
|
||||
LastInventorySync: IOid;
|
||||
NextRefill: IMongoDate; // Next time argon crystals will have a decay tick
|
||||
FoundToday?: IMiscItem[]; // for Argon Crystals
|
||||
CustomMarkers: ICustomMarkers[];
|
||||
ActiveLandscapeTraps: any[];
|
||||
EvolutionProgress?: IEvolutionProgress[];
|
||||
RepVotes: any[];
|
||||
@ -1056,3 +1057,23 @@ export interface ICompletedDialogue {
|
||||
Booleans: string[];
|
||||
Choices: number[];
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ import {
|
||||
TSolarMapRegion,
|
||||
TEquipmentKey,
|
||||
IFusionTreasure,
|
||||
ICustomMarkers,
|
||||
IPlayerSkills,
|
||||
IQuestKeyDatabase
|
||||
} from "./inventoryTypes/inventoryTypes";
|
||||
@ -75,6 +76,7 @@ export type IMissionInventoryUpdateRequest = {
|
||||
EvolutionProgress?: IEvolutionProgress[];
|
||||
FocusXpIncreases?: number[];
|
||||
PlayerSkillGains: IPlayerSkills;
|
||||
CustomMarkers?: ICustomMarkers[];
|
||||
} & {
|
||||
[K in TEquipmentKey]?: IEquipmentClient[];
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user