feat(mods): add battle.onFilterMissions hook and per-template bundled seeding

This commit is contained in:
N0VAN0M4LY committed 2026-12-03 02:40:38 +08:00
1 parent 8636d0b71d
commit 5983e3f3e2
6 files changed
+127 -20

No files matched your search

+21
View File
@@ -73,6 +73,25 @@ export interface BattleMatchmakeContext {
readonly request: Record<string, unknown>;
}
export interface BattleMissionCandidate {
readonly name: string;
readonly path: string;
readonly level?: string;
readonly type?: string;
readonly locName?: string;
readonly postfix?: string;
}
export interface BattleFilterMissionsContext {
readonly userId: string;
readonly modeId: number;
readonly modeName: string;
readonly economicName: string;
readonly minMrank: number;
readonly maxMrank: number;
readonly missions: readonly BattleMissionCandidate[];
}
export interface BattleLiveFactContext {
readonly userId: string;
readonly roomId: string;
@@ -146,6 +165,8 @@ export interface ServerModHooksApi {
};
readonly battle: {
onBeforeMatchmake(handler: (ctx: BattleMatchmakeContext) => void): void;
/** Filter or reorder candidate missions before matchmaking picks one; return the desired subset. */
onFilterMissions(handler: (ctx: BattleFilterMissionsContext) => readonly BattleMissionCandidate[] | void): void;
onLiveFact(handler: (ctx: BattleLiveFactContext) => void): void;
onAfterSettle(handler: (ctx: BattleSettlementContext) => void): void;
};