From f878efe456e8f5c557f2cde9d71f120f3e0b38cd Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Tue, 13 Jan 2026 14:31:37 +0800 Subject: feat: add Minecraft DropOut launcher with version fetching and basic UI - Implemented version manifest fetching from Mojang API. - Created launcher configuration and main launcher logic. - Added SVG and PNG icons for the application. - Developed a simple HTML/CSS interface for the launcher. - Integrated Tauri commands for backend communication. - Added utility functions for file operations and config parsing. --- src-tauri/src/core/manifest.rs | 31 +++++++++++++++++++++++++++++++ src-tauri/src/core/mod.rs | 1 + 2 files changed, 32 insertions(+) create mode 100644 src-tauri/src/core/manifest.rs create mode 100644 src-tauri/src/core/mod.rs (limited to 'src-tauri/src/core') diff --git a/src-tauri/src/core/manifest.rs b/src-tauri/src/core/manifest.rs new file mode 100644 index 0000000..1450e77 --- /dev/null +++ b/src-tauri/src/core/manifest.rs @@ -0,0 +1,31 @@ +use serde::Deserialize; +use std::error::Error; + +#[derive(Debug, Deserialize)] +pub struct VersionManifest { + pub latest: Latest, + pub versions: Vec, +} + +#[derive(Debug, Deserialize)] +pub struct Latest { + pub release: String, + pub snapshot: String, +} + +#[derive(Debug, Deserialize)] +pub struct Version { + pub id: String, + #[serde(rename = "type")] + pub type_: String, + pub url: String, + pub time: String, + #[serde(rename = "releaseTime")] + pub release_time: String, +} + +pub async fn fetch_version_manifest() -> Result> { + let url = "https://piston-meta.mojang.com/mc/game/version_manifest_v2.json"; + let resp = reqwest::get(url).await?.json::().await?; + Ok(resp) +} diff --git a/src-tauri/src/core/mod.rs b/src-tauri/src/core/mod.rs new file mode 100644 index 0000000..640fc64 --- /dev/null +++ b/src-tauri/src/core/mod.rs @@ -0,0 +1 @@ +pub mod manifest; -- cgit v1.2.3-70-g09d2