当前仅 upsert.py 可用:扫码登录 -> 上传一局成绩 -> 落库回查 -> 登出。 - api/ 下 40+ 个接口模块已实现,236 项零网络自检全绿 - 上传成绩链路已真机跑通,报文与真机抓包逐字节一致 - 开发文档见 docs 分支;source/ 与 logs/ 不入库
48 lines
1.4 KiB
Python
48 lines
1.4 KiB
Python
# -*- coding: utf-8 -*-
|
||
"""
|
||
user_ghost.py —— 取用户幽灵数据(GetUserGhostApi)
|
||
================================================================================
|
||
|
||
取玩家的「幽灵」对战记录(真机 15 条)。
|
||
|
||
对应接口:GetUserGhostApi
|
||
请求体 :UserIdRequestVO
|
||
响应 :{length, userGhostList:[...]}
|
||
依据 :source/Assembly-CSharp/Net.VO.Mai2/UserGhostRequestVO.cs
|
||
|
||
★ Upsert 侧 userGhost 默认留空:源码 VOExtensions.cs:235 是
|
||
dst.userGhost = (!src.MyGhost.NeedSave) ? null : new UserGhost[1] {...};
|
||
只有「本局产生了幽灵」才回传,纯网络脚本复刻不出幽灵数据。
|
||
|
||
调用示例:
|
||
from api import UserGhost
|
||
"""
|
||
|
||
from __future__ import annotations
|
||
|
||
from typing import Any, Dict, Optional
|
||
|
||
from config import CLIENT_ID, TIMEOUT_MS
|
||
|
||
from .log_setup import log_info
|
||
from .maimai_net import MaimaiNetClient
|
||
from .user_getter_common import _get, UserIdRequestVO
|
||
|
||
|
||
def UserGhost(
|
||
user_id: int,
|
||
*,
|
||
client_id: str = CLIENT_ID,
|
||
timeout_ms: Optional[int] = None,
|
||
client: Optional[MaimaiNetClient] = None,
|
||
) -> Dict[str, Any]:
|
||
"""
|
||
取用户幽灵数据(对应 GetUserGhostApi)。
|
||
|
||
返回:
|
||
原始响应 dict,含 userGhostList
|
||
"""
|
||
log_info("取用户幽灵数据:user_id=" + str(user_id))
|
||
return _get("GetUserGhostApi", UserIdRequestVO(userId=user_id), user_id,
|
||
client_id=client_id, timeout_ms=timeout_ms, client=client)
|