Skip to content
This repository has been archived by the owner on Dec 28, 2024. It is now read-only.

EnkaAPI // Add MiHoMoAPI mirror server support. #172

Merged
merged 9 commits into from
Apr 22, 2024
Merged

Conversation

ShikiSuen
Copy link
Collaborator

@ShikiSuen ShikiSuen commented Apr 21, 2024

EnkaAPI 会借由自己的境外伺服器自己计算武器与圣遗物面板参数。
国服资料到了这个海外伺服器之后计算完毕再传回国内,要走两遍国际网关。
这使得 EnkaAPI 在查询国服资料的时候出现了大量的时间延迟,已经明显影响到了面板的使用体验。

万幸的是,EnkaAPI 的查询结果的 JSON 结构是「MiHoMoAPI 的 ORIGIN 查询结果 JSON 结构」的超集。
这样一来,使用 MiHoMoAPI 作为分流查询服务器(专门用来查询国服 UID 的面板)就显得有必要了。
这个 PR 完成了对 MiHoMoAPI 的查询支持。

因为这样一来势必要在用户设备上单独计算武器与圣遗物面板的具体参数,
所以这个 PR 也完善了仅利用 EnkaDB 就地计算武器与圣遗物面板参数的方法。
特此感谢 Enka Networks 私下提供的算法技术支持。


EnkaAPI server is situated outside of Mainland China, calculating Weapon and Artifact parameters.

For all HSR game accounts hosted in Celestia and Irminsul servers, these account's Enka Showcase data runs through the cross-border internet gate twice, resulting in significant time delays.

Fortunately, EnkaAPI Query Result JSON structure is a superset of the one used in the MiHoMo Origin Query Result. However, this results in the needs of calculating Weapon and Artifact parameters on users' device instead.

This PR allows the HBEnkaAPI Swift Package to treat MiHoMo as a mirror server, plus offline calculation of Weapon and Artifact parameters on the users' devices instead. Special thanks to Enka Networks for their help regarding the calculation methods.

@ShikiSuen ShikiSuen requested a review from CanglongCl April 21, 2024 18:17
@ShikiSuen ShikiSuen force-pushed the shiki/MiHoMoSupport branch from e2fd8f5 to 3bb4c2f Compare April 21, 2024 18:32
@ShikiSuen ShikiSuen force-pushed the shiki/MiHoMoSupport branch from 3bb4c2f to 6f2dc5d Compare April 22, 2024 00:59
@ShikiSuen ShikiSuen merged commit 5a7fe58 into dev Apr 22, 2024
2 checks passed
@ShikiSuen ShikiSuen deleted the shiki/MiHoMoSupport branch April 22, 2024 01:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants