From 791bd84d175d8d454d8a7846dea63d57653ed7e1 Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Wed, 14 Jan 2026 13:35:29 +0800 Subject: feat: add download_threads to LauncherConfig and update download logging --- src-tauri/src/core/config.rs | 2 ++ src-tauri/src/main.rs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src-tauri') diff --git a/src-tauri/src/core/config.rs b/src-tauri/src/core/config.rs index 47c5306..dc72dcb 100644 --- a/src-tauri/src/core/config.rs +++ b/src-tauri/src/core/config.rs @@ -11,6 +11,7 @@ pub struct LauncherConfig { pub java_path: String, pub width: u32, pub height: u32, + pub download_threads: u32, // concurrent download threads } impl Default for LauncherConfig { @@ -21,6 +22,7 @@ impl Default for LauncherConfig { java_path: "java".to_string(), width: 854, height: 480, + download_threads: 32, } } } diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index d7ae9a4..73310d5 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -262,8 +262,8 @@ async fn start_game( )); // 4. Start Download - emit_log!(window, "Starting downloads...".to_string()); - core::downloader::download_files(window.clone(), download_tasks) + emit_log!(window, format!("Starting downloads with {} concurrent threads...", config.download_threads)); + core::downloader::download_files(window.clone(), download_tasks, config.download_threads as usize) .await .map_err(|e| e.to_string())?; emit_log!(window, "All downloads completed successfully".to_string()); -- cgit v1.2.3-70-g09d2