forked from OpenWF/SpaceNinjaServer
		
	chore: don't set a default avatar image type in inventory (#2075)
This seems to be somewhat of an issue for older versions, plus it's not really accurate anyway. Reviewed-on: OpenWF/SpaceNinjaServer#2075 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									f724073d93
								
							
						
					
					
						commit
						daf721f7cd
					
				@ -1,7 +1,7 @@
 | 
				
			|||||||
import { getJSONfromString, regexEscape } from "@/src/helpers/stringHelpers";
 | 
					import { getJSONfromString, regexEscape } from "@/src/helpers/stringHelpers";
 | 
				
			||||||
import { Alliance, AllianceMember, Guild, GuildMember } from "@/src/models/guildModel";
 | 
					import { Alliance, AllianceMember, Guild, GuildMember } from "@/src/models/guildModel";
 | 
				
			||||||
import { createMessage } from "@/src/services/inboxService";
 | 
					import { createMessage } from "@/src/services/inboxService";
 | 
				
			||||||
import { getInventory } from "@/src/services/inventoryService";
 | 
					import { getEffectiveAvatarImageType, getInventory } from "@/src/services/inventoryService";
 | 
				
			||||||
import { getAccountForRequest, getSuffixedName } from "@/src/services/loginService";
 | 
					import { getAccountForRequest, getSuffixedName } from "@/src/services/loginService";
 | 
				
			||||||
import { GuildPermission } from "@/src/types/guildTypes";
 | 
					import { GuildPermission } from "@/src/types/guildTypes";
 | 
				
			||||||
import { logger } from "@/src/utils/logger";
 | 
					import { logger } from "@/src/utils/logger";
 | 
				
			||||||
@ -95,7 +95,7 @@ export const addToAllianceController: RequestHandler = async (req, res) => {
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
            ],
 | 
					            ],
 | 
				
			||||||
            sub: "/Lotus/Language/Menu/Mailbox_AllianceInvite_Title",
 | 
					            sub: "/Lotus/Language/Menu/Mailbox_AllianceInvite_Title",
 | 
				
			||||||
            icon: ExportFlavour[senderInventory.ActiveAvatarImageType].icon,
 | 
					            icon: ExportFlavour[getEffectiveAvatarImageType(senderInventory)].icon,
 | 
				
			||||||
            contextInfo: alliance._id.toString(),
 | 
					            contextInfo: alliance._id.toString(),
 | 
				
			||||||
            highPriority: true,
 | 
					            highPriority: true,
 | 
				
			||||||
            acceptAction: "ALLIANCE_INVITE",
 | 
					            acceptAction: "ALLIANCE_INVITE",
 | 
				
			||||||
 | 
				
			|||||||
@ -4,7 +4,7 @@ import { Account } from "@/src/models/loginModel";
 | 
				
			|||||||
import { addInventoryDataToFriendInfo, areFriends } from "@/src/services/friendService";
 | 
					import { addInventoryDataToFriendInfo, areFriends } from "@/src/services/friendService";
 | 
				
			||||||
import { hasGuildPermission } from "@/src/services/guildService";
 | 
					import { hasGuildPermission } from "@/src/services/guildService";
 | 
				
			||||||
import { createMessage } from "@/src/services/inboxService";
 | 
					import { createMessage } from "@/src/services/inboxService";
 | 
				
			||||||
import { getInventory } from "@/src/services/inventoryService";
 | 
					import { getEffectiveAvatarImageType, getInventory } from "@/src/services/inventoryService";
 | 
				
			||||||
import { getAccountForRequest, getAccountIdForRequest, getSuffixedName } from "@/src/services/loginService";
 | 
					import { getAccountForRequest, getAccountIdForRequest, getSuffixedName } from "@/src/services/loginService";
 | 
				
			||||||
import { IOid } from "@/src/types/commonTypes";
 | 
					import { IOid } from "@/src/types/commonTypes";
 | 
				
			||||||
import { GuildPermission, IGuildMemberClient } from "@/src/types/guildTypes";
 | 
					import { GuildPermission, IGuildMemberClient } from "@/src/types/guildTypes";
 | 
				
			||||||
@ -64,7 +64,7 @@ export const addToGuildController: RequestHandler = async (req, res) => {
 | 
				
			|||||||
                    }
 | 
					                    }
 | 
				
			||||||
                ],
 | 
					                ],
 | 
				
			||||||
                sub: "/Lotus/Language/Menu/Mailbox_ClanInvite_Title",
 | 
					                sub: "/Lotus/Language/Menu/Mailbox_ClanInvite_Title",
 | 
				
			||||||
                icon: ExportFlavour[senderInventory.ActiveAvatarImageType].icon,
 | 
					                icon: ExportFlavour[getEffectiveAvatarImageType(senderInventory)].icon,
 | 
				
			||||||
                contextInfo: payload.GuildId.$oid,
 | 
					                contextInfo: payload.GuildId.$oid,
 | 
				
			||||||
                highPriority: true,
 | 
					                highPriority: true,
 | 
				
			||||||
                acceptAction: "GUILD_INVITE",
 | 
					                acceptAction: "GUILD_INVITE",
 | 
				
			||||||
 | 
				
			|||||||
@ -2,7 +2,12 @@ import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
				
			|||||||
import { Account } from "@/src/models/loginModel";
 | 
					import { Account } from "@/src/models/loginModel";
 | 
				
			||||||
import { areFriends } from "@/src/services/friendService";
 | 
					import { areFriends } from "@/src/services/friendService";
 | 
				
			||||||
import { createMessage } from "@/src/services/inboxService";
 | 
					import { createMessage } from "@/src/services/inboxService";
 | 
				
			||||||
import { combineInventoryChanges, getInventory, updateCurrency } from "@/src/services/inventoryService";
 | 
					import {
 | 
				
			||||||
 | 
					    combineInventoryChanges,
 | 
				
			||||||
 | 
					    getEffectiveAvatarImageType,
 | 
				
			||||||
 | 
					    getInventory,
 | 
				
			||||||
 | 
					    updateCurrency
 | 
				
			||||||
 | 
					} from "@/src/services/inventoryService";
 | 
				
			||||||
import { getAccountForRequest, getSuffixedName } from "@/src/services/loginService";
 | 
					import { getAccountForRequest, getSuffixedName } from "@/src/services/loginService";
 | 
				
			||||||
import { handleStoreItemAcquisition } from "@/src/services/purchaseService";
 | 
					import { handleStoreItemAcquisition } from "@/src/services/purchaseService";
 | 
				
			||||||
import { IOid } from "@/src/types/commonTypes";
 | 
					import { IOid } from "@/src/types/commonTypes";
 | 
				
			||||||
@ -85,7 +90,7 @@ export const giftingController: RequestHandler = async (req, res) => {
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
            ],
 | 
					            ],
 | 
				
			||||||
            sub: "/Lotus/Language/Menu/GiftReceivedSubject",
 | 
					            sub: "/Lotus/Language/Menu/GiftReceivedSubject",
 | 
				
			||||||
            icon: ExportFlavour[senderInventory.ActiveAvatarImageType].icon,
 | 
					            icon: ExportFlavour[getEffectiveAvatarImageType(senderInventory)].icon,
 | 
				
			||||||
            gifts: [
 | 
					            gifts: [
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    GiftType: data.PurchaseParams.StoreItem
 | 
					                    GiftType: data.PurchaseParams.StoreItem
 | 
				
			||||||
 | 
				
			|||||||
@ -9,7 +9,12 @@ import {
 | 
				
			|||||||
    getMessage
 | 
					    getMessage
 | 
				
			||||||
} from "@/src/services/inboxService";
 | 
					} from "@/src/services/inboxService";
 | 
				
			||||||
import { getAccountForRequest, getAccountFromSuffixedName, getSuffixedName } from "@/src/services/loginService";
 | 
					import { getAccountForRequest, getAccountFromSuffixedName, getSuffixedName } from "@/src/services/loginService";
 | 
				
			||||||
import { addItems, combineInventoryChanges, getInventory } from "@/src/services/inventoryService";
 | 
					import {
 | 
				
			||||||
 | 
					    addItems,
 | 
				
			||||||
 | 
					    combineInventoryChanges,
 | 
				
			||||||
 | 
					    getEffectiveAvatarImageType,
 | 
				
			||||||
 | 
					    getInventory
 | 
				
			||||||
 | 
					} from "@/src/services/inventoryService";
 | 
				
			||||||
import { logger } from "@/src/utils/logger";
 | 
					import { logger } from "@/src/utils/logger";
 | 
				
			||||||
import { ExportFlavour } from "warframe-public-export-plus";
 | 
					import { ExportFlavour } from "warframe-public-export-plus";
 | 
				
			||||||
import { handleStoreItemAcquisition } from "@/src/services/purchaseService";
 | 
					import { handleStoreItemAcquisition } from "@/src/services/purchaseService";
 | 
				
			||||||
@ -88,7 +93,7 @@ export const inboxController: RequestHandler = async (req, res) => {
 | 
				
			|||||||
                                }
 | 
					                                }
 | 
				
			||||||
                            ],
 | 
					                            ],
 | 
				
			||||||
                            sub: "/Lotus/Language/Menu/GiftReceivedConfirmationSubject",
 | 
					                            sub: "/Lotus/Language/Menu/GiftReceivedConfirmationSubject",
 | 
				
			||||||
                            icon: ExportFlavour[inventory.ActiveAvatarImageType].icon,
 | 
					                            icon: ExportFlavour[getEffectiveAvatarImageType(inventory)].icon,
 | 
				
			||||||
                            highPriority: true
 | 
					                            highPriority: true
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    ]);
 | 
					                    ]);
 | 
				
			||||||
 | 
				
			|||||||
@ -1621,7 +1621,7 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
 | 
				
			|||||||
        Drones: [droneSchema],
 | 
					        Drones: [droneSchema],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //Active profile ico
 | 
					        //Active profile ico
 | 
				
			||||||
        ActiveAvatarImageType: { type: String, default: "/Lotus/Types/StoreItems/AvatarImages/AvatarImageDefault" },
 | 
					        ActiveAvatarImageType: String,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // open location store like EidolonPlainsDiscoverable or OrbVallisCaveDiscoverable
 | 
					        // open location store like EidolonPlainsDiscoverable or OrbVallisCaveDiscoverable
 | 
				
			||||||
        DiscoveredMarkers: [discoveredMarkerSchema],
 | 
					        DiscoveredMarkers: [discoveredMarkerSchema],
 | 
				
			||||||
 | 
				
			|||||||
@ -2025,3 +2025,7 @@ export const giveNemesisPetRecipe = (
 | 
				
			|||||||
        } satisfies INemesisPetTargetFingerprint)
 | 
					        } satisfies INemesisPetTargetFingerprint)
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export const getEffectiveAvatarImageType = (inventory: TInventoryDatabaseDocument): string => {
 | 
				
			||||||
 | 
					    return inventory.ActiveAvatarImageType ?? "/Lotus/Types/StoreItems/AvatarImages/AvatarImageDefault";
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
				
			|||||||
@ -296,7 +296,7 @@ export interface IInventoryClient extends IDailyAffiliations, InventoryClientEqu
 | 
				
			|||||||
    SortieRewardAttenuation?: ISortieRewardAttenuation[];
 | 
					    SortieRewardAttenuation?: ISortieRewardAttenuation[];
 | 
				
			||||||
    Drones: IDroneClient[];
 | 
					    Drones: IDroneClient[];
 | 
				
			||||||
    StepSequencers: IStepSequencer[];
 | 
					    StepSequencers: IStepSequencer[];
 | 
				
			||||||
    ActiveAvatarImageType: string;
 | 
					    ActiveAvatarImageType?: string;
 | 
				
			||||||
    ShipDecorations: ITypeCount[];
 | 
					    ShipDecorations: ITypeCount[];
 | 
				
			||||||
    DiscoveredMarkers: IDiscoveredMarker[];
 | 
					    DiscoveredMarkers: IDiscoveredMarker[];
 | 
				
			||||||
    //CompletedJobs: ICompletedJob[];
 | 
					    //CompletedJobs: ICompletedJob[];
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user