summaryrefslogtreecommitdiffstats
path: root/src/launcher.rs
diff options
context:
space:
mode:
authorLibravatar bigfoot547 <[email protected]>2025-01-23 00:23:08 -0600
committerLibravatar bigfoot547 <[email protected]>2025-01-23 00:23:08 -0600
commitd14288c76fc33e049b40ca13b97538ab569a48d7 (patch)
tree30896263cda87a5b1232bc6272a53472b2ad52ac /src/launcher.rs
parentoops I forgot to actually apply the logging argument (diff)
fix failing to launch 1.16.5
Diffstat (limited to 'src/launcher.rs')
-rw-r--r--src/launcher.rs19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/launcher.rs b/src/launcher.rs
index 8c798e1..c3c954e 100644
--- a/src/launcher.rs
+++ b/src/launcher.rs
@@ -357,20 +357,25 @@ impl Launcher {
info!("Resolved launch version {}!", ver.id);
- let mut libs = Vec::new();
let mut extract_jobs = Vec::new();
let mut downloads = IndexMap::new();
- for lib in ver.libraries.values() {
+ for lib in ver.libraries.iter() {
if lib.rules_apply(&self.system_info, &feature_matcher).is_err() {
+ trace!("Skipping library {}, compatibility rules failed", lib.name);
continue;
}
- libs.push(lib);
- if let Some(dl) = self.libraries.create_download(lib, self.choose_lib_classifier(lib)) {
+ let classifier = self.choose_lib_classifier(lib);
+
+ if let Some(dl) = self.libraries.create_download(lib, classifier) {
let canon_name = lib.get_canonical_name();
- if downloads.contains_key(&canon_name) { continue; }
+ if downloads.contains_key(&canon_name) {
+ debug!("Skipping library {}, we already have another version of that library.", lib.name);
+ continue;
+ }
+ trace!("Using library {} ({})", lib.name, classifier.unwrap_or("None"));
dl.make_dirs().await.map_err(|e| LaunchError::LibraryDirError(dl.get_path().to_path_buf(), e))?;
if lib.natives.is_some() {
@@ -381,6 +386,8 @@ impl Launcher {
}
downloads.insert(canon_name, dl);
+ } else {
+ trace!("Skipping library {} ({}), no download", lib.name, classifier.unwrap_or("None"));
}
}
@@ -699,7 +706,7 @@ impl LibraryRepository {
for job in libs {
debug!("Extracting natives for {}", job.source.display());
tally += extract::extract_zip(&job.source, &natives_dir, |name|
- job.rule.as_ref().is_some_and(|rules|
+ job.rule.as_ref().is_none_or(|rules|
rules.exclude.iter().filter(|ex|
name.starts_with(ex.as_str())).next().is_none()))?;
}