aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src-tauri/src/core/game_version.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src-tauri/src/core/game_version.rs')
-rw-r--r--src-tauri/src/core/game_version.rs66
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,
+}