diff options
| author | 2025-01-16 19:58:49 -0600 | |
|---|---|---|
| committer | 2025-01-16 19:58:49 -0600 | |
| commit | 55e314f513cdfb3ba33089621d460cfa925c20b2 (patch) | |
| tree | 4447c7c8cff91960ef033c74367251efb19379e7 /src/launcher | |
| parent | remove idea files (diff) | |
start on extracting libraries
Diffstat (limited to 'src/launcher')
| -rw-r--r-- | src/launcher/assets.rs | 5 | ||||
| -rw-r--r-- | src/launcher/constants.rs | 8 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/launcher/assets.rs b/src/launcher/assets.rs index 7ad368e..e732877 100644 --- a/src/launcher/assets.rs +++ b/src/launcher/assets.rs @@ -168,7 +168,10 @@ impl AssetRepository { if let Some(expect) = index.sha1 {
let actual = Sha1::from(&idx_text).digest();
- return Err(AssetError::Integrity(IntegrityError::Sha1Mismatch { expect, actual }));
+
+ if actual != expect {
+ return Err(AssetError::Integrity(IntegrityError::Sha1Mismatch { expect, actual }));
+ }
}
debug!("Saving downloaded asset index to {}", path.display());
diff --git a/src/launcher/constants.rs b/src/launcher/constants.rs index 83611c9..a0ef036 100644 --- a/src/launcher/constants.rs +++ b/src/launcher/constants.rs @@ -1,4 +1,6 @@ use const_format::formatcp; +use lazy_static::lazy_static; +use regex::Regex; const PKG_NAME: &str = env!("CARGO_PKG_NAME"); const PKG_VERSION: &str = env!("CARGO_PKG_VERSION"); @@ -8,3 +10,9 @@ pub const USER_AGENT: &str = formatcp!("{PKG_NAME}/{PKG_VERSION} (in {CRATE_NAME pub const URL_VERSION_MANIFEST: &str = "https://piston-meta.mojang.com/mc/game/version_manifest_v2.json"; pub const URL_RESOURCE_BASE: &str = "https://resources.download.minecraft.net/"; pub const URL_JRE_MANIFEST: &str = "https://launchermeta.mojang.com/v1/products/java-runtime/2ec0cc96c44e5a76b9c8b7c39df7210883d12871/all.json"; + +pub const NATIVES_PREFIX: &str = "natives-"; + +lazy_static! { + pub static ref NATIVES_DIR_PATTERN: Regex = Regex::new("^natives-(\\d+)").unwrap(); +}
\ No newline at end of file |
