Skip to content

Commit

Permalink
New match type: ddrSongHash (#1213)
Browse files Browse the repository at this point in the history
* New match type: `ddrSongHash`

* style: sort `MatchTypesWithDifficulty`

* make `ddrSongHash` a song property instead of a chart property

* docs: add descriptions for match type `ddrSongHash`

* add `ddrSongHash` field to all applicable songs

* fix: enforce ddrSongHash is only used on DDR

---------

Co-authored-by: zk <[email protected]>
  • Loading branch information
tranq88 and zkrising authored Dec 18, 2024
1 parent 36bf039 commit 2111782
Show file tree
Hide file tree
Showing 10 changed files with 1,332 additions and 3 deletions.
3 changes: 2 additions & 1 deletion common/src/config/game-support/ddr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export const DDR_CONF = {
inGameID: zodNonNegativeInt,
flareCategory: DDR_FLARE_CATEGORIES,
basename: z.string().optional(),
ddrSongHash: z.string().optional(), // optional because konaste-only songs have no hashes
}),
} as const satisfies INTERNAL_GAME_CONFIG;

Expand Down Expand Up @@ -206,7 +207,7 @@ export const DDR_SP_CONF = {
preferences: z.strictObject({}),
scoreMeta: z.strictObject({}),

supportedMatchTypes: ["inGameID", "songTitle", "tachiSongID"],
supportedMatchTypes: ["inGameID", "songTitle", "tachiSongID", "ddrSongHash"],
} as const satisfies INTERNAL_GAME_PT_CONFIG;

export const DDR_DP_CONF = {
Expand Down
3 changes: 2 additions & 1 deletion common/src/lib/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,8 @@ const PR_BATCH_MANUAL_SCORE = (game: Game, playtype: Playtype): PrudenceSchema =
"inGameID",
"inGameStrID",
"uscChartHash",
"popnChartHash"
"popnChartHash",
"ddrSongHash"
),
identifier: "string",
comment: optNull(p.isBoundedString(3, 240)),
Expand Down
1 change: 1 addition & 0 deletions common/src/types/batch-manual.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ type MatchTypesNoDifficulty = "bmsChartHash" | "itgChartHash" | "popnChartHash"

// These MatchTypes need `difficulty` set in the batch manual.
type MatchTypesWithDifficulty =
| "ddrSongHash"
| "inGameID"
| "inGameStrID"
| "sdvxInGameID"
Expand Down
5 changes: 5 additions & 0 deletions docs/docs/codebase/batch-manual/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@ means that it will check for any of `INF/GRV/HVN/VVD/XCD` for this song.

This is useful for services that store all of those as the same difficulty.

- ddrSongHash

This is a 32-character hash used by the official DDR e-amusement website to
identify a song; you must specify the difficulty for this chart as well.

## Example

A final example of a simple BATCH MANUAL format
Expand Down
4 changes: 4 additions & 0 deletions docs/docs/game-support/common-config/match-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ Uses `identifier` as a SHA1 hash, since that's what USC uses.

These match types need both `identifier` and a `difficulty` defined.

### `ddrSongHash`

Looks up on the 32-character song hash for this chart, where the hash is from the official DDR e-amusement website.

### `inGameID`

Looks up on the in game ID for this chart.
Expand Down
1 change: 1 addition & 0 deletions docs/docs/game-support/games/ddr-DP.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,4 @@ The folowing judgements are defined:
- `inGameID`
- `songTitle`
- `tachiSongID`
- `ddrSongHash`
1 change: 1 addition & 0 deletions docs/docs/game-support/games/ddr-SP.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,4 @@ The folowing judgements are defined:
- `inGameID`
- `songTitle`
- `tachiSongID`
- `ddrSongHash`
Loading

0 comments on commit 2111782

Please sign in to comment.