Removed JVM args
This commit is contained in:
@@ -13,9 +13,9 @@ use lyceris::{
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
use tauri::Emitter as _;
|
use tauri::{Emitter as _, State};
|
||||||
|
|
||||||
use crate::GameVersion;
|
use crate::{GameVersion, SharedState};
|
||||||
|
|
||||||
pub static LAUNCHER_DIR: Lazy<ProjectDirs> = Lazy::new(|| {
|
pub static LAUNCHER_DIR: Lazy<ProjectDirs> = Lazy::new(|| {
|
||||||
ProjectDirs::from("org", "SaturnLauncher", "SaturnLauncher")
|
ProjectDirs::from("org", "SaturnLauncher", "SaturnLauncher")
|
||||||
@@ -25,6 +25,7 @@ pub static LAUNCHER_DIR: Lazy<ProjectDirs> = Lazy::new(|| {
|
|||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
pub async fn launch_game(
|
pub async fn launch_game(
|
||||||
app: tauri::AppHandle,
|
app: tauri::AppHandle,
|
||||||
|
state: State<'_, SharedState>,
|
||||||
version: GameVersion,
|
version: GameVersion,
|
||||||
account: MinecraftAccount,
|
account: MinecraftAccount,
|
||||||
) -> Result<(), String> {
|
) -> Result<(), String> {
|
||||||
@@ -83,6 +84,9 @@ pub async fn launch_game(
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
.loader(Fabric(version.loader_version).into())
|
.loader(Fabric(version.loader_version).into())
|
||||||
|
.memory(lyceris::minecraft::config::Memory::Megabyte(
|
||||||
|
state.lock().unwrap().settings.max_memory as u64,
|
||||||
|
))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
println!("Starting installation");
|
println!("Starting installation");
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ pub struct GameVersion {
|
|||||||
|
|
||||||
#[derive(Clone, Serialize, Deserialize)]
|
#[derive(Clone, Serialize, Deserialize)]
|
||||||
pub struct LauncherSettings {
|
pub struct LauncherSettings {
|
||||||
pub jvm_arguments: String,
|
|
||||||
pub max_memory: u32,
|
pub max_memory: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,11 +43,7 @@ pub struct AppState {
|
|||||||
impl Default for AppState {
|
impl Default for AppState {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
settings: LauncherSettings {
|
settings: LauncherSettings { max_memory: 4096 },
|
||||||
jvm_arguments: "-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200"
|
|
||||||
.into(),
|
|
||||||
max_memory: 4096,
|
|
||||||
},
|
|
||||||
version: String::from("1.21.6"),
|
version: String::from("1.21.6"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,5 @@
|
|||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import {
|
import { MemoryStick, Save, RefreshCcw, Info } from "lucide-react";
|
||||||
Cpu,
|
|
||||||
MemoryStick,
|
|
||||||
Save,
|
|
||||||
RefreshCcw,
|
|
||||||
Info,
|
|
||||||
AlertTriangle,
|
|
||||||
} from "lucide-react";
|
|
||||||
import { getSettings, updateSettings } from "../lib/saturn";
|
import { getSettings, updateSettings } from "../lib/saturn";
|
||||||
import { motion } from "framer-motion";
|
import { motion } from "framer-motion";
|
||||||
import { LauncherSettings } from "@/lib/types";
|
import { LauncherSettings } from "@/lib/types";
|
||||||
@@ -41,8 +34,6 @@ const SettingsSection: React.FC = () => {
|
|||||||
const handleReset = async () => {
|
const handleReset = async () => {
|
||||||
// In a real app, this would reset to defaults in the service
|
// In a real app, this would reset to defaults in the service
|
||||||
const defaultSettings: LauncherSettings = {
|
const defaultSettings: LauncherSettings = {
|
||||||
jvm_arguments:
|
|
||||||
"-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200",
|
|
||||||
max_memory: 4096,
|
max_memory: 4096,
|
||||||
};
|
};
|
||||||
setSettings(defaultSettings);
|
setSettings(defaultSettings);
|
||||||
@@ -142,48 +133,6 @@ const SettingsSection: React.FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
|
|
||||||
{/* JVM Arguments */}
|
|
||||||
<motion.div
|
|
||||||
initial={{ opacity: 0, y: 10 }}
|
|
||||||
animate={{ opacity: 1, y: 0 }}
|
|
||||||
transition={{ delay: 0.1 }}
|
|
||||||
className="panel p-6 space-y-6"
|
|
||||||
>
|
|
||||||
<div className="flex items-center gap-3">
|
|
||||||
<div className="w-8 h-8 rounded-lg bg-saturn-accent/10 flex items-center justify-center text-saturn-accent">
|
|
||||||
<Cpu size={18} />
|
|
||||||
</div>
|
|
||||||
<h2 className="text-lg font-bold">Custom JVM Arguments</h2>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="space-y-4">
|
|
||||||
<p className="text-xs text-saturn-text-secondary leading-relaxed">
|
|
||||||
Advanced flags for the Java Virtual Machine. Saturn Client
|
|
||||||
includes optimized defaults, but you can override them here.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<textarea
|
|
||||||
value={settings.jvm_arguments}
|
|
||||||
onChange={(e) =>
|
|
||||||
setSettings({ ...settings, jvm_arguments: e.target.value })
|
|
||||||
}
|
|
||||||
className="w-full h-32 bg-saturn-bg border border-saturn-border rounded-lg p-4 text-sm font-mono text-saturn-text-secondary focus:outline-none focus:border-saturn-accent/50 focus:ring-1 focus:ring-saturn-accent/50 transition-all resize-none"
|
|
||||||
placeholder="-XX:+UseG1GC..."
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div className="p-3 bg-yellow-500/5 border border-yellow-500/10 rounded-lg flex gap-3">
|
|
||||||
<AlertTriangle
|
|
||||||
size={16}
|
|
||||||
className="text-yellow-500 shrink-0 mt-0.5"
|
|
||||||
/>
|
|
||||||
<p className="text-xs text-yellow-500/80 leading-relaxed">
|
|
||||||
Incorrect JVM arguments can prevent the game from starting. Only
|
|
||||||
modify if you know what you're doing.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</motion.div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -16,6 +16,5 @@ export interface GameVersion {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface LauncherSettings {
|
export interface LauncherSettings {
|
||||||
jvm_arguments: string;
|
|
||||||
max_memory: number;
|
max_memory: number;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user