mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-26 05:55:15 +00:00
change how downloaded directory mods are saved
This commit is contained in:
parent
f2e8683331
commit
8a0cd66849
1 changed files with 11 additions and 10 deletions
|
@ -146,10 +146,18 @@ void network_receive_mod_list(struct Packet* p) {
|
|||
totalSize += mod->size;
|
||||
LOG_INFO(" '%s': %llu", mod->name, (u64)mod->size);
|
||||
|
||||
if (mod->isDirectory) {
|
||||
if (snprintf(mod->basePath, SYS_MAX_PATH - 1, "%s/%s", gRemoteModsBasePath, mod->relativePath) < 0) {
|
||||
LOG_ERROR("Failed save remote base path!");
|
||||
return;
|
||||
}
|
||||
normalize_path(mod->basePath);
|
||||
} else {
|
||||
if (snprintf(mod->basePath, SYS_MAX_PATH - 1, "%s", gRemoteModsBasePath) < 0) {
|
||||
LOG_ERROR("Failed save remote base path!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (mod->size >= MAX_MOD_SIZE) {
|
||||
djui_popup_create("Server had too large of a mod.\nQuitting.", 4);
|
||||
|
@ -171,13 +179,6 @@ void network_receive_mod_list(struct Packet* p) {
|
|||
packet_read(p, file->relativePath, relativePathLength * sizeof(u8));
|
||||
packet_read(p, &file->size, sizeof(u64));
|
||||
file->fp = NULL;
|
||||
if (mod->isDirectory && !strstr(file->relativePath, "actors") && !strstr(file->relativePath, "levels") && !strstr(file->relativePath, "sound")) {
|
||||
char tmp[SYS_MAX_PATH];
|
||||
if (snprintf(tmp, SYS_MAX_PATH, "%s-%s", mod->relativePath, file->relativePath) >= 0) {
|
||||
memcpy(file->relativePath, tmp, strlen(tmp) + 1);
|
||||
}
|
||||
}
|
||||
normalize_path(file->relativePath);
|
||||
LOG_INFO(" '%s': %llu", file->relativePath, (u64)file->size);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue