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,
 | 
					    ITraits,
 | 
				
			||||||
    IKubrowPetDetailsClient,
 | 
					    IKubrowPetDetailsClient,
 | 
				
			||||||
    IKubrowPetEggDatabase,
 | 
					    IKubrowPetEggDatabase,
 | 
				
			||||||
    IKubrowPetEggClient
 | 
					    IKubrowPetEggClient,
 | 
				
			||||||
 | 
					    ICustomMarkers,
 | 
				
			||||||
 | 
					    IMarkerInfo,
 | 
				
			||||||
 | 
					    IMarker
 | 
				
			||||||
} from "../../types/inventoryTypes/inventoryTypes";
 | 
					} from "../../types/inventoryTypes/inventoryTypes";
 | 
				
			||||||
import { IOid } from "../../types/commonTypes";
 | 
					import { IOid } from "../../types/commonTypes";
 | 
				
			||||||
import {
 | 
					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>(
 | 
					const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        accountOwnerId: Schema.Types.ObjectId,
 | 
					        accountOwnerId: Schema.Types.ObjectId,
 | 
				
			||||||
@ -1133,6 +1165,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: { type: [CustomMarkersSchema], default: undefined },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //Unknown and system
 | 
					        //Unknown and system
 | 
				
			||||||
        DuviriInfo: DuviriInfoSchema,
 | 
					        DuviriInfo: DuviriInfoSchema,
 | 
				
			||||||
        Mailbox: MailboxSchema,
 | 
					        Mailbox: MailboxSchema,
 | 
				
			||||||
 | 
				
			|||||||
@ -155,6 +155,20 @@ export const addMissionInventoryUpdates = (
 | 
				
			|||||||
                inventory.PlayerSkills.LPP_DRIFTER += value.LPP_DRIFTER;
 | 
					                inventory.PlayerSkills.LPP_DRIFTER += value.LPP_DRIFTER;
 | 
				
			||||||
                break;
 | 
					                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:
 | 
					            default:
 | 
				
			||||||
                // Equipment XP updates
 | 
					                // Equipment XP updates
 | 
				
			||||||
                if (equipmentKeys.includes(key as TEquipmentKey)) {
 | 
					                if (equipmentKeys.includes(key as TEquipmentKey)) {
 | 
				
			||||||
 | 
				
			|||||||
@ -343,6 +343,7 @@ export interface IInventoryClient extends IDailyAffiliations {
 | 
				
			|||||||
    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[];
 | 
				
			||||||
@ -1056,3 +1057,23 @@ export interface ICompletedDialogue {
 | 
				
			|||||||
    Booleans: string[];
 | 
					    Booleans: string[];
 | 
				
			||||||
    Choices: number[];
 | 
					    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,
 | 
					    TSolarMapRegion,
 | 
				
			||||||
    TEquipmentKey,
 | 
					    TEquipmentKey,
 | 
				
			||||||
    IFusionTreasure,
 | 
					    IFusionTreasure,
 | 
				
			||||||
 | 
					    ICustomMarkers,
 | 
				
			||||||
    IPlayerSkills,
 | 
					    IPlayerSkills,
 | 
				
			||||||
    IQuestKeyDatabase
 | 
					    IQuestKeyDatabase
 | 
				
			||||||
} from "./inventoryTypes/inventoryTypes";
 | 
					} from "./inventoryTypes/inventoryTypes";
 | 
				
			||||||
@ -75,6 +76,7 @@ export type IMissionInventoryUpdateRequest = {
 | 
				
			|||||||
    EvolutionProgress?: IEvolutionProgress[];
 | 
					    EvolutionProgress?: IEvolutionProgress[];
 | 
				
			||||||
    FocusXpIncreases?: number[];
 | 
					    FocusXpIncreases?: number[];
 | 
				
			||||||
    PlayerSkillGains: IPlayerSkills;
 | 
					    PlayerSkillGains: IPlayerSkills;
 | 
				
			||||||
 | 
					    CustomMarkers?: ICustomMarkers[];
 | 
				
			||||||
} & {
 | 
					} & {
 | 
				
			||||||
    [K in TEquipmentKey]?: IEquipmentClient[];
 | 
					    [K in TEquipmentKey]?: IEquipmentClient[];
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user