Skip to content

Commit

Permalink
sophon build manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
Scighost committed Jan 19, 2025
1 parent 2a0dca6 commit dad5509
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Starward.Core.HoYoPlay;


public class GameChunkBuild
public class GameSophonChunkBuild
{

[JsonPropertyName("build_id")]
Expand All @@ -21,7 +21,7 @@ public class GameChunkBuild
/// 文件清单
/// </summary>
[JsonPropertyName("manifests")]
public List<GameChunkManifest> Manifests { get; set; }
public List<GameSophonChunkManifest> Manifests { get; set; }


}
Expand All @@ -30,7 +30,7 @@ public class GameChunkBuild
/// <summary>
/// Chunk 下载模式文件清单
/// </summary>
public class GameChunkManifest
public class GameSophonChunkManifest
{
/// <summary>
/// 资源ID
Expand All @@ -54,41 +54,41 @@ public class GameChunkManifest
/// 清单文件信息
/// </summary>
[JsonPropertyName("manifest")]
public GameChunkManifestFile Manifest { get; set; }
public GameSophonManifestFile Manifest { get; set; }


/// <summary>
/// 分块文件下载链接前缀
/// </summary>
[JsonPropertyName("chunk_download")]
public GameChunkManifestUrl ChunkDownload { get; set; }
public GameSophonManifestUrl ChunkDownload { get; set; }


/// <summary>
/// 清单文件下载链接前缀
/// </summary>
[JsonPropertyName("manifest_download")]
public GameChunkManifestUrl ManifestDownload { get; set; }
public GameSophonManifestUrl ManifestDownload { get; set; }


/// <summary>
/// 文件统计信息
/// </summary>
[JsonPropertyName("stats")]
public GameChunkManifestStats Stats { get; set; }
public GameSophonManifestStats Stats { get; set; }


/// <summary>
/// 去重后的文件统计信息
/// </summary>
[JsonPropertyName("deduplicated_stats")]
public GameChunkManifestStats DeduplicatedStats { get; set; }
public GameSophonManifestStats DeduplicatedStats { get; set; }

}



public class GameChunkManifestFile
public class GameSophonManifestFile
{
/// <summary>
/// 文件名,与下载链接前缀拼接为下载链接
Expand Down Expand Up @@ -119,7 +119,7 @@ public class GameChunkManifestFile
/// <summary>
/// 文件下载链接前缀
/// </summary>
public class GameChunkManifestUrl
public class GameSophonManifestUrl
{
/// <summary>
/// 加密
Expand Down Expand Up @@ -156,7 +156,7 @@ public class GameChunkManifestUrl



public class GameChunkManifestStats
public class GameSophonManifestStats
{

[JsonPropertyName("compressed_size")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Starward.Core.HoYoPlay;


public class GamePatchBuild
public class GameSophonPatchBuild
{

[JsonPropertyName("build_id")]
Expand All @@ -25,7 +25,7 @@ public class GamePatchBuild
/// 文件清单
/// </summary>
[JsonPropertyName("manifests")]
public List<GamePatchManifest> Manifests { get; set; }
public List<GameSophonPatchManifest> Manifests { get; set; }


}
Expand All @@ -34,7 +34,7 @@ public class GamePatchBuild
/// <summary>
/// Chunk 下载模式补丁文件清单
/// </summary>
public class GamePatchManifest
public class GameSophonPatchManifest
{
/// <summary>
/// 资源ID
Expand All @@ -58,28 +58,28 @@ public class GamePatchManifest
/// 清单文件信息
/// </summary>
[JsonPropertyName("manifest")]
public GameChunkManifestFile Manifest { get; set; }
public GameSophonManifestFile Manifest { get; set; }


/// <summary>
/// 分块文件下载链接前缀
/// </summary>
[JsonPropertyName("diff_download")]
public GameChunkManifestUrl DiffDownload { get; set; }
public GameSophonManifestUrl DiffDownload { get; set; }


/// <summary>
/// 清单文件下载链接前缀
/// </summary>
[JsonPropertyName("manifest_download")]
public GameChunkManifestUrl ManifestDownload { get; set; }
public GameSophonManifestUrl ManifestDownload { get; set; }


/// <summary>
/// 文件统计信息
/// </summary>
[JsonPropertyName("stats")]
public Dictionary<string, GameChunkManifestStats> Stats { get; set; }
public Dictionary<string, GameSophonManifestStats> Stats { get; set; }


}
12 changes: 6 additions & 6 deletions src/Starward.Core/HoYoPlay/HoYoPlayClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ public async Task<List<GameBranch>> GetGameBranchAsync(string launcherId, string
/// <param name="cancellationToken"></param>
/// <returns></returns>
/// <exception cref="ArgumentOutOfRangeException"></exception>
public async Task<GameChunkBuild> GetGameChunkBuildAsync(GameBranch gameBranch, GameBranchPackage gameBranchPackage, CancellationToken cancellationToken = default)
public async Task<GameSophonChunkBuild> GetGameChunkBuildAsync(GameBranch gameBranch, GameBranchPackage gameBranchPackage, CancellationToken cancellationToken = default)
{
string? url = null;
if (gameBranch.GameId.GameBiz.IsChinaServer())
Expand All @@ -497,7 +497,7 @@ public async Task<GameChunkBuild> GetGameChunkBuildAsync(GameBranch gameBranch,
throw new ArgumentOutOfRangeException(nameof(gameBranch), $"Unknown game biz ({gameBranch.GameId.GameBiz}).");
}
url += $"branch={gameBranchPackage.Branch}&package_id={gameBranchPackage.PackageId}&password={gameBranchPackage.Password}";
return await CommonGetAsync<GameChunkBuild>(url, cancellationToken);
return await CommonGetAsync<GameSophonChunkBuild>(url, cancellationToken);
}


Expand All @@ -512,7 +512,7 @@ public async Task<GameChunkBuild> GetGameChunkBuildAsync(GameBranch gameBranch,
/// <param name="cancellationToken"></param>
/// <returns></returns>
/// <exception cref="ArgumentOutOfRangeException"></exception>
public async Task<GameChunkBuild> GetGameChunkBuildAsync(GameBranch gameBranch, GameBranchPackage gameBranchPackage, string version, CancellationToken cancellationToken = default)
public async Task<GameSophonChunkBuild> GetGameSophonChunkBuildAsync(GameBranch gameBranch, GameBranchPackage gameBranchPackage, string version, CancellationToken cancellationToken = default)
{
string? url = null;
if (gameBranch.GameId.GameBiz.IsChinaServer())
Expand All @@ -528,7 +528,7 @@ public async Task<GameChunkBuild> GetGameChunkBuildAsync(GameBranch gameBranch,
throw new ArgumentOutOfRangeException(nameof(gameBranch), $"Unknown game biz ({gameBranch.GameId.GameBiz}).");
}
url += $"branch={gameBranchPackage.Branch}&package_id={gameBranchPackage.PackageId}&password={gameBranchPackage.Password}&tag={version}";
return await CommonGetAsync<GameChunkBuild>(url, cancellationToken);
return await CommonGetAsync<GameSophonChunkBuild>(url, cancellationToken);
}


Expand All @@ -542,7 +542,7 @@ public async Task<GameChunkBuild> GetGameChunkBuildAsync(GameBranch gameBranch,
/// <param name="cancellationToken"></param>
/// <returns></returns>
/// <exception cref="ArgumentOutOfRangeException"></exception>
public async Task<GamePatchBuild> GetGameChunkPatchBuildAsync(GameBranch gameBranch, GameBranchPackage gameBranchPackage, CancellationToken cancellationToken = default)
public async Task<GameSophonPatchBuild> GetGameSophonPatchBuildAsync(GameBranch gameBranch, GameBranchPackage gameBranchPackage, CancellationToken cancellationToken = default)
{
string? url = null;
if (gameBranch.GameId.GameBiz.IsChinaServer())
Expand All @@ -559,7 +559,7 @@ public async Task<GamePatchBuild> GetGameChunkPatchBuildAsync(GameBranch gameBra
}
url += $"branch={gameBranchPackage.Branch}&package_id={gameBranchPackage.PackageId}&password={gameBranchPackage.Password}";
var request = new HttpRequestMessage(HttpMethod.Post, url);
return await CommonSendAsync<GamePatchBuild>(request, cancellationToken);
return await CommonSendAsync<GameSophonPatchBuild>(request, cancellationToken);
}


Expand Down
4 changes: 2 additions & 2 deletions src/Starward.Core/HoYoPlay/HoYoPlayJsonContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ namespace Starward.Core.HoYoPlay;
[JsonSerializable(typeof(List<GameDeprecatedFileConfig>))]
[JsonSerializable(typeof(List<GameConfig>))]
[JsonSerializable(typeof(List<GameBranch>))]
[JsonSerializable(typeof(miHoYoApiWrapper<GameChunkBuild>))]
[JsonSerializable(typeof(miHoYoApiWrapper<GamePatchBuild>))]
[JsonSerializable(typeof(miHoYoApiWrapper<GameSophonChunkBuild>))]
[JsonSerializable(typeof(miHoYoApiWrapper<GameSophonPatchBuild>))]

internal partial class HoYoPlayJsonContext : JsonSerializerContext
{
Expand Down

0 comments on commit dad5509

Please sign in to comment.