Update Healer Man server
This commit is contained in:
1 parent
15a5254380
commit
9d7e0e2f9e
71 files changed
+3490
-81
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import { validBossDifficulty } from "./dungeonDifficulty";
|
||||
import { normalizeBiteSizedSelection, type BiteSizedRunSelection } from "../../shared/bite-sized-layouts.mjs";
|
||||
|
||||
export interface DungeonRunMember {
|
||||
readonly name: string;
|
||||
@@ -10,6 +11,7 @@ export interface DungeonRunMember {
|
||||
}
|
||||
|
||||
export interface DungeonRunProgress {
|
||||
readonly biteSizedSelection?: BiteSizedRunSelection;
|
||||
readonly id: string;
|
||||
readonly dungeonId: string;
|
||||
readonly difficultyId: string;
|
||||
@@ -23,6 +25,7 @@ export interface DungeonRunProgress {
|
||||
}
|
||||
|
||||
export interface DungeonRunRecord {
|
||||
readonly biteSizedSelection?: BiteSizedRunSelection;
|
||||
readonly id: string;
|
||||
readonly dungeonId: string;
|
||||
readonly difficultyId: string;
|
||||
@@ -74,7 +77,12 @@ export function normalizeDungeonRunProgress(value: unknown): DungeonRunProgress
|
||||
|| (input.durationMs !== null && (input.finishedAt === null || input.durationMs < 1))
|
||||
|| (input.finishedAt !== null && (input.durationMs === null || input.party.length === 0
|
||||
|| input.durationMs !== Math.max(1, Math.round(input.finishedAt - input.startedAt!))))) return null;
|
||||
let biteSizedSelection: BiteSizedRunSelection | undefined;
|
||||
try { if (input.biteSizedSelection !== undefined) biteSizedSelection = normalizeBiteSizedSelection(input.biteSizedSelection); }
|
||||
catch { return null; }
|
||||
if (biteSizedSelection && biteSizedSelection.dungeonId !== input.dungeonId) return null;
|
||||
return { id: input.id, dungeonId: input.dungeonId, difficultyId: input.difficultyId,
|
||||
...(biteSizedSelection ? { biteSizedSelection } : {}),
|
||||
...(input.bossDifficulty !== undefined ? { bossDifficulty: input.bossDifficulty } : {}),
|
||||
startedAt: input.startedAt, finishedAt: input.finishedAt, durationMs: input.durationMs,
|
||||
timed: input.timed, killedBossIds: [...new Set(input.killedBossIds)],
|
||||
|
||||
Reference in new issue
Block a user