From ef92040f258147f94a4615c4bf48add6d73016a4 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Tue, 1 Jul 2025 09:40:27 +0200 Subject: [PATCH 1/2] feat: year rollover kiss emails --- package-lock.json | 8 +-- package.json | 2 +- src/controllers/api/inventoryController.ts | 63 ++++++++++++++++++++++ src/models/inboxModel.ts | 4 ++ src/services/inventoryService.ts | 19 ++++++- src/services/itemDataService.ts | 2 + 6 files changed, 91 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index db97566d..7fbb4684 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,7 @@ "ncp": "^2.0.0", "typescript": "^5.5", "undici": "^7.10.0", - "warframe-public-export-plus": "^0.5.74", + "warframe-public-export-plus": "^0.5.76", "warframe-riven-info": "^0.1.2", "winston": "^3.17.0", "winston-daily-rotate-file": "^5.0.0", @@ -3386,9 +3386,9 @@ } }, "node_modules/warframe-public-export-plus": { - "version": "0.5.74", - "resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.74.tgz", - "integrity": "sha512-pA7dxA0lKn9w/2Sc97oxnn+CEzL1SrT9XriNLTDF4Xp+2SBEpGcfbqbdR9ljPQJopIbrc9Zy02R+uBQVomcwyA==" + "version": "0.5.76", + "resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.76.tgz", + "integrity": "sha512-0gX3NTWaxFyzUmqBSUHhPY8pMRX92iXQFqoBuMQlMG1+6uC6JMKtwP5t8cuXR3pvV2vkaCi/cDWjP1JUChkZ9g==" }, "node_modules/warframe-riven-info": { "version": "0.1.2", diff --git a/package.json b/package.json index 99f8c63d..eed277ae 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "ncp": "^2.0.0", "typescript": "^5.5", "undici": "^7.10.0", - "warframe-public-export-plus": "^0.5.74", + "warframe-public-export-plus": "^0.5.76", "warframe-riven-info": "^0.1.2", "winston": "^3.17.0", "winston-daily-rotate-file": "^5.0.0", diff --git a/src/controllers/api/inventoryController.ts b/src/controllers/api/inventoryController.ts index cb855f16..0ef83f0c 100644 --- a/src/controllers/api/inventoryController.ts +++ b/src/controllers/api/inventoryController.ts @@ -9,6 +9,7 @@ import { IPolarity, ArtifactPolarity, EquipmentFeatures } from "@/src/types/inve import { ExportCustoms, ExportFlavour, ExportResources, ExportVirtuals } from "warframe-public-export-plus"; import { applyCheatsToInfestedFoundry, handleSubsumeCompletion } from "@/src/services/infestedFoundryService"; import { + addEmailItem, addMiscItems, allDailyAffiliationKeys, cleanupInventory, @@ -110,7 +111,69 @@ export const inventoryController: RequestHandler = async (request, response) => } if (inventory.CalendarProgress) { + const previousYearIteration = inventory.CalendarProgress.Iteration; getCalendarProgress(inventory); // handle year rollover; the client expects to receive an inventory with an up-to-date CalendarProgress + + // also handle sending of kiss cinematic at year rollover + if ( + inventory.CalendarProgress.Iteration != previousYearIteration && + inventory.DialogueHistory && + inventory.DialogueHistory.Dialogues + ) { + let kalymos = false; + for (const { dialogue, kissEmail } of [ + { + dialogue: inventory.DialogueHistory.Dialogues.find( + x => x.DialogueName == "/Lotus/Types/Gameplay/1999Wf/Dialogue/ArthurDialogue_rom.dialogue" + ), + kissEmail: "/Lotus/Types/Items/EmailItems/ArthurKissEmailItem" + }, + { + dialogue: inventory.DialogueHistory.Dialogues.find( + x => x.DialogueName == "/Lotus/Types/Gameplay/1999Wf/Dialogue/EleanorDialogue_rom.dialogue" + ), + kissEmail: "/Lotus/Types/Items/EmailItems/EleanorKissEmailItem" + }, + { + dialogue: inventory.DialogueHistory.Dialogues.find( + x => x.DialogueName == "/Lotus/Types/Gameplay/1999Wf/Dialogue/LettieDialogue_rom.dialogue" + ), + kissEmail: "/Lotus/Types/Items/EmailItems/LettieKissEmailItem" + }, + { + dialogue: inventory.DialogueHistory.Dialogues.find( + x => x.DialogueName == "/Lotus/Types/Gameplay/1999Wf/Dialogue/JabirDialogue_rom.dialogue" + ), + kissEmail: "/Lotus/Types/Items/EmailItems/AmirKissEmailItem" + }, + { + dialogue: inventory.DialogueHistory.Dialogues.find( + x => x.DialogueName == "/Lotus/Types/Gameplay/1999Wf/Dialogue/AoiDialogue_rom.dialogue" + ), + kissEmail: "/Lotus/Types/Items/EmailItems/AoiKissEmailItem" + }, + { + dialogue: inventory.DialogueHistory.Dialogues.find( + x => x.DialogueName == "/Lotus/Types/Gameplay/1999Wf/Dialogue/QuincyDialogue_rom.dialogue" + ), + kissEmail: "/Lotus/Types/Items/EmailItems/QuincyKissEmailItem" + } + ]) { + if (dialogue) { + if (dialogue.Rank == 7) { + await addEmailItem(inventory, kissEmail); + kalymos = false; + break; + } + if (dialogue.Rank == 6) { + kalymos = true; + } + } + } + if (kalymos) { + await addEmailItem(inventory, "/Lotus/Types/Items/EmailItems/KalymosKissEmailItem"); + } + } } cleanupInventory(inventory); diff --git a/src/models/inboxModel.ts b/src/models/inboxModel.ts index 139e8b44..793d37d8 100644 --- a/src/models/inboxModel.ts +++ b/src/models/inboxModel.ts @@ -23,7 +23,9 @@ export interface IMessageDatabase extends IMessage { export interface IMessage { sndr: string; msg: string; + cinematic?: string; sub: string; + customData?: string; icon?: string; highPriority?: boolean; lowPrioNewPlayers?: boolean; @@ -102,7 +104,9 @@ const messageSchema = new Schema( ownerId: Schema.Types.ObjectId, sndr: String, msg: String, + cinematic: String, sub: String, + customData: String, icon: String, highPriority: Boolean, lowPrioNewPlayers: Boolean, diff --git a/src/services/inventoryService.ts b/src/services/inventoryService.ts index df9ac473..3bfb3244 100644 --- a/src/services/inventoryService.ts +++ b/src/services/inventoryService.ts @@ -83,7 +83,7 @@ import { addQuestKey, completeQuest } from "@/src/services/questService"; import { handleBundleAcqusition } from "./purchaseService"; import libraryDailyTasks from "@/static/fixed_responses/libraryDailyTasks.json"; import { getRandomElement, getRandomInt, getRandomWeightedReward, SRng } from "./rngService"; -import { createMessage } from "./inboxService"; +import { createMessage, IMessageCreationTemplate } from "./inboxService"; import { getMaxStanding, getMinStanding } from "@/src/helpers/syndicateStandingHelper"; import { getNightwaveSyndicateTag, getWorldState } from "./worldStateService"; import { ICalendarSeason } from "@/src/types/worldStateTypes"; @@ -1563,7 +1563,22 @@ export const addEmailItem = async ( const meta = ExportEmailItems[typeName]; const emailItem = inventory.EmailItems.find(x => x.ItemType == typeName); if (!emailItem || !meta.sendOnlyOnce) { - await createMessage(inventory.accountOwnerId, [convertInboxMessage(meta.message)]); + const msg: IMessageCreationTemplate = convertInboxMessage(meta.message); + if (msg.cinematic == "/Lotus/Levels/1999/PlayerHomeBalconyCinematics.level") { + msg.customData = JSON.stringify({ + Tag: msg.customData + "KissCin", + CinLoadout: { + Skins: inventory.AdultOperatorLoadOuts[0].Skins, + Upgrades: inventory.AdultOperatorLoadOuts[0].Upgrades, + attcol: inventory.AdultOperatorLoadOuts[0].attcol, + cloth: inventory.AdultOperatorLoadOuts[0].cloth, + eyecol: inventory.AdultOperatorLoadOuts[0].eyecol, + pricol: inventory.AdultOperatorLoadOuts[0].pricol, + syancol: inventory.AdultOperatorLoadOuts[0].syancol + } + }); + } + await createMessage(inventory.accountOwnerId, [msg]); if (emailItem) { emailItem.ItemCount += 1; diff --git a/src/services/itemDataService.ts b/src/services/itemDataService.ts index c44691f5..e028e8c0 100644 --- a/src/services/itemDataService.ts +++ b/src/services/itemDataService.ts @@ -251,7 +251,9 @@ export const convertInboxMessage = (message: IInboxMessage): IMessage => { return { sndr: message.sender, msg: message.body, + cinematic: message.cinematic, sub: message.title, + customData: message.customData, att: message.attachments.length > 0 ? message.attachments : undefined, countedAtt: message.countedAttachments.length > 0 ? message.countedAttachments : undefined, icon: message.icon ?? "", -- 2.47.2 From 5fe68bf2721abab5590978e742cb7cd9a1f560eb Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Tue, 1 Jul 2025 09:43:04 +0200 Subject: [PATCH 2/2] implode --- src/controllers/api/inventoryController.ts | 27 +++++++--------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/src/controllers/api/inventoryController.ts b/src/controllers/api/inventoryController.ts index 0ef83f0c..c1933a80 100644 --- a/src/controllers/api/inventoryController.ts +++ b/src/controllers/api/inventoryController.ts @@ -121,44 +121,33 @@ export const inventoryController: RequestHandler = async (request, response) => inventory.DialogueHistory.Dialogues ) { let kalymos = false; - for (const { dialogue, kissEmail } of [ + for (const { dialogueName, kissEmail } of [ { - dialogue: inventory.DialogueHistory.Dialogues.find( - x => x.DialogueName == "/Lotus/Types/Gameplay/1999Wf/Dialogue/ArthurDialogue_rom.dialogue" - ), + dialogueName: "/Lotus/Types/Gameplay/1999Wf/Dialogue/ArthurDialogue_rom.dialogue", kissEmail: "/Lotus/Types/Items/EmailItems/ArthurKissEmailItem" }, { - dialogue: inventory.DialogueHistory.Dialogues.find( - x => x.DialogueName == "/Lotus/Types/Gameplay/1999Wf/Dialogue/EleanorDialogue_rom.dialogue" - ), + dialogueName: "/Lotus/Types/Gameplay/1999Wf/Dialogue/EleanorDialogue_rom.dialogue", kissEmail: "/Lotus/Types/Items/EmailItems/EleanorKissEmailItem" }, { - dialogue: inventory.DialogueHistory.Dialogues.find( - x => x.DialogueName == "/Lotus/Types/Gameplay/1999Wf/Dialogue/LettieDialogue_rom.dialogue" - ), + dialogueName: "/Lotus/Types/Gameplay/1999Wf/Dialogue/LettieDialogue_rom.dialogue", kissEmail: "/Lotus/Types/Items/EmailItems/LettieKissEmailItem" }, { - dialogue: inventory.DialogueHistory.Dialogues.find( - x => x.DialogueName == "/Lotus/Types/Gameplay/1999Wf/Dialogue/JabirDialogue_rom.dialogue" - ), + dialogueName: "/Lotus/Types/Gameplay/1999Wf/Dialogue/JabirDialogue_rom.dialogue", kissEmail: "/Lotus/Types/Items/EmailItems/AmirKissEmailItem" }, { - dialogue: inventory.DialogueHistory.Dialogues.find( - x => x.DialogueName == "/Lotus/Types/Gameplay/1999Wf/Dialogue/AoiDialogue_rom.dialogue" - ), + dialogueName: "/Lotus/Types/Gameplay/1999Wf/Dialogue/AoiDialogue_rom.dialogue", kissEmail: "/Lotus/Types/Items/EmailItems/AoiKissEmailItem" }, { - dialogue: inventory.DialogueHistory.Dialogues.find( - x => x.DialogueName == "/Lotus/Types/Gameplay/1999Wf/Dialogue/QuincyDialogue_rom.dialogue" - ), + dialogueName: "/Lotus/Types/Gameplay/1999Wf/Dialogue/QuincyDialogue_rom.dialogue", kissEmail: "/Lotus/Types/Items/EmailItems/QuincyKissEmailItem" } ]) { + const dialogue = inventory.DialogueHistory.Dialogues.find(x => x.DialogueName == dialogueName); if (dialogue) { if (dialogue.Rank == 7) { await addEmailItem(inventory, kissEmail); -- 2.47.2