mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-12 17:28:31 +03:00
seeds.tachi.ac
This commit is contained in:
@@ -25,7 +25,7 @@ export function CreateScoreCalcData<TGame extends V3Game>(
|
||||
chart as any,
|
||||
) as MongoDerivedMetrics[TGame];
|
||||
|
||||
// Per-GPT `scoreCalcs` take game-specific score/derived types; at runtime inputs match `gptString`.
|
||||
// Per-GPT `scoreCalcs` take game-specific score/derived types; at runtime inputs match `game`.
|
||||
const scoreCalcs = impl.scoreCalcs as unknown as (
|
||||
scoreData: ScoreData<TGame>,
|
||||
derivedData: MongoDerivedMetrics[TGame],
|
||||
|
||||
@@ -59,7 +59,7 @@ export async function rederiveScoresForChart(chartId: string, log: KtLogger): Pr
|
||||
for (const row of rows) {
|
||||
const score = ToScoreDocument(row as ScoreDocumentJoinRow);
|
||||
|
||||
// GPT-specific union types aren't callable with the generic GPTString,
|
||||
// game-specific union types aren't callable with the generic game,
|
||||
// so we cast through `any` the same way CreateScoreCalcData does.
|
||||
const derivedData = (impl.scoreDeriver as any)(score.scoreData, chart);
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ import {
|
||||
type GoalDocument,
|
||||
type GoalSubscriptionDocument,
|
||||
type integer,
|
||||
LEGACY_GameToGPTString,
|
||||
type PBScoreDocument,
|
||||
type QuestDocument,
|
||||
type QuestSubscriptionDocument,
|
||||
@@ -72,13 +71,12 @@ export async function EvaluateGoalForUser(
|
||||
): Promise<EvaluatedGoalReturn | null> {
|
||||
const chartIDs = await ResolveGoalCharts(goal);
|
||||
const v3Game = goal.game;
|
||||
const gptString = LEGACY_GameToGPTString(v3Game);
|
||||
const gameConfig = GetGameConfig(v3Game);
|
||||
const scoreConf = GetScoreMetricConf(gameConfig, goal.criteria.key);
|
||||
|
||||
if (!scoreConf) {
|
||||
throw new Error(
|
||||
`Invalid goal.criteria.key, got '${goal.criteria.key}', but no config exists for this metric for ${gptString}.`,
|
||||
`Invalid goal.criteria.key, got '${goal.criteria.key}', but no config exists for this metric for ${v3Game}.`,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user