Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] 一键登录功能目前游戏客户端都支持,是否考虑添加个一键登录功能开关 #1100

Open
2 tasks done
MilvusSky opened this issue Sep 22, 2024 · 1 comment
Labels
Area: Launcher enhancement New feature or request

Comments

@MilvusSky
Copy link

Checklist

  • I have already read docs/Tips.md, but my feature is not implemented.
  • My suggested feature was not mentioned by others, and it is not a duplicate feature.

Summary

目前国服的四个游戏实测均已支持启动参数一键登录。先获取AuthTicket,再将ticket作为启动参数来启动游戏即可自动登录。ticket目前不区分gamebiz,通用,使用一次后失效,失效时间未测试。
这样可以解决掉重启电脑掉登录问题。但无法解决风控导致game_token被重置引起的掉登录。

Solution or Design

1. 获取AuthTicket示例

POST:
https://passport-api.mihoyo.com/account/ma-cn-verifier/app/createAuthTicketByGameBiz
Header:
Connection: keep-alive
sec-ch-ua: "Chromium";v="102"
x-rpc-client_type: 3
sec-ch-ua-platform: "Windows"
x-rpc-game_biz: hyp_cn
sec-ch-ua-mobile: ?0
User-Agent: HYPContainer/1.2.2.159 (windows 11)
Accept: application/json, text/plain, /
Content-Type: application/json
x-rpc-hyp_web_source: bh3
x-rpc-app_id: ddxf5dufpuyo
Origin: https://hyp-api.mihoyo.com
Sec-Fetch-Site: same-site
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://hyp-api.mihoyo.com/
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
Body:
{
"game_biz": "bh3_cn",
"stoken": "v2_xxxxxxxxxxxxxxxxxx.CAE=",
"uid": xxxxxxxxxxxx,
"mid": "xxxxxxxxx_mhy"
}
Response:
{
"retcode": 0,
"message": "OK",
"data": {
"ticket": "gw1a6iiro8t5y1wepykt205fkkv6cuzk"
}
}

示例中head删去了部分device信息,但不影响使用,可直接使用。

2.启动CommandLine:

bh3.exe login_auth_ticket=gw1a6iiro8t5y1wepykt205fkkv6cuzk

启动后会自动登录对应账号,如果ticket无效则登录原本注册表中的账号

@MilvusSky MilvusSky added the triage Issue needs to be triaged label Sep 22, 2024
@Scighost
Copy link
Owner

谢谢你的建议,以后可能会实现这个功能

@Scighost Scighost added enhancement New feature or request Area: Launcher and removed triage Issue needs to be triaged labels Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Launcher enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants