aboutsummaryrefslogtreecommitdiffstats
path: root/src/minecraft/launcher.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/minecraft/launcher.rs9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/minecraft/launcher.rs b/src/minecraft/launcher.rs
index cfd6c85..2eeaf21 100644
--- a/src/minecraft/launcher.rs
+++ b/src/minecraft/launcher.rs
@@ -9,7 +9,6 @@ use crate::{
9 platform::paths, 9 platform::paths,
10}; 10};
11 11
12/// Buduje classpath dla danej wersji Minecrafta
13fn build_classpath( 12fn build_classpath(
14 config: &Config, 13 config: &Config,
15 version: &Version, 14 version: &Version,
@@ -27,14 +26,12 @@ fn build_classpath(
27 } 26 }
28 } 27 }
29 28
30 // client.jar zawsze na końcu classpath
31 let client_jar = paths::client_jar(config, &version.id)?; 29 let client_jar = paths::client_jar(config, &version.id)?;
32 entries.push(client_jar.to_string_lossy().to_string()); 30 entries.push(client_jar.to_string_lossy().to_string());
33 31
34 Ok(entries.join(sep)) 32 Ok(entries.join(sep))
35} 33}
36 34
37/// Uruchamia Minecraft
38pub fn launch(config: &Config, version: &Version) -> Result<(), McError> { 35pub fn launch(config: &Config, version: &Version) -> Result<(), McError> {
39 let java = &config.java_path; 36 let java = &config.java_path;
40 let classpath = build_classpath(config, version)?; 37 let classpath = build_classpath(config, version)?;
@@ -63,7 +60,6 @@ pub fn launch(config: &Config, version: &Version) -> Result<(), McError> {
63 60
64 let mut cmd = Command::new(java); 61 let mut cmd = Command::new(java);
65 62
66 // ===== JVM ARGUMENTS (muszą być na początku) =====
67 cmd.arg(format!("-Xmx{}M", config.max_memory_mb)) 63 cmd.arg(format!("-Xmx{}M", config.max_memory_mb))
68 .arg(format!("-Djava.library.path={}", natives_dir.display())); 64 .arg(format!("-Djava.library.path={}", natives_dir.display()));
69 65
@@ -71,12 +67,10 @@ pub fn launch(config: &Config, version: &Version) -> Result<(), McError> {
71 cmd.arg(arg); 67 cmd.arg(arg);
72 } 68 }
73 69
74 // ===== CLASSPATH + MAIN CLASS =====
75 cmd.arg("-cp") 70 cmd.arg("-cp")
76 .arg(classpath) 71 .arg(classpath)
77 .arg(&version.main_class); 72 .arg(&version.main_class);
78 73
79 // ===== ARGUMENTY GRY =====
80 cmd.arg("--username") 74 cmd.arg("--username")
81 .arg(&config.username) 75 .arg(&config.username)
82 .arg("--version") 76 .arg("--version")
@@ -94,7 +88,7 @@ pub fn launch(config: &Config, version: &Version) -> Result<(), McError> {
94 .arg("--accessToken") 88 .arg("--accessToken")
95 .arg("0") 89 .arg("0")
96 .arg("--userType") 90 .arg("--userType")
97 .arg("legacy"); // legacy dla starych kont, można później zmienić 91 .arg("legacy");
98 92
99 let status = cmd.status()?; 93 let status = cmd.status()?;
100 94
@@ -105,7 +99,6 @@ pub fn launch(config: &Config, version: &Version) -> Result<(), McError> {
105 Ok(()) 99 Ok(())
106} 100}
107 101
108/// Sprawdza reguły bibliotek tak jak robi Mojang
109fn library_allowed(lib: &Library) -> bool { 102fn library_allowed(lib: &Library) -> bool {
110 let rules = match &lib.rules { 103 let rules = match &lib.rules {
111 | Some(r) => r, 104 | Some(r) => r,