aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src-tauri/src
Commit message (Collapse)AuthorAgeFilesLines
* Potential fix for code scanning alert no. 3: Cleartext logging of sensitive ↵简律纯2026-01-191-1/+1
| | | | | information Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* chore(release): bump versionsgithub-actions[bot]2026-01-191-1/+1
|
* feat(backend): enhance instance management for editor supportHsiangNianian2026-01-182-6/+135
| | | | | | | - Sync instance.version_id after start_game, install_fabric, install_forge - Add jvm_args_override and memory_override to Instance struct - Add file management commands: list_instance_directory, delete_instance_file, open_file_explorer - Support per-instance settings overrides (Java args, memory)
* feat(migration): implement shared cache migration with SHA1 dedupHsiangNianian2026-01-182-1/+275
| | | | | | | | - Add migrate_to_shared_caches() with hard link preference - SHA1-based deduplication across all instances - Copy fallback for cross-filesystem scenarios - Auto-enable use_shared_caches after successful migration - UI shows statistics: moved files, hardlinks/copies, MB saved
* fix(ci): improve pre-commit fmt hook configurationHsiangNianian2026-01-184-90/+262
| | | | | | - Add pass_filenames: false to fmt hook - Add -- separator for cargo fmt args - Manually format code with cargo fmt
* fix: complete Instance/Profile System isolation and state managementHsiangNianian2026-01-181-7/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ## Overview Fixed critical multi-instance isolation bugs where versions, mod loaders, and instance state were not properly isolated between instances. These changes ensure full data isolation and consistent instance metadata. ## Bug Fixes - P0 (Critical Isolation Issues) ### 1. Backend: get_versions() command isolation - Problem: Used global app_data_dir instead of instance-specific game_dir - Fix: Added instance_id parameter, now queries instance.game_dir - Impact: Versions are now properly isolated per instance ### 2. Frontend: delete_version missing instanceId - Problem: Frontend passed only versionId, not instanceId - Fix: Updated VersionsView.svelte to pass instanceId parameter - Impact: Version deletion now targets correct instance ### 3. Frontend: get_version_metadata missing instanceId - Problem: Metadata queries didn't specify which instance to check - Fix: Updated VersionsView.svelte to pass instanceId parameter - Impact: Version info displayed per-instance correctly ### 4. Frontend: Instance switching doesn't refresh versions - Problem: Switching instances didn't reload version list - Fix: Added $effect hook in GameState to watch activeInstanceId changes - Impact: Version list auto-refreshes on instance switch ## Bug Fixes - P1 (State Synchronization) ### 5. Backend: install_fabric doesn't update Instance.mod_loader - Problem: Instance.mod_loader field wasn't updated after installation - Fix: Added instance_state.update_instance() call - Impact: Instance metadata stays in sync ### 6. Backend: install_forge doesn't update Instance.mod_loader - Problem: Instance.mod_loader field wasn't updated after installation - Fix: Added instance_state.update_instance() call - Impact: Instance metadata stays in sync ### 7. Backend: delete_version doesn't clean up Instance state - Problem: Deleting version didn't clear Instance.version_id or .mod_loader - Fix: Added cleanup logic to clear stale references - Impact: Instance state remains valid after deletion ## Testing - Added comprehensive integration tests in instance_isolation_tests.rs - Tests document 10 key scenarios for multi-instance isolation - All code compiles cleanly with no errors
* fix(java): handle build metadata and underscore formats in version parsingHsiangNianian2026-01-181-2/+21
| | | | | | | | | | | | Update parse_java_version() to properly handle: - Build metadata (strip '+' and everything after) - Trailing garbage (strip '-' and everything after, e.g. -Ubuntu) - Underscore version separators (1.8.0_411 -> 1.8.0.411) This ensures Java versions are correctly parsed on all platforms: - Old format: 1.8.0_411 (Java 8 update 411) - New format: 21.0.3+13-Ubuntu (Java 21 with build metadata) - Short format: 17.0.1 (Java 17 update 1).
* fix(manifest): add find_root_version for nested inheritance resolutionHsiangNianian2026-01-181-0/+37
| | | | | | | | | | | | Add find_root_version() function to walk the inheritance chain and find the root vanilla Minecraft version from a modded version (Fabric/Forge). This is useful for determining which vanilla version's client.jar should be used when launching modded versions, as modded versions inherit from vanilla versions but don't contain their own client.jar. The function follows the inheritsFrom field recursively until reaching a version without a parent (the root vanilla version).
* fix(rules): add architecture and version checks to library rule matchingHsiangNianian2026-01-181-5/+24
| | | | | | | | | | Complete the rule_matches function to properly evaluate: - OS name (already working: osx/macos, linux, windows) - Architecture (arch field): match against env::consts::ARCH - OS version (version field): accept all versions for now (conservative) This ensures that architecture-specific libraries (e.g. natives-arm64) are correctly filtered based on the current platform.
* fix(downloader): use proper atomic ordering for thread-safe progress trackingHsiangNianian2026-01-181-11/+11
| | | | | | | | | | Replace Ordering::Relaxed with appropriate synchronization: - Ordering::AcqRel for fetch_add operations that modify shared state - Ordering::Acquire for loads that depend on other thread's writes - Ordering::Release for stores that other threads may read This ensures visibility of downloaded bytes and completed files across concurrent download tasks without data races.
* fix(auth): add token expiry check in start_gameHsiangNianian2026-01-182-2/+30
| | | | | | | | | Check if the Microsoft account token is expired before attempting to launch the game. If expired, attempt to refresh using the refresh_token. If refresh fails, return an error instructing the user to login again. Also removed #[allow(dead_code)] from is_token_expired since it's now actively used.
* fix(instance): copy directory BEFORE creating metadata in duplicate_instanceHsiangNianian2026-01-181-11/+32
| | | | | | | | Prevent race condition in duplicate_instance by copying the source game directory BEFORE creating and saving the new instance metadata. This ensures that if the copy fails, no orphaned metadata is created. Also copy the icon_path from source instance to maintain visual consistency.
* fix(forge): check if installer created version JSON before manual creationHsiangNianian2026-01-181-4/+22
| | | | | | | The Forge installer may or may not create the version.json file depending on the installer version. Check if the file exists after running the installer before manually creating it to avoid overwriting any installer-generated configuration.
* fix(auth): prevent infinite recursion in get_client()HsiangNianian2026-01-181-2/+2
| | | | | | | | | | The fallback in the reqwest client builder was calling get_client() recursively, which would cause a stack overflow if Client::builder() failed. Now uses reqwest::Client::new() as the fallback. Also fixed User-Agent to be platform-agnostic. Reviewed-by: Claude Opus 4.5
* fix: improve Java path normalization logicHsiangNianian2026-01-161-2/+6
| | | | Enhanced the normalization logic for Java paths by ensuring that the search for "java.exe" in the PATH only occurs for relative paths or the name "java", excluding absolute paths that do not exist. This change improves the reliability of locating the Java executable in various environments.
* feat: implement instance management features and enhance game launch processHsiangNianian2026-01-165-84/+526
| | | | Added functionality for managing game instances, including creating, deleting, updating, and duplicating instances. Integrated instance selection into the game launch process, allowing users to specify the instance when starting a game. Updated the main application logic to handle instance states and paths, ensuring proper directory management for each instance. Introduced a new module for instance management and updated relevant commands to support instance-specific operations.
* feat: enhance Java version management for Minecraft versionsHsiangNianian2026-01-164-55/+509
| | | | Added functionality to determine and validate the required Java version for Minecraft versions, including checks for compatibility with older versions. Implemented event emissions for version installation and deletion, and updated the UI to reflect Java version requirements and installation status. Improved version metadata handling and added support for deleting versions.
* Merge pull request #53 from BegoniaHe/fix/windows-java-path简律纯2026-01-163-4/+264
|\
* | fix: update logging for Java arguments in game start functionHsiangNianian2026-01-161-1/+1
| | | | | | | | Modified the logging statement in the start_game function to display all Java arguments instead of just the first ten, improving debugging capabilities.
| * fix(path): resolve critical java path validation bug on unixBegonia, HE2026-01-161-11/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a critical bug in normalize_java_path where Unix implementation would return Ok(non-existent path) when java_path == "java" and the `which` command failed to find Java in PATH. This caused game launch failures with confusing error messages. Key changes: - Add strip_unc_prefix helper for Windows UNC path handling - Fix Unix bug: explicitly return error when PATH search fails - Apply canonicalize + strip_unc_prefix pattern to both platforms - Enhanced error messages distinguishing PATH vs specific path failures - Add comprehensive unit tests covering edge cases - Update documentation to reflect actual behavior Resolves issue where Windows and Unix users could not launch games when Java path resolution failed silently. Reviewed-by: Claude Sonnet 4.5
| * Merge branch 'HsiangNianian:main' into fix/windows-java-pathBegonia, HE2026-01-162-13/+49
| |\ | |/ |/|
* | feat: enhance Java path handling by resolving symlinks and stripping UNC ↵HsiangNianian2026-01-161-2/+8
| | | | | | | | | | | | prefixes Updated the Java installation and executable retrieval functions to resolve symlinks and strip UNC prefixes from paths. This improvement ensures cleaner and more reliable path handling on Windows systems, enhancing compatibility and usability.
* | feat: add UNC prefix stripping for Windows paths in Java handlingHsiangNianian2026-01-161-1/+17
| | | | | | | | Implemented a helper function to strip the UNC prefix from file paths on Windows, ensuring cleaner path handling. Updated the Java candidate retrieval process to resolve symlinks and apply the new prefix stripping function, enhancing compatibility and usability on Windows systems.
| * fix(windows): resolve Java executable path issues on WindowsBegonia, HE2026-01-163-4/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add normalize_java_path utility function with Windows-specific handling - Automatically append .exe extension when missing on Windows - Use 'where' command to locate java.exe in PATH if not found - Improve error messages with full path display for debugging - Apply path normalization in both start_game and install_forge commands This fixes the "Failed to launch java: program not found" error on Windows by properly handling Java executable paths, including relative paths, missing extensions, and PATH resolution. Reviewed-by: Claude Sonnet 4.5
* | feat: improve Java command execution on WindowsHsiangNianian2026-01-162-10/+24
|/ | | | Enhanced the Java command execution by adding support for Windows-specific creation flags in both the installer and candidate checking functions. This change ensures better compatibility and performance when running Java commands on Windows systems.
* feat: integrate AI assistant functionality and configuration managementHsiangNianian2026-01-1614-105/+998
| | | | Implemented new commands for managing the AI assistant, including health checks, chat interactions, and model listings for both Ollama and OpenAI. Enhanced the configuration system to support raw JSON editing and added a dedicated AssistantConfig structure for better management of assistant settings. This update significantly improves the user experience by providing comprehensive control over AI interactions and configurations.
* fix(security): Potential fix for code scanning alert no. 3: Cleartext ↵简律纯2026-01-161-5/+1
| | | | | logging of sensitive information Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* feat: Enhance Forge installation process by fetching installer manifest and ↵HsiangNianian2026-01-152-60/+286
| | | | improving library management for better compatibility
* feat: Implement local version fetching and enhance version type detection to ↵HsiangNianian2026-01-151-34/+60
| | | | support modpacks in version management
* feat: Add functionality to list installed game versions in the application, ↵HsiangNianian2026-01-151-0/+89
| | | | enhancing version management and user experience in BottomBar
* feat: Add version installation and check functionality to enhance mod loader ↵HsiangNianian2026-01-152-3/+314
| | | | support in the application
* feat: Implement upload_to_pastebin command for log file uploads with content ↵HsiangNianian2026-01-151-1/+79
| | | | length validation and support for Pastebin and paste.rs services
* feat: Add log upload service and optional API key to LauncherConfig for ↵HsiangNianian2026-01-151-0/+4
| | | | enhanced logging capabilities
* fix: Clean up main.rs by removing unused imports and updating variable names ↵HsiangNianian2026-01-151-2/+2
| | | | for clarity; enhance HomeView.svelte by correcting emoji processing logic
* feat: Implement get_github_releases command to fetch and serialize GitHub ↵HsiangNianian2026-01-151-1/+48
| | | | release data
* feat(java): Implement Java catalog management and download featuresBegonia, HE2026-01-153-34/+787
| | | | | | | | - Added commands to fetch and refresh the Java catalog, cancel downloads, and manage pending downloads. - Enhanced the Java download modal in the UI to support version selection, download progress, and pending downloads. - Introduced new types for Java catalog, download progress, and pending downloads. - Updated settings store to handle Java catalog state, download progress, and pending downloads. - Improved user experience with loading states, error handling, and status notifications for Java installations.
* fix: change Java installation path to use Tauri app handle for directory accessBegonia, HE2026-01-152-11/+13
|
* fix: update JVM argument handling to set sha256 to NoneBegonia, HE2026-01-151-1/+2
|
* Apply suggestion from @Copilot简律纯2026-01-151-1/+1
| | | Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Apply suggestion from @SourceryAI简律纯2026-01-151-1/+1
| | | Co-authored-by: SourceryAI <bot@sourcery.ai>
* fix: add missing sha256 field to DownloadTask for Maven librariesBegonia, HE2026-01-141-0/+1
|
* Merge main into feat/download-java-rtBegonia, HE2026-01-1414-199/+1856
|\ | | | | | | | | | | | | - Integrate latest main branch changes (Fabric, Forge support, new UI) - Keep Adoptium Java download feature with SHA256 support - Merge improved download progress tracking with checksum verification - Update dependencies and build configuration
| * feat: enhance dark mode support across UI componentsHsiangNianian2026-01-142-4/+2
| | | | | | | | | | | | | | | | - Updated BottomBar, HomeView, LoginModal, ModLoaderSelector, SettingsView, Sidebar, StatusToast, and VersionsView components for improved dark mode styling. - Adjusted color schemes for various elements to ensure better visibility and aesthetics in dark mode. - Added a theme property to settings to enforce dark mode as the default. - Refactored version badges in VersionsView for better color differentiation. - Enhanced button and input styles for consistency in both light and dark themes.
| * feat: Enhance UI components and add visual effectsHsiangNianian2026-01-142-0/+9
| | | | | | | | | | | | | | | | | | - Updated Sidebar component styles for improved aesthetics and usability. - Refactored VersionsView component with a new layout and enhanced version filtering. - Improved DownloadMonitor and GameConsole components for better performance and visual consistency. - Added new settings for GPU acceleration and visual effects in settings store. - Introduced ParticleBackground component with customizable effects (Constellation and Saturn). - Implemented ConstellationEffect and SaturnEffect classes for dynamic background animations.
| * refactor: clean up formatting and improve readability in core modulesHsiangNianian2026-01-145-33/+47
| |
| * feat: enhance start_game function to support modded versions and add Fabric ↵HsiangNianian2026-01-141-38/+208
| | | | | | | | and Forge commands
| * feat: add Fabric and Forge type definitions and update mod.rs for mod loader ↵HsiangNianian2026-01-141-0/+4
| | | | | | | | support
| * feat: enhance GameVersion struct with optional fields for better mod loader ↵HsiangNianian2026-01-141-16/+30
| | | | | | | | support
| * feat: add version merging utilities for mod loadersHsiangNianian2026-01-141-0/+244
| |
| * feat: implement Maven coordinate parsing and URL construction utilitiesHsiangNianian2026-01-142-1/+407
| |