fix: backport all features from v2 that came in after merge

This commit is contained in:
zk
2026-05-17 12:53:26 +00:00
parent 426bb250d9
commit fe76dad32d
34 changed files with 602 additions and 5219 deletions
@@ -106,7 +106,7 @@ export async function GetBestJubilityOnSongs(
return Promise.all(rows.rows.map((row) => ToPbScoreDocument(row)));
}
const CURRENT_JUBEAT_HOT_VERSION: Versions["jubeat"] = "ave";
const CURRENT_JUBEAT_HOT_VERSION: Versions["jubeat"] = "beyond";
export async function GetPBsForJubility(userID: integer) {
const hotSongRows = await DB.selectFrom("song")
@@ -293,6 +293,8 @@ describe("ONGEKI_IMPL", () => {
c(19, "RAINBOW");
c(20, "RAINBOW_SHINY");
c(21, "RAINBOW_EX");
c(22, "RAINBOW_EX_TRUE");
c(23, "RAINBOW_EX_TRUE");
});
});
@@ -16,8 +16,13 @@ import {
import { GoalFmtScore, GoalOutOfFmtScore, GradeGoalFormatter } from "./_common";
const isUnranked = (chart: ChartDocument<"ongeki">) =>
(chart.data.inGameID >= 7000 && chart.data.inGameID < 8000) || chart.levelNum === 0.0;
const isUnranked = (chart: ChartDocument<"ongeki">) => {
const ig = chart.data.inGameID;
return (
(ig !== null && ig >= 7000 && ig < 8000) ||
chart.levelNum === 0.0
);
};
const starCount = (platinumScore: number, maxPlatinumScore: number) => {
const pct = Math.floor((platinumScore / maxPlatinumScore) * 100);
@@ -113,7 +118,9 @@ export const ONGEKI_IMPL: GameImplementation<"ongeki"> = {
return { colour: null };
}
if (rating >= 21) {
if (rating >= 22) {
return { colour: "RAINBOW_EX_TRUE" };
} else if (rating >= 21) {
return { colour: "RAINBOW_EX" };
} else if (rating >= 20) {
return { colour: "RAINBOW_SHINY" };
@@ -230,9 +237,11 @@ export const ONGEKI_IMPL: GameImplementation<"ongeki"> = {
}
}
if (s.scoreData.bellLamp === "FULL BELL" && s.scoreData.noteLamp === "LOSS") {
return "Cannot have a LOSS with a FULL BELL.";
}
// LMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAO
// if (s.scoreData.bellLamp === "FULL BELL" && s.scoreData.noteLamp === "LOSS") {
// return "Cannot have a LOSS with a FULL BELL.";
// }
// LMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAO
if (s.scoreData.platinumScore > chart.data.maxPlatScore) {
return `Cannot have ${s.scoreData.platinumScore}/${chart.data.maxPlatScore} Platinum Score.`;
@@ -240,6 +240,47 @@ EnableGraphs = true
#
# If present, an * matches everyone else`,
},
{
clientID: "CXRizu",
requestedPermissions: ["submit_score"],
name: "Rizu",
redirectUri: null,
webhookUri: null,
apiKeyFilename: "Rizu.cfg",
apiKeyTemplate: `[General]
## Whether to enable score submissions
# Setting type: Boolean
# Default value: true
Enable = true
## Timeout for score submission in seconds
# Setting type: Int32
# Default value: 30
NetworkTimeout = 30
## Folder for storing imports that failed due to network errors.
## Leave empty to disable
# Setting type: String
# Default value: UserData/Rizu/FailedImports
FailedImportsFolder = UserData/Rizu/FailedImports
[Keys]
## Kamaitachi API keys to use for score submissions, in the format
## of \`<access-code> = <api-key>\`. The \`default\` key is used as fallback
## if an access code does not have an API key set, and can be removed.
# Setting type: String
# Default value:
default = %%TACHI_KEY%%
[Tachi]
## Tachi instance base URL
# Setting type: String
# Default value: https://kamai.tachi.ac
BaseUrl = ${ServerConfig.OUR_URL}`,
},
];
const BokuDefaultClients: DefaultClients = [
@@ -119,6 +119,8 @@ function ConvertVersion(ver: number): Versions["jubeat"] {
return "festo";
case 11:
return "ave";
case 12:
return "beyond";
}
throw new InvalidScoreFailure(`Unknown Game Version ${ver}.`);
@@ -9,6 +9,7 @@ import {
type SEEDS_QuestlineDocument,
type SEEDS_SongDocument,
type SEEDS_TableDocument,
type V3Game,
} from "tachi-common";
/* eslint-disable no-await-in-loop */
import type {
@@ -719,8 +719,9 @@ export const CHUNITHMBBKKSong: SongDocument<"chunithm"> = {
altTitles: [],
artist: "nora2r",
data: {
duration: 128.541,
genre: "VARIETY",
duration: 128.541,
displayVersion: "CHUNITHM",
},
id: "S19d35e0b935765ded25",
searchTerms: [],
@@ -736,7 +737,6 @@ export const CHUNITHMBBKKChart: ChartDocument<"chunithm"> = {
level: "3",
data: {
inGameID: 3,
displayVersion: "CHUNITHM",
},
isPrimary: true,
versions: ["paradiselost"],
@@ -1485,6 +1485,7 @@ export const TestingOngekiChart: ChartDocument<"ongeki"> = {
displayVersion: "オンゲキ bright MEMORY Act.3",
inGameID: 2137,
maxPlatScore: 1000,
isBonusTrack: false,
},
difficulty: "MASTER",
isPrimary: true,
@@ -1537,6 +1538,7 @@ export const TestingOngekiChartConverter: ChartDocument<"ongeki"> = {
displayVersion: "オンゲキ bright",
inGameID: 678,
maxPlatScore: 2768,
isBonusTrack: false,
},
difficulty: "MASTER",
isPrimary: true,
@@ -1552,6 +1554,7 @@ export const TestingChunithmSongConverter: SongDocument<"chunithm"> = {
data: {
genre: "POPS & ANIME",
duration: 120,
displayVersion: "CHUNITHM CRYSTAL PLUS",
},
id: "s956",
searchTerms: [],
@@ -1562,7 +1565,6 @@ export const TestingChunithmChartConverter: ChartDocument<"chunithm"> = {
game: "chunithm",
chartID: "fbba26a6a223b1dd0bf8ef139cfee83114b91086",
data: {
displayVersion: "CHUNITHM CRYSTAL PLUS",
inGameID: 956,
},
difficulty: "MASTER",
@@ -1579,6 +1581,7 @@ export const TestingChunithmWESongConverter: SongDocument<"chunithm"> = {
data: {
duration: 135.275,
genre: "VARIETY",
displayVersion: "CHUNITHM NEW PLUS",
},
id: "S19d35e0c127c7e441ce",
searchTerms: ["xl techno more dance"],
@@ -1588,7 +1591,6 @@ export const TestingChunithmWESongConverter: SongDocument<"chunithm"> = {
export const TestingChunithmWEChartConverter: ChartDocument<"chunithm"> = {
game: "chunithm",
data: {
displayVersion: "CHUNITHM NEW PLUS",
inGameID: 8235,
},
difficulty: "割☆4",