mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-14 16:14:48 +01:00
Try extraction message fix
Change version to distinguish from official release Slightly change metadata message
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cultivation",
|
"name": "cultivation",
|
||||||
"version": "1.0.10",
|
"version": "1.1.11-Thorny",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tauri-apps/api": "^1.0.0-rc.5",
|
"@tauri-apps/api": "^1.0.0-rc.5",
|
||||||
|
|||||||
@@ -99,29 +99,27 @@ pub fn unzip(
|
|||||||
// Delete zip file
|
// Delete zip file
|
||||||
match std::fs::remove_file(&zipfile) {
|
match std::fs::remove_file(&zipfile) {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
|
// Get any new directory that could have been created
|
||||||
|
let mut new_dir: String = String::new();
|
||||||
|
for entry in read_dir(&write_path).unwrap() {
|
||||||
|
let entry = entry.unwrap();
|
||||||
|
let entry_path = entry.path();
|
||||||
|
if entry_path.is_dir() && !dirs.contains(&entry_path) {
|
||||||
|
new_dir = entry_path.to_str().unwrap().to_string();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut res_hash = std::collections::HashMap::new();
|
||||||
|
res_hash.insert("file", zipfile.to_string());
|
||||||
|
res_hash.insert("new_folder", new_dir);
|
||||||
|
|
||||||
|
window.emit("extract_end", &res_hash).unwrap();
|
||||||
println!("Deleted zip file: {}", zipfile);
|
println!("Deleted zip file: {}", zipfile);
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
println!("Failed to delete zip file: {}", e);
|
println!("Failed to delete zip file: {}", e);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Get any new directory that could have been created
|
|
||||||
let mut new_dir: String = String::new();
|
|
||||||
for entry in read_dir(&write_path).unwrap() {
|
|
||||||
let entry = entry.unwrap();
|
|
||||||
let entry_path = entry.path();
|
|
||||||
if entry_path.is_dir() && !dirs.contains(&entry_path) {
|
|
||||||
new_dir = entry_path.to_str().unwrap().to_string();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut res_hash = std::collections::HashMap::new();
|
|
||||||
res_hash.insert("file", zipfile.to_string());
|
|
||||||
res_hash.insert("new_folder", new_dir);
|
|
||||||
|
|
||||||
// Testing fix
|
|
||||||
//window.emit("extract_end", &res_hash).unwrap();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,8 +149,6 @@ fn extract_rar(rarfile: &str, _f: &File, full_path: &path::Path, _top_level: boo
|
|||||||
fn extract_zip(_zipfile: &str, f: &File, full_path: &path::Path, top_level: bool) -> bool {
|
fn extract_zip(_zipfile: &str, f: &File, full_path: &path::Path, top_level: bool) -> bool {
|
||||||
match zip_extract::extract(f, full_path, top_level) {
|
match zip_extract::extract(f, full_path, top_level) {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
// Notify extract end when extract is actually complete
|
|
||||||
window.emit("extract_end", &res_hash).unwrap();
|
|
||||||
println!(
|
println!(
|
||||||
"Extracted zip file to: {}",
|
"Extracted zip file to: {}",
|
||||||
full_path.to_str().unwrap_or("Error")
|
full_path.to_str().unwrap_or("Error")
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
|
|||||||
|
|
||||||
if (gameVersion?.major == 3 && gameVersion?.minor >= 1) {
|
if (gameVersion?.major == 3 && gameVersion?.minor >= 1) {
|
||||||
alert(
|
alert(
|
||||||
'Game version is too new for metadata patching. Please disable metadata patching in the settings to launch the game.\nNOTE: You will require a UA patch to play the game.'
|
'Game version is too new for metadata patching. TO FIX: Please disable metadata patching in the settings menu to launch the game!! \nNOTE: You will require an RSA patch to play the game.'
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user