feat: track KIM resets
All checks were successful
Build / build (push) Successful in 1m9s
Build / build (pull_request) Successful in 1m21s

This was added in 38.5.0 for FlareRank1Convo3
This commit is contained in:
Sainan 2025-04-09 16:50:09 +02:00
parent 005350bde0
commit 41a0cfe40f
3 changed files with 5 additions and 0 deletions

View File

@ -7,6 +7,8 @@ export const clearDialogueHistoryController: RequestHandler = async (req, res) =
const inventory = await getInventory(accountId); const inventory = await getInventory(accountId);
const request = JSON.parse(String(req.body)) as IClearDialogueRequest; const request = JSON.parse(String(req.body)) as IClearDialogueRequest;
if (inventory.DialogueHistory && inventory.DialogueHistory.Dialogues) { if (inventory.DialogueHistory && inventory.DialogueHistory.Dialogues) {
inventory.DialogueHistory.Resets ??= 0;
inventory.DialogueHistory.Resets += 1;
for (const dialogueName of request.Dialogues) { for (const dialogueName of request.Dialogues) {
const index = inventory.DialogueHistory.Dialogues.findIndex(x => x.DialogueName == dialogueName); const index = inventory.DialogueHistory.Dialogues.findIndex(x => x.DialogueName == dialogueName);
if (index != -1) { if (index != -1) {

View File

@ -797,6 +797,7 @@ dialogueSchema.set("toJSON", {
const dialogueHistorySchema = new Schema<IDialogueHistoryDatabase>( const dialogueHistorySchema = new Schema<IDialogueHistoryDatabase>(
{ {
YearIteration: { type: Number, required: true }, YearIteration: { type: Number, required: true },
Resets: Number,
Dialogues: { type: [dialogueSchema], required: false } Dialogues: { type: [dialogueSchema], required: false }
}, },
{ _id: false } { _id: false }

View File

@ -1074,11 +1074,13 @@ export interface IEndlessXpProgress {
export interface IDialogueHistoryClient { export interface IDialogueHistoryClient {
YearIteration: number; YearIteration: number;
Resets?: number; // added in 38.5.0
Dialogues?: IDialogueClient[]; Dialogues?: IDialogueClient[];
} }
export interface IDialogueHistoryDatabase { export interface IDialogueHistoryDatabase {
YearIteration: number; YearIteration: number;
Resets?: number;
Dialogues?: IDialogueDatabase[]; Dialogues?: IDialogueDatabase[];
} }