diff options
| author | 2026-01-13 15:56:20 +0800 | |
|---|---|---|
| committer | 2026-01-13 15:56:20 +0800 | |
| commit | 66f7825ed9638606665b9e61c6f8132de013da14 (patch) | |
| tree | 764c30309a1c5a77f3b0d92d5131b1b50ae50402 /src-tauri/src/core/game_version.rs | |
| parent | 6fbb5f19cab02f3a0f18cdeda3da02e717b69cd6 (diff) | |
| download | DropOut-66f7825ed9638606665b9e61c6f8132de013da14.tar.gz DropOut-66f7825ed9638606665b9e61c6f8132de013da14.zip | |
feat: implement download functionality with progress monitoring and version management
Diffstat (limited to 'src-tauri/src/core/game_version.rs')
| -rw-r--r-- | src-tauri/src/core/game_version.rs | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/src-tauri/src/core/game_version.rs b/src-tauri/src/core/game_version.rs new file mode 100644 index 0000000..c33f99c --- /dev/null +++ b/src-tauri/src/core/game_version.rs @@ -0,0 +1,66 @@ +use serde::Deserialize; + +#[derive(Debug, Deserialize)] +pub struct GameVersion { + pub id: String, + pub downloads: Downloads, + #[serde(rename = "assetIndex")] + pub asset_index: AssetIndex, + pub libraries: Vec<Library>, + #[serde(rename = "mainClass")] + pub main_class: String, + #[serde(rename = "minecraftArguments")] + pub minecraft_arguments: Option<String>, + pub arguments: Option<Arguments>, + #[serde(rename = "javaVersion")] + pub java_version: Option<JavaVersion>, +} + +#[derive(Debug, Deserialize)] +pub struct Downloads { + pub client: DownloadArtifact, + pub server: Option<DownloadArtifact>, +} + +#[derive(Debug, Deserialize, Clone)] +pub struct DownloadArtifact { + pub sha1: String, + pub size: u64, + pub url: String, + pub path: Option<String>, +} + +#[derive(Debug, Deserialize)] +pub struct AssetIndex { + pub id: String, + pub sha1: String, + pub size: u64, + pub url: String, + #[serde(rename = "totalSize")] + pub total_size: u64, +} + +#[derive(Debug, Deserialize)] +pub struct Library { + pub downloads: Option<LibraryDownloads>, + pub name: String, +} + +#[derive(Debug, Deserialize)] +pub struct LibraryDownloads { + pub artifact: Option<DownloadArtifact>, + pub classifiers: Option<serde_json::Value>, // Complex, simplifying for now +} + +#[derive(Debug, Deserialize)] +pub struct Arguments { + pub game: Option<serde_json::Value>, + pub jvm: Option<serde_json::Value>, +} + +#[derive(Debug, Deserialize)] +pub struct JavaVersion { + pub component: String, + #[serde(rename = "majorVersion")] + pub major_version: u64, +} |