mirror of
https://github.com/LCE-Hub/LCE-Emerald-Launcher.git
synced 2026-09-23 08:32:51 +00:00
fix: proper workshop handling
This commit is contained in:
@@ -891,9 +891,7 @@ async fn download_and_install(app: AppHandle, state: State<'_, DownloadState>, u
|
||||
|
||||
fn ensure_server_list(instance_dir: &PathBuf, servers: Vec<McServer>) {
|
||||
let servers_db = instance_dir.join("servers.db");
|
||||
|
||||
let mut all_servers = Vec::new();
|
||||
|
||||
if let Ok(content) = fs::read(&servers_db) {
|
||||
if content.len() >= 12 && &content[0..4] == b"MCSV" {
|
||||
let count = u32::from_le_bytes(content[8..12].try_into().unwrap_or([0; 4]));
|
||||
@@ -1106,11 +1104,11 @@ async fn workshop_install(app: AppHandle, request: WorkshopInstallRequest) -> Re
|
||||
let dest_dir = if placeholder.is_empty() {
|
||||
instance_dir.clone()
|
||||
} else {
|
||||
let resolved = placeholder
|
||||
let resolved = instance_dir.clone().join(placeholder
|
||||
.replace("{MediaDir}", media_dir.to_str().unwrap_or(""))
|
||||
.replace("{DLCDir}", dlc_dir.to_str().unwrap_or(""))
|
||||
.replace("{GameHDD}", game_hdd.to_str().unwrap_or(""))
|
||||
.replace("{MobDir}", mob_dir.to_str().unwrap_or(""));
|
||||
.replace("{MobDir}", mob_dir.to_str().unwrap_or("")));
|
||||
PathBuf::from(resolved)
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user