feat: track KIM resets (#1528)
This was added in 38.5.0 for FlareRank1Convo3 Reviewed-on: OpenWF/SpaceNinjaServer#1528 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
							
								
									a8f174bce1
								
							
						
					
					
						commit
						02a4d2b30a
					
				@ -7,6 +7,8 @@ export const clearDialogueHistoryController: RequestHandler = async (req, res) =
 | 
			
		||||
    const inventory = await getInventory(accountId);
 | 
			
		||||
    const request = JSON.parse(String(req.body)) as IClearDialogueRequest;
 | 
			
		||||
    if (inventory.DialogueHistory && inventory.DialogueHistory.Dialogues) {
 | 
			
		||||
        inventory.DialogueHistory.Resets ??= 0;
 | 
			
		||||
        inventory.DialogueHistory.Resets += 1;
 | 
			
		||||
        for (const dialogueName of request.Dialogues) {
 | 
			
		||||
            const index = inventory.DialogueHistory.Dialogues.findIndex(x => x.DialogueName == dialogueName);
 | 
			
		||||
            if (index != -1) {
 | 
			
		||||
 | 
			
		||||
@ -797,6 +797,7 @@ dialogueSchema.set("toJSON", {
 | 
			
		||||
const dialogueHistorySchema = new Schema<IDialogueHistoryDatabase>(
 | 
			
		||||
    {
 | 
			
		||||
        YearIteration: { type: Number, required: true },
 | 
			
		||||
        Resets: Number,
 | 
			
		||||
        Dialogues: { type: [dialogueSchema], required: false }
 | 
			
		||||
    },
 | 
			
		||||
    { _id: false }
 | 
			
		||||
 | 
			
		||||
@ -1074,11 +1074,13 @@ export interface IEndlessXpProgress {
 | 
			
		||||
 | 
			
		||||
export interface IDialogueHistoryClient {
 | 
			
		||||
    YearIteration: number;
 | 
			
		||||
    Resets?: number; // added in 38.5.0
 | 
			
		||||
    Dialogues?: IDialogueClient[];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface IDialogueHistoryDatabase {
 | 
			
		||||
    YearIteration: number;
 | 
			
		||||
    Resets?: number;
 | 
			
		||||
    Dialogues?: IDialogueDatabase[];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user