forked from phenom/healer-man
Release Healer Man 0.1.40
This commit is contained in:
1 parent
ed0d2fea3d
commit
197a64117c
215 files changed
+5131
-181
No files matched your search
@@ -12,6 +12,7 @@ import { arenaRatingBand, calculateArenaRating, clampArenaRating } from "./arena
|
||||
import { arenaRoleForSpecialization } from "./arena-specializations.mjs";
|
||||
import { createDungeonReportRepository } from "./dungeon-reports.mjs";
|
||||
import { createDungeonLeaderboardRepository } from "./dungeon-leaderboards.mjs";
|
||||
import dungeonLeaderboardCatalog from "../src/game/generated/dungeonLeaderboardCatalog.generated.json" with { type: "json" };
|
||||
|
||||
const scrypt = promisify(scryptCallback);
|
||||
|
||||
@@ -602,6 +603,15 @@ export function openGameDatabase(options = {}) {
|
||||
}
|
||||
const contentId = String(input?.contentId ?? "").trim().slice(0, 120);
|
||||
if (!contentId) throw new GameDatabaseError("Choose content before starting.", 400, "missing_content");
|
||||
if (type === "dungeon" && input?.bossDifficulty !== undefined
|
||||
&& (!Number.isInteger(input.bossDifficulty) || input.bossDifficulty < 1 || input.bossDifficulty > 10)) {
|
||||
throw new GameDatabaseError("Choose a boss difficulty from 1 to 10.", 400, "invalid_boss_difficulty");
|
||||
}
|
||||
if (type === "dungeon" && input?.difficultyId !== undefined
|
||||
&& !dungeonLeaderboardCatalog.dungeons.find((dungeon) => dungeon.id === contentId)
|
||||
?.difficulties.some((difficulty) => difficulty.id === input.difficultyId)) {
|
||||
throw new GameDatabaseError("Choose a supported dungeon difficulty.", 400, "invalid_dungeon_difficulty");
|
||||
}
|
||||
const members = database.prepare(`
|
||||
SELECT account_id, character_json, role FROM online_group_members WHERE group_id = ? ORDER BY joined_at
|
||||
`).all(group.id);
|
||||
@@ -615,6 +625,7 @@ export function openGameDatabase(options = {}) {
|
||||
id: `activity-${randomUUID()}`,
|
||||
type,
|
||||
contentId,
|
||||
...(type === "dungeon" ? { difficultyId: input?.difficultyId, bossDifficulty: input?.bossDifficulty ?? 1 } : {}),
|
||||
fillWithAi,
|
||||
partySize,
|
||||
startingLevel: type === "manastorm"
|
||||
|
||||
Reference in new issue
Block a user