feat(pp-calculator): support other pp calculators (#57)

New configurations:

- CALCULATOR="rosu": specific pp calculator
- CALCULATOR_CONFIG='{}': argument passed through into calculator
This commit is contained in:
MingxuanGame
2025-10-18 19:10:53 +08:00
committed by GitHub
parent 563a30d28f
commit 8790ccad64
16 changed files with 496 additions and 189 deletions

View File

@@ -103,6 +103,23 @@ STORAGE_SETTINGS='{
"s3_public_url_base": "https://your-custom-domain.com"
}'
```
""",
"表现计算设置": """配置表现分计算器及其参数。
### rosu-pp-py (默认)
```bash
CALCULATOR="rosu"
CALCULATOR_CONFIG='{}'
```
### [osu-performance-server](https://github.com/GooGuTeam/osu-performance-server)
```bash
CALCULATOR="performance_server"
CALCULATOR_CONFIG='{
"server_url": "http://localhost:5225"
}'
""",
}
},
@@ -486,6 +503,21 @@ STORAGE_SETTINGS='{
"游戏设置",
]
# 表现计算设置
calculator: Annotated[
Literal["rosu", "performance_server"],
Field(default="rosu", description="表现分计算器"),
"表现计算设置",
]
calculator_config: Annotated[
dict[str, Any],
Field(
default={},
description="表现分计算器配置 (JSON 格式),具体配置项请参考上方",
),
"表现计算设置",
]
# 谱面缓存设置
enable_beatmap_preload: Annotated[
bool,
@@ -612,7 +644,7 @@ STORAGE_SETTINGS='{
# 反作弊设置
suspicious_score_check: Annotated[
bool,
Field(default=True, description="启用可疑分数检查(star>25&acc<80 或 pp>3000"),
Field(default=True, description="启用可疑分数检查pp>3000"),
"反作弊设置",
]
banned_name: Annotated[