aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/packages/docs/content/en
diff options
context:
space:
mode:
authorNatsuu <natsukawa247@outlook.com>2026-02-27 17:18:25 +0800
committerGitHub <noreply@github.com>2026-02-27 17:18:25 +0800
commit81a62402ef6f8900ff092366121a9b7a4263ba52 (patch)
tree119109c62331d4d26612e2df7726cee82d1871f5 /packages/docs/content/en
parent3e3144a2c6c62375c2949cb5e9b03f17511fccbe (diff)
downloadDropOut-81a62402ef6f8900ff092366121a9b7a4263ba52.tar.gz
DropOut-81a62402ef6f8900ff092366121a9b7a4263ba52.zip
Restructure docs into manual/development and add implementation docs (#94)
## Summary by Sourcery Restructure documentation into separate manual and development sections, introduce detailed internal implementation docs for auth/Java/mod loaders, and update site navigation, landing page links, and MDX tooling (Mermaid, card styling) to match the new structure and tech stack. Enhancements: - Enable Mermaid rendering support in the docs app and add a reusable Mermaid React component. - Refine Docs page rendering by customizing Card styling and removing redundant in-page titles/descriptions rendered by the layout. - Align docs source configuration and routing comments with the new manual-based default paths. Documentation: - Split user-facing docs under a new manual section and move contributor content into a dedicated development section for both English and Chinese. - Add comprehensive internal implementation documentation covering authentication, Java management, mod loader/version merging, event bus, and architecture patterns in both English and Chinese. - Update existing feature docs (mod loaders, Java, authentication) and getting-started/troubleshooting pages to be more conceptual, pointing to implementation docs for technical details. - Refresh architecture docs to reflect the React/Zustand frontend stack and add Mermaid-based architecture diagrams. - Adjust navigation labels, home-page CTAs, and doc links to target the new manual/development structure and routes. --------- Co-authored-by: 简律纯 <i@jyunko.cn>
Diffstat (limited to 'packages/docs/content/en')
-rw-r--r--packages/docs/content/en/development/architecture.mdx (renamed from packages/docs/content/en/architecture.mdx)134
-rw-r--r--packages/docs/content/en/development/guide.mdx (renamed from packages/docs/content/en/development.mdx)0
-rw-r--r--packages/docs/content/en/development/implementation.mdx351
-rw-r--r--packages/docs/content/en/development/meta.json8
-rw-r--r--packages/docs/content/en/features/authentication.mdx266
-rw-r--r--packages/docs/content/en/manual/features/authentication.mdx131
-rw-r--r--packages/docs/content/en/manual/features/index.mdx (renamed from packages/docs/content/en/features/index.mdx)0
-rw-r--r--packages/docs/content/en/manual/features/java.mdx (renamed from packages/docs/content/en/features/java.mdx)0
-rw-r--r--packages/docs/content/en/manual/features/meta.json (renamed from packages/docs/content/en/features/meta.json)0
-rw-r--r--packages/docs/content/en/manual/features/mod-loaders.mdx (renamed from packages/docs/content/en/features/mod-loaders.mdx)103
-rw-r--r--packages/docs/content/en/manual/getting-started.mdx (renamed from packages/docs/content/en/getting-started.mdx)55
-rw-r--r--packages/docs/content/en/manual/index.mdx (renamed from packages/docs/content/en/index.mdx)0
-rw-r--r--packages/docs/content/en/manual/meta.json9
-rw-r--r--packages/docs/content/en/manual/troubleshooting.mdx (renamed from packages/docs/content/en/troubleshooting.mdx)0
-rw-r--r--packages/docs/content/en/meta.json8
15 files changed, 609 insertions, 456 deletions
diff --git a/packages/docs/content/en/architecture.mdx b/packages/docs/content/en/development/architecture.mdx
index 5f55c5e..6d59ab7 100644
--- a/packages/docs/content/en/architecture.mdx
+++ b/packages/docs/content/en/development/architecture.mdx
@@ -15,10 +15,12 @@ DropOut is built with a modern tech stack designed for performance, security, an
- **Async Runtime**: Tokio
- **HTTP Client**: reqwest with native-tls
-### Frontend (Svelte)
-- **Framework**: Svelte 5 (with runes)
+### Frontend (React)
+- **Framework**: React 19
+- **State Management**: Zustand
+- **Router**: React Router v7
- **Styling**: Tailwind CSS 4
-- **Build Tool**: Vite with Rolldown
+- **Build Tool**: Vite (with Rolldown)
- **Package Manager**: pnpm
### Documentation
@@ -28,75 +30,85 @@ DropOut is built with a modern tech stack designed for performance, security, an
## System Architecture
-```
-┌─────────────────────────────────────────────────────────┐
-│ Frontend (Svelte 5) │
-│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌─────────┐ │
-│ │ Stores │ │Components│ │ UI Views │ │Particles│ │
-│ └────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬────┘ │
-│ │ │ │ │ │
-│ └─────────────┴─────────────┴──────────────┘ │
-│ │ │
-│ Tauri Commands │
-│ Events/Emitters │
-└──────────────────────────┬──────────────────────────────┘
- │
-┌──────────────────────────┴──────────────────────────────┐
-│ Backend (Rust/Tauri) │
-│ ┌─────────────────────────────────────────────────┐ │
-│ │ main.rs (Commands) │ │
-│ └──────────────┬──────────────────────────────────┘ │
-│ │ │
-│ ┌──────────────┴───────────────────────────────┐ │
-│ │ Core Modules │ │
-│ │ ┌──────┐ ┌────────┐ ┌──────┐ ┌──────────┐ │ │
-│ │ │ Auth │ │Download│ │ Java │ │ Instance │ │ │
-│ │ └──────┘ └────────┘ └──────┘ └──────────┘ │ │
-│ │ ┌──────┐ ┌────────┐ ┌──────┐ ┌──────────┐ │ │
-│ │ │Fabric│ │ Forge │ │Config│ │Manifest │ │ │
-│ │ └──────┘ └────────┘ └──────┘ └──────────┘ │ │
-│ └──────────────────────────────────────────────┘ │
-│ │
-│ ┌─────────────────────────────────────────────────┐ │
-│ │ Utils & Helpers │ │
-│ │ • ZIP extraction • Path utilities │ │
-│ └─────────────────────────────────────────────────┘ │
-└──────────────────────────┬──────────────────────────────┘
- │
- External APIs
- │
- ┌──────────────────┼──────────────────┐
- │ │ │
- ┌─────┴────┐ ┌──────┴─────┐ ┌──────┴─────┐
- │ Mojang │ │ Fabric │ │ Forge │
- │ APIs │ │ Meta │ │ Maven │
- └──────────┘ └────────────┘ └────────────┘
+```mermaid
+graph TB
+ subgraph Frontend["Frontend (React 19)"]
+ direction LR
+ Stores[Zustand Stores] ~~~ Components[Components] ~~~ Pages[Pages] ~~~ Router[Router] ~~~ Particles[Particle Background]
+ end
+
+ subgraph TauriLayer["Tauri Communication"]
+ direction LR
+ Commands[Commands] ~~~ Events[Events/Emitters]
+ end
+
+ subgraph Backend["Backend (Rust/Tauri)"]
+ direction TB
+ MainRS[main.rs Command Handler]
+
+ subgraph CoreModules["Core Modules"]
+ direction LR
+ Auth[Auth] ~~~ Download[Download] ~~~ Java[Java] ~~~ Instance[Instance]
+ Fabric[Fabric] ~~~ Forge[Forge] ~~~ Config[Config] ~~~ Manifest[Manifest]
+ Auth ~~~ Fabric
+ end
+
+ subgraph Utils["Utils & Helpers"]
+ direction LR
+ ZipExtract[ZIP Extract] ~~~ PathUtils[Path Utils]
+ end
+
+ MainRS --> CoreModules
+ CoreModules --> Utils
+ end
+
+ subgraph ExternalAPIs["External APIs"]
+ direction LR
+ Mojang[Mojang APIs] ~~~ FabricMeta[Fabric Meta] ~~~ ForgeMaven[Forge Maven]
+ end
+
+ Frontend <--> TauriLayer
+ TauriLayer <--> Backend
+ Backend <--> ExternalAPIs
+
+ style Frontend fill:#e3f2fd
+ style Backend fill:#fff3e0
+ style TauriLayer fill:#f3e5f5
+ style ExternalAPIs fill:#e8f5e9
```
## Core Components
### Frontend State Management
-DropOut uses **Svelte 5 runes** for reactive state management:
+DropOut uses **Zustand** for global state management:
```typescript
-// stores/auth.svelte.ts
-export class AuthState {
- currentAccount = $state<Account | null>(null); // Reactive
- isLoginModalOpen = $state(false);
-
- $effect(() => { // Side effects
- // Auto-runs when dependencies change
- });
+// models/auth.ts
+import { create } from "zustand";
+
+interface AuthState {
+ account: Account | null;
+ loginMode: LoginMode | null;
+ // ...
+ setAccount: (account: Account | null) => void;
}
+
+export const useAuthStore = create<AuthState>((set) => ({
+ account: null,
+ loginMode: null,
+ setAccount: (account) => set({ account }),
+ // ...
+}));
```
**Key Stores:**
-- `auth.svelte.ts`: Authentication state and login flow
-- `settings.svelte.ts`: Launcher settings and Java detection
-- `game.svelte.ts`: Game running state and logs
-- `instances.svelte.ts`: Instance management
-- `ui.svelte.ts`: UI state (toasts, modals, active view)
+- `models/auth.ts`: Authentication state and login flow
+- `models/settings.ts`: Launcher settings and Java detection
+- `models/instance.ts`: Instance management
+- `stores/game-store.ts`: Game running state status
+- `stores/logs-store.ts`: Game log stream management
+- `stores/ui-store.ts`: UI state (toasts, modals, active view)
### Backend Architecture
@@ -213,7 +225,7 @@ const result = await invoke("start_game", { versionId: "1.20.4" });
### Game Launch Sequence
1. **Frontend**: User clicks "Launch Game"
-2. **Command**: `start_game(version_id)` invoked
+2. **Command**: `start_game(instance_id, version_id)` invoked
3. **Backend Processing**:
- Load version JSON (with inheritance)
- Resolve all libraries
diff --git a/packages/docs/content/en/development.mdx b/packages/docs/content/en/development/guide.mdx
index 8ff2906..8ff2906 100644
--- a/packages/docs/content/en/development.mdx
+++ b/packages/docs/content/en/development/guide.mdx
diff --git a/packages/docs/content/en/development/implementation.mdx b/packages/docs/content/en/development/implementation.mdx
new file mode 100644
index 0000000..3ecadfe
--- /dev/null
+++ b/packages/docs/content/en/development/implementation.mdx
@@ -0,0 +1,351 @@
+---
+title: Internal Implementation
+description: Detailed implementation and technical specifications of DropOut core functions
+---
+
+# Internal Implementation
+
+This page details the technical implementation details, data structures, and processing flows of the launcher's core modules.
+
+## 1. Authentication System
+
+The authentication chain contains multiple asynchronous steps, and failure at any step will interrupt the entire process. DropOut uses the Microsoft Device Code Flow to achieve secure login without redirection.
+
+### 1.1 Detailed Process
+1. **Device Code Request**:
+ - Call `https://login.microsoftonline.com/consumers/oauth2/v2.0/devicecode`
+ - Get user verification code and verification URL.
+2. **Token Exchange**: Poll `/oauth2/v2.0/token` to get the primary Access Token and Refresh Token.
+3. **Xbox Live Authentication**: Get `Token` and `uhs` (User Hash).
+4. **XSTS Authorization**: Redirect to `rp://api.minecraftservices.com/`.
+5. **Minecraft Login**: Exchange for the final game Access Token using the `XBL3.0 x=<uhs>;<xsts_token>` format token.
+
+### 1.2 Account Storage and Security
+Account data is persisted in `accounts.json`, containing account type and encrypted token information:
+```json
+{
+ "active_account_uuid": "...",
+ "accounts": [
+ {
+ "type": "Microsoft",
+ "username": "...",
+ "uuid": "...",
+ "access_token": "...",
+ "refresh_token": "...",
+ "expires_at": 1234567890
+ },
+ { "type": "Offline", "username": "Player", "uuid": "..." }
+ ]
+}
+```
+**Offline UUID**: Uses a username-based deterministic UUID v3 to ensure consistency of local saves and configurations.
+
+```rust
+// core/auth.rs implementation details
+pub fn generate_offline_uuid(username: &str) -> String {
+ let namespace = Uuid::NAMESPACE_OID;
+ Uuid::new_v3(&namespace, username.as_bytes()).to_string()
+}
+```
+
+### 1.3 Authentication Related APIs
+| Command / Event | Type | Description |
+| :--- | :--- | :--- |
+| `start_microsoft_login` | Invoke | Start device flow and return verification code |
+| `complete_microsoft_login` | Invoke | Poll and complete the full authentication chain |
+| `login_offline` | Invoke | Create and switch to offline account |
+| `auth-progress` | Event | Report authentication progress in real-time (e.g., "Xbox Live Auth...") |
+
+---
+
+## 2. Java Runtime Management
+
+### 2.1 Catalogs and Metadata
+The Java Catalog caches available versions and platform-specific links from Adoptium.
+- **Storage**: `java_catalog.json` records SHA256 checksums and file sizes for each version.
+
+```json
+// java_catalog.json structure example
+{
+ "releases": [
+ {
+ "major_version": 17,
+ "image_type": "jdk",
+ "version": "17.0.9+9",
+ "download_url": "...",
+ "checksum": "...",
+ "file_size": 123456789
+ }
+ ],
+ "cached_at": 1700000000
+}
+```
+
+- **Detection**: Executes `java -version` command on candidate paths and parses version strings and 64-Bit identifiers from `stderr` output.
+
+```rust
+// core/java.rs detection logic
+fn check_java_installation(path: &PathBuf) -> Option<JavaInstallation> {
+ let mut cmd = Command::new(path);
+ cmd.arg("-version");
+ // Parse "version" keyword information from stderr output
+}
+```
+
+### 2.2 Automatic Installation Logic
+1. **Download**: Supports resumable downloads; large files are downloaded in parallel segments.
+2. **Extraction**: Handles archives for different operating systems (macOS handles .app structure inside .tar.gz, Windows handles .zip).
+3. **Verification**: Mandatory hash verification after download ensures runtime environment integrity.
+
+### 2.3 Java Management Related APIs
+| Command / Event | Type | Description |
+| :--- | :--- | :--- |
+| `detect_java` | Invoke | Scan system installed Java environments |
+| `download_adoptium_java` | Invoke | Start asynchronous download and automatic extraction/configuration |
+| `cancel_java_download` | Invoke | Cancel current download task via atomic flag |
+| `java-download-progress` | Event | Report file size, speed, percentage, and ETA |
+
+---
+
+## 3. Game Launch Logic & JVM Optimization
+
+### 3.1 Memory Allocation Scheme
+- **Xmx & Xms**: It is recommended to set initial memory and maximum memory to be consistent.
+- **Strategy**: The launcher automatically suggests optimal allocation based on total system memory and Java architecture, and parameters generated by the launcher have the highest priority.
+
+### 3.2 G1GC Optimization Strategy
+For 1.17+ versions and high-load mod environments, DropOut injects a concise G1GC parameter chain by default:
+```bash
+-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200
+-XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC
+```
+
+---
+
+## 4. Mod Loader Mechanism
+
+### 4.1 Version Merging (Inheritance)
+Mod loaders link to the vanilla Minecraft version JSON via the `inheritsFrom` field.
+
+```json
+// Typical Fabric version config (partial)
+{
+ "id": "fabric-loader-0.15.0-1.20.4",
+ "inheritsFrom": "1.20.4",
+ "mainClass": "net.fabricmc.loader.impl.launch.knot.KnotClient",
+ "libraries": [
+ {
+ "name": "net.fabricmc:fabric-loader:0.15.0",
+ "url": "https://maven.fabricmc.net/"
+ }
+ ]
+}
+```
+
+The following merging is performed during the launch phase:
+1. **Library Priority**: Loader's own libraries (e.g., Fabric Loader) rank before vanilla libraries.
+2. **Main Class Override**: `mainClass` is always taken from the child definition (i.e., the mod loader's entry point, like Fabric's `KnotClient`).
+3. **Argument Chain**: Merge `jvm` and `game` argument arrays, automatically filtering out inapplicable system rules.
+
+```rust
+// core/version_merge.rs merge core implementation
+pub fn merge_versions(child: GameVersion, parent: GameVersion) -> GameVersion {
+ let mut merged_libraries = child.libraries;
+ merged_libraries.extend(parent.libraries);
+ // Merge argument logic and return new GameVersion instance
+}
+```
+
+### 4.2 Library Path Resolution (Maven)
+The launcher implements complete Maven path conversion logic:
+`group:artifact:version` → `group_path/artifact/version/artifact-version.jar`
+
+```rust
+// core/maven.rs coordinate conversion path logic
+pub fn to_path(&self) -> String {
+ let group_path = self.group.replace('.', "/");
+ format!("{}/{}/{}/{}-{}.{}",
+ group_path, self.artifact, self.version,
+ self.artifact, self.version, self.extension
+ )
+}
+```
+
+### 4.3 Mod Installation Interface
+The launcher uses differentiated installation strategies based on different loader characteristics.
+
+#### Forge Installation Logic
+For Forge, DropOut downloads the official Installer and invokes the standard installer via a Java subprocess, ensuring this process is completely consistent with the official flow (including bytecode patch generation).
+
+```rust
+// core/forge.rs invoke official installer (simplified example)
+Command::new(java_path)
+ .args(&[
+ "-jar",
+ installer_path.to_str().unwrap(),
+ "--installClient",
+ game_dir.to_str().unwrap()
+ ])
+ .output()?;
+```
+
+| Command / Event | Type | Description |
+| :--- | :--- | :--- |
+| `install_fabric` | Invoke | Download Fabric libraries and generate inheritance JSON |
+| `install_forge` | Invoke | Run Forge Installer and perform bytecode patching |
+| `mod-loader-progress` | Event | Report installation stage (e.g., "processing", "complete") |
+
+---
+
+## 5. Communication & Monitoring System
+
+### 5.1 Event Bus
+The backend sends asynchronous pulses to the upper layer via Tauri's `Window` instance.
+
+```rust
+// Backend emit_log! macro simplifies log emission
+macro_rules! emit_log {
+ ($window:expr, $msg:expr) => {
+ let _ = $window.emit("launcher-log", $msg);
+ println!("[Launcher] {}", $msg);
+ };
+}
+```
+
+- **`launcher-log`**: General console output stream for global operation trajectory recording.
+- **`game-stdout` / `game-stderr`**: Capture game subprocess standard output and errors, transmitting to frontend in real-time via independent threads.
+
+```typescript
+// Frontend listen example (Svelte 5)
+import { listen } from "@tauri-apps/api/event";
+
+const unlisten = await listen("launcher-log", (event) => {
+ logStore.addLine(event.payload);
+});
+```
+
+- **`version-installed`**: Notify UI to update version list status after asynchronous task completion.
+
+### 5.2 Launch Log Desensitization
+To prevent sensitive information leakage to third-party log platforms, the launcher masks tokens before recording launch commands.
+
+```rust
+// partial argument masking logic based on main.rs
+let masked_args: Vec<String> = args.iter().enumerate().map(|(i, arg)| {
+ if i > 0 && (args[i-1] == "--accessToken" || args[i-1] == "--uuid") {
+ "***".to_string()
+ } else {
+ arg.clone()
+ }
+}).collect();
+```
+
+---
+
+## 6. Architecture & Development Standards
+
+### 6.1 Core Architecture Patterns
+
+#### Backend Command Pattern (Tauri)
+All backend functions are encapsulated as asynchronous Commands and injected with global state via `State`.
+
+1. **Define Command**:
+```rust
+#[tauri::command]
+async fn start_game(
+ window: Window,
+ auth_state: State<'_, AccountState>,
+ config_state: State<'_, ConfigState>
+) -> Result<String, String> {
+ emit_log!(window, "Starting game launch...");
+ // Business logic...
+ Ok("Success".into())
+}
+```
+
+2. **Register Command (main.rs)**:
+```rust
+tauri::Builder::default()
+ .invoke_handler(tauri::generate_handler![start_game, ...])
+```
+
+3. **Frontend Call**:
+```typescript
+import { invoke } from "@tauri-apps/api/core";
+// Argument names must correspond to Rust function parameters in snake_case/camelCase
+const result = await invoke("start_game", { versionId: "1.20.4" });
+```
+
+#### Error Handling Pattern
+All Tauri commands uniformly return `Result<T, String>`, where the Err type is fixed as String, allowing the frontend to display error messages directly.
+
+```rust
+// Uniformly use map_err to convert errors to String
+.await
+.map_err(|e| e.to_string())?;
+
+// Frontend catch
+try {
+ await invoke("...")
+} catch (e) {
+ // e is the error string returned by Rust
+ console.error(e);
+}
+```
+
+#### Frontend State Management (Svelte 5 Runes)
+The frontend fully adopts Svelte 5's `Runes` system (`$state`, `$effect`) replacing the old `writable` stores.
+
+```typescript
+// ui/src/stores/auth.svelte.ts
+export class AuthState {
+ // Use $state to define reactive data
+ currentAccount = $state<Account | null>(null);
+ isLoginModalOpen = $state(false);
+
+ constructor() {
+ // Initialization logic
+ }
+}
+
+// Export singleton for global access
+export const authState = new AuthState();
+```
+
+#### Frontend View Routing (Manual Routing)
+DropOut does not use conventional URL routing, but instead manages the currently active view component via global state.
+
+```typescript
+// ui/src/stores/ui.svelte.ts
+export class UIState {
+ activeView = $state("home"); // "home" | "versions" | "settings"
+
+ setView(view: string) {
+ this.activeView = view;
+ }
+}
+```
+
+```svelte
+<!-- App.svelte -->
+<script>
+ import { uiState } from "./stores/ui.svelte";
+</script>
+
+{#if uiState.activeView === "home"}
+ <HomeView />
+{:else if uiState.activeView === "settings"}
+ <SettingsView />
+{/if}
+```
+
+### 6.2 Development Best Practices
+1. **Silent Refresh**: Check `expires_at` before calling `start_game`, and call `refresh_full_auth` if expired.
+2. **UA Spoofing**: Microsoft auth WAF blocks requests with empty UA, so simulation of real UA in `reqwest` client is mandatory.
+3. **Log Desensitization**: Sensitive parameter values like `--accessToken` and `--uuid` must be masked in launch logs.
+
+### 6.3 Future Roadmap
+- **Multi-device Account Sync**: Explore OS-level encrypted storage solution to replace existing plaintext `accounts.json`.
+- **Automatic Dependency Resolution**: Automatically parse and download prerequisite libraries from Modrinth/CurseForge when installing mods.
+- **Intelligent Conflict Detection**: Scan `mods/` folder before launch to identify potential class conflicts or injection point errors.
+- **Config Sharing**: Support one-click export/import of complete instance configuration packages (Modpacks).
diff --git a/packages/docs/content/en/development/meta.json b/packages/docs/content/en/development/meta.json
new file mode 100644
index 0000000..dc0d5c5
--- /dev/null
+++ b/packages/docs/content/en/development/meta.json
@@ -0,0 +1,8 @@
+{
+ "title": "Development",
+ "pages": [
+ "guide",
+ "architecture",
+ "implementation"
+ ]
+}
diff --git a/packages/docs/content/en/features/authentication.mdx b/packages/docs/content/en/features/authentication.mdx
deleted file mode 100644
index b6fc4ba..0000000
--- a/packages/docs/content/en/features/authentication.mdx
+++ /dev/null
@@ -1,266 +0,0 @@
----
-title: Authentication
-description: Microsoft OAuth and offline authentication in DropOut
----
-
-# Authentication
-
-DropOut supports two authentication methods: Microsoft Account (for official Minecraft) and Offline Mode (for testing and offline play).
-
-## Microsoft Authentication
-
-### Overview
-
-DropOut uses the **Device Code Flow** for Microsoft authentication, which:
-- Doesn't require a redirect URL (no browser integration)
-- Works on any device with a browser
-- Provides a simple code-based authentication
-- Fully compliant with Microsoft OAuth 2.0
-
-### Authentication Process
-
-The authentication chain consists of multiple steps:
-
-1. **Device Code** → User authorization
-2. **MS Token** → Access + refresh tokens
-3. **Xbox Live** → Xbox token + UHS
-4. **XSTS** → Security token
-5. **Minecraft** → Game access token
-6. **Profile** → Username + UUID
-
-#### Step 1: Device Code Request
-1. Click "Login with Microsoft"
-2. DropOut requests a device code from Microsoft
-3. You receive:
- - User code (e.g., `A1B2-C3D4`)
- - Verification URL (usually `https://microsoft.com/link`)
- - Device code (used internally)
-
-#### Step 2: User Authorization
-1. Visit the verification URL in any browser
-2. Enter the user code
-3. Sign in with your Microsoft account
-4. Authorize DropOut to access your Minecraft profile
-
-#### Step 3: Token Exchange
-- DropOut polls Microsoft for authorization completion
-- Once authorized, receives an access token and refresh token
-- Refresh token is stored for future logins
-
-#### Step 4: Xbox Live Authentication
-- Microsoft token is exchanged for Xbox Live token
-- Retrieves User Hash (UHS) for next step
-
-#### Step 5: XSTS Authorization
-- Xbox Live token is used to get XSTS token
-- This token is specific to Minecraft services
-
-#### Step 6: Minecraft Login
-- XSTS token is exchanged for Minecraft access token
-- Uses endpoint: `/launcher/login`
-
-#### Step 7: Profile Fetching
-- Retrieves your Minecraft username
-- Fetches your UUID
-- Checks if you own Minecraft
-
-### Token Management
-
-**Access Token:**
-- Short-lived (typically 1 hour)
-- Used for game authentication
-- Automatically refreshed when expired
-
-**Refresh Token:**
-- Long-lived (typically 90 days)
-- Stored securely in `accounts.json`
-- Used to obtain new access tokens
-
-**Auto-refresh:**
-```rust
-// Automatic refresh when token expires
-if account.expires_at < current_time {
- refresh_full_auth(&account).await?;
-}
-```
-
-### Security Considerations
-
-- Tokens are stored in platform-specific app data directory
-- HTTPS only for all API calls
-- No credentials stored (only tokens)
-- User-Agent header required (bypasses MS WAF)
-
-### Troubleshooting Microsoft Login
-
-**"Device code expired"**
-- Codes expire after 15 minutes
-- Start the login process again
-
-**"Authorization pending"**
-- Normal during the waiting phase
-- Complete authorization in the browser
-
-**"Invalid token"**
-- Token may have expired
-- Log out and log back in
-
-**"You don't own Minecraft"**
-- Verify your Microsoft account owns Minecraft Java Edition
-- Check at https://www.minecraft.net/profile
-
-## Offline Authentication
-
-### Overview
-
-Offline mode creates a local account that doesn't require internet connectivity or a Microsoft account. This is useful for:
-- Testing and development
-- Playing without internet
-- LAN multiplayer
-- Mod development
-
-### Creating an Offline Account
-
-1. Click "Offline Mode" in the login screen
-2. Enter a username (3-16 characters)
-3. Click "Create Account"
-
-### How It Works
-
-**UUID Generation:**
-```rust
-// Deterministic UUID v3 from username
-let uuid = generate_offline_uuid(&username);
-```
-
-- Uses UUID v3 (namespace-based)
-- Deterministic: same username = same UUID
-- No network requests
-
-**Authentication:**
-- Returns `"null"` as access token
-- Minecraft accepts null token in offline mode
-- Username and UUID stored locally
-
-### Limitations
-
-- Cannot join online servers
-- No skin support
-- No cape support
-- No Microsoft account features
-
-### Use Cases
-
-**Development:**
-```bash
-# Testing mod development
-cargo tauri dev
-# Use offline mode to test quickly
-```
-
-**LAN Play:**
-- Join LAN worlds without authentication
-- Host LAN worlds
-
-**Offline Play:**
-- Singleplayer without internet
-- No authentication required
-
-## Account Management
-
-### Switching Accounts
-
-Currently, DropOut supports one active account at a time. Multi-account support is planned.
-
-**To switch accounts:**
-1. Log out of current account
-2. Log in with new account
-
-### Account Storage
-
-Accounts are stored in `accounts.json`:
-
-```json
-{
- "current_account_id": "uuid-here",
- "accounts": [
- {
- "id": "uuid",
- "type": "Microsoft",
- "username": "PlayerName",
- "access_token": "...",
- "refresh_token": "...",
- "expires_at": 1234567890
- }
- ]
-}
-```
-
-### Deleting Accounts
-
-To remove an account:
-1. Open Settings
-2. Navigate to Accounts
-3. Click "Log Out"
-4. Or manually delete `accounts.json`
-
-## API Reference
-
-### Tauri Commands
-
-**Start Microsoft Login:**
-```typescript
-const { user_code, verification_uri } = await invoke('start_microsoft_login');
-```
-
-**Complete Microsoft Login:**
-```typescript
-const account = await invoke('complete_microsoft_login', { deviceCode });
-```
-
-**Offline Login:**
-```typescript
-const account = await invoke('offline_login', { username: 'Player' });
-```
-
-**Logout:**
-```typescript
-await invoke('logout');
-```
-
-**Get Current Account:**
-```typescript
-const account = await invoke('get_current_account');
-```
-
-### Events
-
-**Authentication Status:**
-```typescript
-listen('auth-status', (event) => {
- console.log(event.payload); // "logged_in" | "logged_out"
-});
-```
-
-## Best Practices
-
-### For Players
-
-1. **Use Microsoft Account** for official servers
-2. **Keep tokens secure** - don't share accounts.json
-3. **Refresh tokens regularly** by logging in
-4. **Use offline mode** only for testing
-
-### For Developers
-
-1. **Handle token expiration** gracefully
-2. **Implement retry logic** for network failures
-3. **Cache account data** to reduce API calls
-4. **Validate tokens** before game launch
-
-## Future Enhancements
-
-- **Multi-account support**: Switch between accounts easily
-- **Account profiles**: Save per-account settings
-- **Auto-login**: Remember last account
-- **Token encryption**: Enhanced security for stored tokens
diff --git a/packages/docs/content/en/manual/features/authentication.mdx b/packages/docs/content/en/manual/features/authentication.mdx
new file mode 100644
index 0000000..f7a1f69
--- /dev/null
+++ b/packages/docs/content/en/manual/features/authentication.mdx
@@ -0,0 +1,131 @@
+---
+title: Authentication
+description: Microsoft OAuth and offline authentication in DropOut
+---
+
+# Authentication
+
+DropOut supports two authentication methods: Microsoft Account (for official Minecraft) and Offline Mode (for testing and offline play).
+
+## Microsoft Authentication
+
+### Overview
+
+DropOut uses the **Device Code Flow** for Microsoft authentication, featuring:
+- No redirect URL required (no browser integration needed)
+- Works on any device with a browser
+- Provides simple code-based authentication
+- Fully compliant with Microsoft OAuth 2.0 standards
+
+### Authentication Process
+
+The authentication chain consists of multiple steps. DropOut automatically handles these complex exchange processes, including interactions with Microsoft, Xbox Live, and Minecraft services. If you are interested in detailed API implementation, please refer to [Internal Implementation](/docs/development/implementation#1-authentication-system).
+
+### Token Management
+
+**Access Token:**
+- Short-lived (typically 1 hour)
+- Used for game authentication
+- Automatically refreshed when expired
+
+**Refresh Token:**
+- Long-lived (typically 90 days)
+- Stored securely in `accounts.json`
+- Used to obtain new access tokens
+
+**Auto-refresh:**
+When the token expires, DropOut attempts to automatically update your login status using the refresh token when you launch the game, ensuring a seamless start.
+
+### Security Considerations
+
+- Tokens are stored in the platform-specific application data directory
+- All API calls use HTTPS only
+- No credentials stored (only tokens)
+- User-Agent header required (bypasses MS WAF)
+
+### Troubleshooting Microsoft Login
+
+**"Device code expired"**
+- The code expires after 15 minutes
+- Restart the login process
+
+**"Authorization pending"**
+- Normal during the waiting phase
+- Complete authorization in your browser
+
+**"Invalid token"**
+- The token may have expired
+- Log out and log back in (use "Switch Account" to clear token)
+
+**"You don't own Minecraft"**
+- Verify your Microsoft account owns Minecraft: Java Edition
+- Check at https://www.minecraft.net/profile
+
+## Offline Authentication
+
+### Overview
+
+Offline mode creates a local account that does not require an internet connection or a Microsoft account. This is useful for:
+- Testing and development
+- Playing without internet
+- LAN multiplayer
+- Mod development
+
+### Creating an Offline Account
+
+1. Click "Offline Mode" on the login screen
+2. Enter a username (3-16 characters)
+3. Click "Create Account"
+
+### How It Works
+
+**UUID Generation:**
+Offline mode uses a deterministic UUID generation algorithm based on the username (UUID v3). This means the same username will always get the same UUID in the same launcher instance, maintaining single-player save consistency.
+
+- Deterministic: Same username = Same UUID
+- No network requests needed
+
+**Authentication:**
+- Returns `"null"` as the access token
+- Minecraft accepts empty tokens in offline mode
+- Username and UUID are stored locally
+
+### Limitations
+
+- Cannot join online servers (online-mode=true)
+- No custom skins support
+- No capes support
+- Cannot use Microsoft account features
+
+## Account Management
+
+### Switching Accounts
+
+Currently, DropOut supports only one active account at a time. Multi-account support is planned.
+
+**Steps to switch accounts:**
+1. Log out of the current account
+2. Log in with the new account
+
+### Account Storage
+
+Account data is stored in `accounts.json` within the application folder. This file contains encrypted tokens, expiration times, and basic profile information for logged-in accounts.
+
+### Deleting an Account
+
+Steps to delete an account:
+1. Open Settings
+2. Navigate to Account
+3. Click "Log out"
+4. Or manually delete `accounts.json`
+
+## API Reference
+
+For low-level implementation of authentication, OAuth 2.0 flow details, and related Tauri command interfaces, please refer to the development documentation: [Implementation Details: Authentication](/docs/development/implementation#1-authentication-system).
+
+## Best Practices
+
+1. **Use Microsoft Account for Official Servers**: To join official servers and use official skins, always use a Microsoft account.
+2. **Keep Tokens Secure**: Do not share the `accounts.json` file or its contents with others, as it contains your login credentials.
+3. **Refresh Tokens Regularly**: Long-unused offline accounts or expired Microsoft tokens can be refreshed by re-logging in or launching the game.
+4. **Use Offline Mode Only for Testing**: Offline mode does not support skins and some multiplayer features.
diff --git a/packages/docs/content/en/features/index.mdx b/packages/docs/content/en/manual/features/index.mdx
index 3a463d0..3a463d0 100644
--- a/packages/docs/content/en/features/index.mdx
+++ b/packages/docs/content/en/manual/features/index.mdx
diff --git a/packages/docs/content/en/features/java.mdx b/packages/docs/content/en/manual/features/java.mdx
index 21b95a9..21b95a9 100644
--- a/packages/docs/content/en/features/java.mdx
+++ b/packages/docs/content/en/manual/features/java.mdx
diff --git a/packages/docs/content/en/features/meta.json b/packages/docs/content/en/manual/features/meta.json
index 4725321..4725321 100644
--- a/packages/docs/content/en/features/meta.json
+++ b/packages/docs/content/en/manual/features/meta.json
diff --git a/packages/docs/content/en/features/mod-loaders.mdx b/packages/docs/content/en/manual/features/mod-loaders.mdx
index d6fdf4f..8fdf019 100644
--- a/packages/docs/content/en/features/mod-loaders.mdx
+++ b/packages/docs/content/en/manual/features/mod-loaders.mdx
@@ -28,31 +28,7 @@ Fabric is a lightweight, modular modding toolchain focused on:
### How It Works
-**Meta API Integration:**
-```rust
-// Fetch available Fabric versions
-let url = format!(
- "https://meta.fabricmc.net/v2/versions/loader/{}",
- minecraft_version
-);
-```
-
-**Profile Generation:**
-1. Fetch Fabric loader metadata
-2. Download Fabric libraries
-3. Generate version JSON with `inheritsFrom`
-4. Merge with parent Minecraft version
-5. Add to versions list
-
-**Version Format:**
-```json
-{
- "id": "fabric-loader-0.15.0-1.20.4",
- "inheritsFrom": "1.20.4",
- "mainClass": "net.fabricmc.loader.impl.launch.knot.KnotClient",
- "libraries": [...]
-}
-```
+DropOut integrates with the Fabric Meta API to automatically fetch compatible loader versions. In the background, it generates the version JSON, handles library dependencies, and utilizes the inheritance system to ensure perfect compatibility with vanilla Minecraft. Detailed JSON structure can be found in [Technical Details](/docs/development/implementation#fabric-integration).
### Fabric Versions
@@ -68,26 +44,7 @@ let url = format!(
### Library Management
-Fabric libraries are resolved from Maven:
-
-**Main Library:**
-```
-net.fabricmc:fabric-loader:0.15.0
-```
-
-**Dependencies:**
-- `net.fabricmc:tiny-mappings-parser`
-- `net.fabricmc:sponge-mixin`
-- `net.fabricmc:access-widener`
-
-**Download:**
-```rust
-// Maven resolution
-let url = format!(
- "https://maven.fabricmc.net/{}/{}",
- artifact_path, filename
-);
-```
+Fabric's dependencies are typically hosted on its official Maven repository. DropOut automatically resolves and downloads all required library files.
### Fabric API
@@ -164,22 +121,9 @@ java -jar forge-installer.jar --installClient
### Library Management
-Forge has many libraries:
-
-**Core Libraries:**
-- `net.minecraftforge:forge:<version>`
-- `net.minecraftforge:fmlloader:<version>`
-- `org.ow2.asm:asm:<version>`
+Forge's runtime depends on a significant number of library files, including its underlying `fmlloader` and bytecode manipulation libraries. DropOut automatically resolves the complex dependency tree and retrieves these files from both the official Forge Maven repository and Minecraft's official libraries.
-**Resolution:**
-```rust
-// Forge Maven
-"https://maven.minecraftforge.net/"
-
-// Dependencies may use:
-// - Maven Central
-// - Minecraft Libraries
-```
+For detailed analysis logic of Forge libraries, refer to [Implementation Details: Forge Core Library Resolution](../development/implementation.mdx#core-library-resolution).
### Forge Processors
@@ -192,44 +136,9 @@ DropOut handles these automatically.
## Version Inheritance
-Both Fabric and Forge use Minecraft's inheritance system:
+Both Fabric and Forge utilize Minecraft's version inheritance mechanism. In this model, the mod loader's version JSON only contains incremental changes relative to the vanilla version, addressed recursively upwards via the `inheritsFrom` field.
-### Parent Version
-
-```json
-{
- "id": "fabric-loader-0.15.0-1.20.4",
- "inheritsFrom": "1.20.4" // Parent vanilla version
-}
-```
-
-### Merging Process
-
-**Libraries:**
-```rust
-// Merged from both
-parent_libraries + modded_libraries
-// Duplicates removed
-```
-
-**Arguments:**
-```rust
-// Combined
-parent_jvm_args + modded_jvm_args
-parent_game_args + modded_game_args
-```
-
-**Assets:**
-```rust
-// Inherited from parent
-assets = parent.assets
-```
-
-**Main Class:**
-```rust
-// Overridden by modded
-main_class = modded.mainClass
-```
+DropOut's launch engine automatically handles this complex merging of libraries, arguments, and assets. Detailed merging logic and code implementation can be viewed in [Implementation Details: Version Merging](../development/implementation.mdx#version-merging-mechanism).
## Comparison
diff --git a/packages/docs/content/en/getting-started.mdx b/packages/docs/content/en/manual/getting-started.mdx
index 5219f40..c172289 100644
--- a/packages/docs/content/en/getting-started.mdx
+++ b/packages/docs/content/en/manual/getting-started.mdx
@@ -13,17 +13,18 @@ DropOut is a modern, reproducible, and developer-grade Minecraft launcher built
Download the latest release for your platform from the [Releases](https://github.com/HsiangNianian/DropOut/releases) page.
-| Platform | Files |
-| -------------- | ----------------------- |
-| Linux x86_64 | `.deb`, `.AppImage` |
-| Linux ARM64 | `.deb`, `.AppImage` |
-| macOS ARM64 | `.dmg` |
-| Windows x86_64 | `.msi`, `.exe` |
-| Windows ARM64 | `.msi`, `.exe` |
+| Platform | Files |
+| -------------- | ------------------- |
+| Linux x86_64 | `.deb`, `.AppImage` |
+| Linux ARM64 | `.deb`, `.AppImage` |
+| macOS ARM64 | `.dmg` |
+| Windows x86_64 | `.msi`, `.exe` |
+| Windows ARM64 | `.msi`, `.exe` |
### Linux Installation
#### Using .deb Package
+
```bash
sudo dpkg -i dropout_*.deb
# Fix dependencies if needed
@@ -31,6 +32,7 @@ sudo apt-get install -f
```
#### Using AppImage
+
```bash
chmod +x dropout_*.AppImage
./dropout_*.AppImage
@@ -45,11 +47,13 @@ chmod +x dropout_*.AppImage
### Windows Installation
#### Using .msi Installer
+
1. Double-click the `.msi` file
2. Follow the installation wizard
3. Launch DropOut from the Start Menu
#### Using .exe Portable
+
1. Double-click the `.exe` file
2. DropOut will run directly without installation
@@ -74,17 +78,12 @@ When you first launch DropOut, you'll need to:
### 1. Login
<Cards>
- <Card
- title="Microsoft Account"
- description="Login with your official Minecraft account"
- />
- <Card
- title="Offline Mode"
- description="Create a local profile for offline play"
- />
+ <Card title="Microsoft Account" description="Login with your official Minecraft account" />
+ <Card title="Offline Mode" description="Create a local profile for offline play" />
</Cards>
**Microsoft Login:**
+
1. Click "Login with Microsoft"
2. A device code will be displayed
3. Visit the URL shown and enter the code
@@ -92,6 +91,7 @@ When you first launch DropOut, you'll need to:
5. Return to DropOut - you'll be logged in automatically
**Offline Login:**
+
1. Click "Offline Mode"
2. Enter a username
3. Click "Create Account"
@@ -117,23 +117,23 @@ When you first launch DropOut, you'll need to:
## Next Steps
<Cards>
- <Card
- title="Features"
- href="/docs/features"
+ <Card
+ title="Features"
+ href="/docs/manual/features"
description="Learn about all the features DropOut offers"
/>
- <Card
- title="Instances"
- href="/docs/features/instances"
+ <Card
+ title="Instances"
+ href="/docs/manual/features/instances"
description="Create isolated game environments"
/>
- <Card
- title="Mod Loaders"
- href="/docs/features/mod-loaders"
+ <Card
+ title="Mod Loaders"
+ href="/docs/manual/features/mod-loaders"
description="Install and manage Fabric and Forge"
/>
- <Card
- title="Troubleshooting"
+ <Card
+ title="Troubleshooting"
href="/docs/troubleshooting"
description="Common issues and solutions"
/>
@@ -142,12 +142,14 @@ When you first launch DropOut, you'll need to:
## System Requirements
### Minimum Requirements
+
- **OS**: Windows 10+, macOS 11+, or Linux (Debian-based)
- **RAM**: 4GB (8GB recommended for modded Minecraft)
- **Storage**: 2GB for launcher + game files
- **Java**: Auto-installed by DropOut if not found
### Recommended Requirements
+
- **OS**: Latest stable version of your OS
- **RAM**: 16GB for optimal performance with mods
- **Storage**: 10GB+ for multiple versions and mods
@@ -156,6 +158,7 @@ When you first launch DropOut, you'll need to:
## Getting Help
If you encounter issues:
+
- Check the [Troubleshooting Guide](/docs/troubleshooting)
- Report bugs on [GitHub Issues](https://github.com/HsiangNianian/DropOut/issues)
- Join our community discussions
diff --git a/packages/docs/content/en/index.mdx b/packages/docs/content/en/manual/index.mdx
index 9dee19f..9dee19f 100644
--- a/packages/docs/content/en/index.mdx
+++ b/packages/docs/content/en/manual/index.mdx
diff --git a/packages/docs/content/en/manual/meta.json b/packages/docs/content/en/manual/meta.json
new file mode 100644
index 0000000..38506c1
--- /dev/null
+++ b/packages/docs/content/en/manual/meta.json
@@ -0,0 +1,9 @@
+{
+ "title": "User Manual",
+ "pages": [
+ "index",
+ "getting-started",
+ "features",
+ "troubleshooting"
+ ]
+}
diff --git a/packages/docs/content/en/troubleshooting.mdx b/packages/docs/content/en/manual/troubleshooting.mdx
index 6d97819..6d97819 100644
--- a/packages/docs/content/en/troubleshooting.mdx
+++ b/packages/docs/content/en/manual/troubleshooting.mdx
diff --git a/packages/docs/content/en/meta.json b/packages/docs/content/en/meta.json
index 75bf27a..a877cab 100644
--- a/packages/docs/content/en/meta.json
+++ b/packages/docs/content/en/meta.json
@@ -1,11 +1,7 @@
{
"title": "Documentation",
"pages": [
- "index",
- "getting-started",
- "architecture",
- "features",
- "development",
- "troubleshooting"
+ "manual",
+ "development"
]
}