-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
517 additions
and
544 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,124 +1,236 @@ | ||
using System.Text.Json.Serialization; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Starward.Core.Launcher; | ||
|
||
|
||
public class LauncherGameResource | ||
{ | ||
[JsonPropertyName("game_packages")] | ||
public List<GamePackagesWrapper> Resources { get; set; } | ||
} | ||
[JsonPropertyName("game")] | ||
public GameResource Game { get; set; } | ||
|
||
public class GamePackagesWrapper | ||
{ | ||
[JsonPropertyName("main")] | ||
public GameBranch Main { get; set; } | ||
[JsonPropertyName("plugin")] | ||
public Plugin Plugin { get; set; } | ||
|
||
[JsonPropertyName("pre_download")] | ||
public GameBranch PreDownload { get; set; } | ||
} | ||
[JsonPropertyName("web_url")] | ||
public string WebUrl { get; set; } | ||
|
||
public class GameBranch | ||
{ | ||
[JsonPropertyName("major")] | ||
public GamePackages Major { get; set; } | ||
[JsonPropertyName("force_update")] | ||
public object ForceUpdate { get; set; } | ||
|
||
[JsonPropertyName("pre_download_game")] | ||
public GameResource PreDownloadGame { get; set; } | ||
|
||
[JsonPropertyName("deprecated_packages")] | ||
public List<DeprecatedPackage> DeprecatedPackages { get; set; } | ||
|
||
[JsonPropertyName("sdk")] | ||
public GameSDK Sdk { get; set; } | ||
|
||
[JsonPropertyName("patches")] | ||
public List<GamePackages> Patches { get; set; } | ||
[JsonPropertyName("deprecated_files")] | ||
public List<DeprecatedFile> DeprecatedFiles { get; set; } | ||
} | ||
|
||
public class GamePackages | ||
public class GameSDK | ||
{ | ||
[JsonPropertyName("version")] | ||
public string Version { get; set; } | ||
|
||
[JsonPropertyName("game_pkgs")] | ||
public List<GamePkg> GamePkgs { get; set; } | ||
[JsonPropertyName("path")] | ||
public string Path { get; set; } | ||
|
||
[JsonPropertyName("audio_pkgs")] | ||
public List<AudioPkg> AudioPkgs { get; set; } | ||
[JsonPropertyName("size")] | ||
[JsonNumberHandling(JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString)] | ||
public long Size { get; set; } | ||
|
||
[JsonPropertyName("res_list_url")] | ||
public string ResListUrl { get; set; } | ||
[JsonPropertyName("md5")] | ||
public string Md5 { get; set; } | ||
|
||
[JsonPropertyName("pkg_version")] | ||
public string PkgVersion { get; set; } | ||
|
||
[JsonPropertyName("desc")] | ||
public string Desc { get; set; } | ||
|
||
[JsonPropertyName("channel_id")] | ||
public string ChannelId { get; set; } | ||
|
||
[JsonPropertyName("sub_channel_id")] | ||
public string SubChannelId { get; set; } | ||
|
||
[JsonPropertyName("package_size")] | ||
[JsonNumberHandling(JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString)] | ||
public long PackageSize { get; set; } | ||
} | ||
|
||
public class GamePkg : IGamePackage | ||
|
||
public class DeprecatedFile | ||
{ | ||
[JsonPropertyName("url")] | ||
public string Url { get; set; } | ||
[JsonPropertyName("name")] | ||
public string Name { get; set; } | ||
|
||
[JsonPropertyName("md5")] | ||
public string Md5 { get; set; } | ||
} | ||
|
||
public class DeprecatedPackage | ||
{ | ||
[JsonPropertyName("name")] | ||
public string Name { get; set; } | ||
|
||
[JsonPropertyName("md5")] | ||
public string Md5 { get; set; } | ||
} | ||
|
||
public class DiffPackage : IGamePackage | ||
{ | ||
[JsonPropertyName("name")] | ||
public string Name { get; set; } | ||
|
||
[JsonPropertyName("version")] | ||
public string Version { get; set; } | ||
|
||
[JsonPropertyName("path")] | ||
public string Path { get; set; } | ||
|
||
[JsonPropertyName("size")] | ||
[JsonNumberHandling(JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString)] | ||
public long Size { get; set; } | ||
|
||
[JsonPropertyName("decompressed_size")] | ||
[JsonPropertyName("md5")] | ||
public string Md5 { get; set; } | ||
|
||
[JsonPropertyName("is_recommended_update")] | ||
public bool IsRecommendedUpdate { get; set; } | ||
|
||
[JsonPropertyName("voice_packs")] | ||
public List<VoicePack> VoicePacks { get; set; } | ||
|
||
[JsonPropertyName("package_size")] | ||
[JsonNumberHandling(JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString)] | ||
public long DecompressedSize { get; set; } | ||
public long PackageSize { get; set; } | ||
} | ||
|
||
public class AudioPkg : IGamePackage | ||
public class GameResource | ||
{ | ||
[JsonPropertyName("language")] | ||
public string Language { get; set; } | ||
[JsonPropertyName("latest")] | ||
public LatestVersion Latest { get; set; } | ||
|
||
[JsonPropertyName("url")] | ||
public string Url { get; set; } | ||
[JsonPropertyName("diffs")] | ||
public List<DiffPackage> Diffs { get; set; } | ||
} | ||
|
||
[JsonPropertyName("md5")] | ||
public string Md5 { get; set; } | ||
public class LatestVersion : IGamePackage | ||
{ | ||
[JsonPropertyName("name")] | ||
public string Name { get; set; } | ||
|
||
[JsonPropertyName("version")] | ||
public string Version { get; set; } | ||
|
||
[JsonPropertyName("path")] | ||
public string Path { get; set; } | ||
|
||
[JsonPropertyName("size")] | ||
[JsonNumberHandling(JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString)] | ||
public long Size { get; set; } | ||
|
||
[JsonPropertyName("decompressed_size")] | ||
[JsonPropertyName("md5")] | ||
public string Md5 { get; set; } | ||
|
||
[JsonPropertyName("entry")] | ||
public string Entry { get; set; } | ||
|
||
[JsonPropertyName("voice_packs")] | ||
public List<VoicePack> VoicePacks { get; set; } | ||
|
||
[JsonPropertyName("decompressed_path")] | ||
public string DecompressedPath { get; set; } | ||
|
||
[JsonPropertyName("segments")] | ||
public List<Segment> Segments { get; set; } | ||
|
||
[JsonPropertyName("package_size")] | ||
[JsonNumberHandling(JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString)] | ||
public long DecompressedSize { get; set; } | ||
public long PackageSize { get; set; } | ||
} | ||
|
||
public class LauncherGameSdk | ||
public class Plugin | ||
{ | ||
[JsonPropertyName("game_channel_sdks")] | ||
public List<GameSDK> Sdk { get; set; } | ||
[JsonPropertyName("plugins")] | ||
public List<PluginItem> Plugins { get; set; } | ||
|
||
[JsonPropertyName("version")] | ||
public string Version { get; set; } | ||
} | ||
|
||
public class GameSDK | ||
public class PluginItem | ||
{ | ||
[JsonPropertyName("name")] | ||
public string Name { get; set; } | ||
|
||
[JsonPropertyName("version")] | ||
public string Version { get; set; } | ||
|
||
[JsonPropertyName("channel_sdk_pkg")] | ||
public GamePkg Pkg { get; set; } | ||
} | ||
[JsonPropertyName("path")] | ||
public string Path { get; set; } | ||
|
||
public class LauncherGameDeprecatedFiles | ||
{ | ||
[JsonPropertyName("deprecated_file_configs")] | ||
public List<GameDeprecatedFilesWrapper> Resources { get; set; } | ||
[JsonPropertyName("size")] | ||
[JsonNumberHandling(JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString)] | ||
public long Size { get; set; } | ||
|
||
[JsonPropertyName("md5")] | ||
public string Md5 { get; set; } | ||
|
||
[JsonPropertyName("entry")] | ||
public string Entry { get; set; } | ||
} | ||
|
||
public class GameDeprecatedFilesWrapper | ||
|
||
public class Segment | ||
{ | ||
[JsonPropertyName("deprecated_files")] | ||
public List<DeprecatedFile> DeprecatedFiles { get; set; } | ||
[JsonPropertyName("path")] | ||
public string Path { get; set; } | ||
|
||
[JsonPropertyName("md5")] | ||
public string Md5 { get; set; } | ||
|
||
[JsonPropertyName("package_size")] | ||
[JsonNumberHandling(JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString)] | ||
public long PackageSize { get; set; } | ||
} | ||
|
||
public class DeprecatedFile | ||
public class VoicePack : IGamePackage | ||
{ | ||
[JsonPropertyName("language")] | ||
public string Language { get; set; } | ||
|
||
[JsonPropertyName("name")] | ||
public string Name { get; set; } | ||
|
||
[JsonPropertyName("path")] | ||
public string Path { get; set; } | ||
|
||
[JsonPropertyName("size")] | ||
[JsonNumberHandling(JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString)] | ||
public long Size { get; set; } | ||
|
||
[JsonPropertyName("md5")] | ||
public string Md5 { get; set; } | ||
|
||
[JsonPropertyName("package_size")] | ||
[JsonNumberHandling(JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString)] | ||
public long PackageSize { get; set; } | ||
} | ||
|
||
|
||
|
||
public interface IGamePackage | ||
{ | ||
|
||
public string Url { get; set; } | ||
public string Path { get; set; } | ||
|
||
public long Size { get; set; } | ||
|
||
public long DecompressedSize { get; set; } | ||
public long PackageSize { get; set; } | ||
|
||
} |
Oops, something went wrong.