Skip to content

Commit

Permalink
genshin: Migrate to new global API Endpoint (#991)
Browse files Browse the repository at this point in the history
* genshin: Migrate to new global API Endpoint

fix: #987

* hoyoverse: support new CSC FE
  • Loading branch information
hinaloe authored Jul 30, 2024
1 parent 11f9728 commit f5b07e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Starward.Core/Gacha/GachaLogClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public abstract class GachaLogClient
protected const string WEB_CACHE_PATH_YS_OS = @"GenshinImpact_Data\webCaches\Cache\Cache_Data\data_2";

protected const string API_PREFIX_YS_CN = "https://public-operation-hk4e.mihoyo.com/gacha_info/api/getGachaLog";
protected const string API_PREFIX_YS_OS = "https://hk4e-api-os.hoyoverse.com/gacha_info/api/getGachaLog";
protected const string API_PREFIX_YS_OS = "https://public-operation-hk4e-sg.hoyoverse.com/gacha_info/api/getGachaLog";

protected static ReadOnlySpan<byte> SPAN_WEB_PREFIX_YS_CN => "https://webstatic.mihoyo.com/hk4e/event/e20190909gacha-v3/index.html"u8;
protected static ReadOnlySpan<byte> SPAN_WEB_PREFIX_YS_OS => "https://gs.hoyoverse.com/genshin/event/e20190909gacha-v3/index.html"u8;
Expand Down
5 changes: 3 additions & 2 deletions src/Starward.Core/SelfQuery/SelfQueryClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@ public async Task<SelfQueryUserInfo> InitializeAsync(string url, GameBiz gameBiz
{
prefixUrl = "https://hk4e-api.mihoyo.com";
}
if (url.StartsWith("https://cs.hoyoverse.com/csc-service-center-fe/index.html"))
if (url.StartsWith("https://cs.hoyoverse.com/csc-service-center-fe/index.html")
|| url.StartsWith("https://cs.hoyoverse.com/static/hoyoverse-new-csc-service-hall-fe/index.html"))
{
prefixUrl = "https://hk4e-api-os.hoyoverse.com";
prefixUrl = "https://public-operation-hk4e-sg.hoyoverse.com";
}
if (string.IsNullOrWhiteSpace(prefixUrl))
{
Expand Down

0 comments on commit f5b07e6

Please sign in to comment.