From e6b7f6815eb1f2250ab6eac5a5964e63754878f4 Mon Sep 17 00:00:00 2001 From: w3irDv <170813473+w3irDv@users.noreply.github.com> Date: Sat, 24 Aug 2024 10:47:19 +0200 Subject: [PATCH] use getBatchBackupPath function and Id > ID --- include/menu/TitleOptionsState.h | 10 ++--- include/savemng.h | 8 ++-- src/menu/TitleOptionsState.cpp | 72 ++++++++++++++++---------------- src/menu/TitleTaskState.cpp | 8 ++-- src/savemng.cpp | 49 +++++++++++----------- 5 files changed, 74 insertions(+), 73 deletions(-) diff --git a/include/menu/TitleOptionsState.h b/include/menu/TitleOptionsState.h index 12c2d51..29b3edc 100644 --- a/include/menu/TitleOptionsState.h +++ b/include/menu/TitleOptionsState.h @@ -7,13 +7,13 @@ class TitleOptionsState : public ApplicationState { public: - TitleOptionsState(Title title, Task task, int *versionList, int8_t sduser, int8_t wiiuser, bool common, int8_t wiiuser_d, Title *titles, int titleCount) : title(title), + TitleOptionsState(Title title, Task task, int *versionList, int8_t sduser, int8_t wiiuuser, bool common, int8_t wiiuuser_d, Title *titles, int titleCount) : title(title), task(task), versionList(versionList), sduser(sduser), - wiiuser(wiiuser), + wiiuuser(wiiuuser), common(common), - wiiuser_d(wiiuser_d), + wiiuuser_d(wiiuuser_d), titles(titles), titleCount(titleCount) {} @@ -35,9 +35,9 @@ class TitleOptionsState : public ApplicationState { int *versionList; int8_t sduser; - int8_t wiiuser; + int8_t wiiuuser; bool common; - int8_t wiiuser_d; + int8_t wiiuuser_d; Title *titles; int titleCount; diff --git a/include/savemng.h b/include/savemng.h index 507f3b5..7d48037 100644 --- a/include/savemng.h +++ b/include/savemng.h @@ -117,15 +117,15 @@ bool getLoadiineGameSaveDir(char *out, const char *productCode, const char *long bool getLoadiineSaveVersionList(int *out, const char *gamePath); bool isSlotEmpty(uint32_t highID, uint32_t lowID, uint8_t slot); bool hasCommonSave(Title *title, bool inSD, bool iine, uint8_t slot, int version); -void copySavedata(Title *title, Title *titled, int8_t wiiuser, int8_t wiiuser_d, bool common) __attribute__((hot)); +void copySavedata(Title *title, Title *titled, int8_t wiiuuser, int8_t wiiuuser_d, bool common) __attribute__((hot)); std::string getNowDateForFolder() __attribute__((hot)); std::string getNowDate() __attribute__((hot)); void writeMetadata(uint32_t highID,uint32_t lowID,uint8_t slot,bool isUSB) __attribute__((hot)); void writeMetadata(uint32_t highID,uint32_t lowID,uint8_t slot,bool isUSB,const std::string &batchDatetime) __attribute__((hot)); void backupAllSave(Title *titles, int count, const std::string &batchDatetime) __attribute__((hot)); -void backupSavedata(Title *title, uint8_t slot, int8_t wiiuser, bool common) __attribute__((hot)); -void restoreSavedata(Title *title, uint8_t slot, int8_t sduser, int8_t wiiuser, bool common) __attribute__((hot)); -void wipeSavedata(Title *title, int8_t wiiuser, bool common) __attribute__((hot)); +void backupSavedata(Title *title, uint8_t slot, int8_t wiiuuser, bool common) __attribute__((hot)); +void restoreSavedata(Title *title, uint8_t slot, int8_t sduser, int8_t wiiuuser, bool common) __attribute__((hot)); +void wipeSavedata(Title *title, int8_t wiiuuser, bool common) __attribute__((hot)); void importFromLoadiine(Title *title, bool common, int version); void exportToLoadiine(Title *title, bool common, int version); int checkEntry(const char *fPath); diff --git a/src/menu/TitleOptionsState.cpp b/src/menu/TitleOptionsState.cpp index 0d20e66..c9a66d1 100644 --- a/src/menu/TitleOptionsState.cpp +++ b/src/menu/TitleOptionsState.cpp @@ -67,12 +67,12 @@ void TitleOptionsState::render() { if (task == wipe) { consolePrintPos(M_OFF, 7, LanguageUtils::gettext("Select Wii U user to delete from:")); - if (this->wiiuser == -1) + if (this->wiiuuser == -1) consolePrintPos(M_OFF, 8, " < %s >", LanguageUtils::gettext("all users")); else - consolePrintPos(M_OFF, 8, " < %s (%s) > (%s)", getWiiUacc()[this->wiiuser].miiName, - getWiiUacc()[this->wiiuser].persistentID, - hasAccountSave(&this->title, false, false, getWiiUacc()[this->wiiuser].pID, + consolePrintPos(M_OFF, 8, " < %s (%s) > (%s)", getWiiUacc()[this->wiiuuser].miiName, + getWiiUacc()[this->wiiuuser].persistentID, + hasAccountSave(&this->title, false, false, getWiiUacc()[this->wiiuuser].pID, slot, 0) ? LanguageUtils::gettext("Has Save") : LanguageUtils::gettext("Empty")); @@ -84,15 +84,15 @@ void TitleOptionsState::render() { else { consolePrintPos(M_OFF, (task == restore) ? 10 : 7, LanguageUtils::gettext("Select Wii U user%s:"), (task == copytoOtherDevice) ? LanguageUtils::gettext(" to copy from") : ((task == restore) ? LanguageUtils::gettext(" to copy to") : "")); - if (this->wiiuser == -1) + if (this->wiiuuser == -1) consolePrintPos(M_OFF, (task == restore) ? 11 : 8, " < %s >", LanguageUtils::gettext("all users")); else consolePrintPos(M_OFF, (task == restore) ? 11 : 8, " < %s (%s) > (%s)", - getWiiUacc()[wiiuser].miiName, getWiiUacc()[wiiuser].persistentID, + getWiiUacc()[wiiuuser].miiName, getWiiUacc()[wiiuuser].persistentID, hasAccountSave(&this->title, (!((task == backup) || (task == restore) || (task == copytoOtherDevice))), (!((task < 3) || (task == copytoOtherDevice))), - getWiiUacc()[this->wiiuser].pID, slot, + getWiiUacc()[this->wiiuuser].pID, slot, this->versionList != nullptr ? this->versionList[slot] : 0) ? LanguageUtils::gettext("Has Save") : LanguageUtils::gettext("Empty")); @@ -109,19 +109,19 @@ void TitleOptionsState::render() { if (task == copytoOtherDevice) { entrycount++; consolePrintPos(M_OFF, 10, LanguageUtils::gettext("Select Wii U user%s:"), (task == copytoOtherDevice) ? LanguageUtils::gettext(" to copy to") : ""); - if (wiiuser_d == -1) + if (wiiuuser_d == -1) consolePrintPos(M_OFF, 11, " < %s >", LanguageUtils::gettext("all users")); else - consolePrintPos(M_OFF, 11, " < %s (%s) > (%s)", getWiiUacc()[wiiuser_d].miiName, - getWiiUacc()[wiiuser_d].persistentID, + consolePrintPos(M_OFF, 11, " < %s (%s) > (%s)", getWiiUacc()[wiiuuser_d].miiName, + getWiiUacc()[wiiuuser_d].persistentID, hasAccountSave(&titles[this->title.dupeID], false, false, - getWiiUacc()[wiiuser_d].pID, 0, 0) + getWiiUacc()[wiiuuser_d].pID, 0, 0) ? LanguageUtils::gettext("Has Save") : LanguageUtils::gettext("Empty")); } if ((task != importLoadiine) && (task != exportLoadiine)) { - if (this->wiiuser > -1) { + if (this->wiiuuser > -1) { if (hasCommonSave(&this->title, (!((task == backup) || (task == wipe) || (task == copytoOtherDevice))), (!((task < 3) || (task == copytoOtherDevice))), slot, @@ -206,12 +206,12 @@ ApplicationState::eSubState TitleOptionsState::update(Input *input) { case 0: break; case 1: - this->wiiuser = ((this->wiiuser == -1) ? -1 : (this->wiiuser - 1)); - wiiuser_d = this->wiiuser; + this->wiiuuser = ((this->wiiuuser == -1) ? -1 : (this->wiiuuser - 1)); + wiiuuser_d = this->wiiuuser; break; case 2: - wiiuser_d = (((this->wiiuser == -1) || (wiiuser_d == -1)) ? -1 : (wiiuser_d - 1)); - wiiuser_d = ((this->wiiuser > -1) && (wiiuser_d == -1)) ? 0 : wiiuser_d; + wiiuuser_d = (((this->wiiuuser == -1) || (wiiuuser_d == -1)) ? -1 : (wiiuuser_d - 1)); + wiiuuser_d = ((this->wiiuuser > -1) && (wiiuuser_d == -1)) ? 0 : wiiuuser_d; break; case 3: common = common ? false : true; @@ -226,16 +226,16 @@ ApplicationState::eSubState TitleOptionsState::update(Input *input) { if ( sduser > getSDaccn() - 1 ) { sduser = -1; - wiiuser = -1; + wiiuuser = -1; } break; case 1: sduser = ((sduser == -1) ? -1 : (sduser - 1)); - this->wiiuser = ((sduser == -1) ? -1 : this->wiiuser); + this->wiiuuser = ((sduser == -1) ? -1 : this->wiiuuser); break; case 2: - wiiuser = (((wiiuser == -1) || (sduser == -1)) ? -1 : (wiiuser - 1)); - wiiuser = ((sduser > -1) && (wiiuser == -1)) ? 0 : wiiuser; + wiiuuser = (((wiiuuser == -1) || (sduser == -1)) ? -1 : (wiiuuser - 1)); + wiiuuser = ((sduser > -1) && (wiiuuser == -1)) ? 0 : wiiuuser; break; case 3: common = common ? false : true; @@ -248,7 +248,7 @@ ApplicationState::eSubState TitleOptionsState::update(Input *input) { case 0: break; case 1: - wiiuser = ((wiiuser == -1) ? -1 : (wiiuser - 1)); + wiiuuser = ((wiiuuser == -1) ? -1 : (wiiuuser - 1)); break; case 2: common = common ? false : true; @@ -273,7 +273,7 @@ ApplicationState::eSubState TitleOptionsState::update(Input *input) { slot--; break; case 1: - wiiuser = ((wiiuser == -1) ? -1 : (wiiuser - 1)); + wiiuuser = ((wiiuuser == -1) ? -1 : (wiiuuser - 1)); break; case 2: common = common ? false : true; @@ -289,12 +289,12 @@ ApplicationState::eSubState TitleOptionsState::update(Input *input) { case 0: break; case 1: - wiiuser = ((wiiuser == (getWiiUaccn() - 1)) ? (getWiiUaccn() - 1) : (wiiuser + 1)); - wiiuser_d = wiiuser; + wiiuuser = ((wiiuuser == (getWiiUaccn() - 1)) ? (getWiiUaccn() - 1) : (wiiuuser + 1)); + wiiuuser_d = wiiuuser; break; case 2: - wiiuser_d = ((wiiuser_d == (getWiiUaccn() - 1)) ? (getWiiUaccn() - 1) : (wiiuser_d + 1)); - wiiuser_d = (wiiuser == -1) ? -1 : wiiuser_d; + wiiuuser_d = ((wiiuuser_d == (getWiiUaccn() - 1)) ? (getWiiUaccn() - 1) : (wiiuuser_d + 1)); + wiiuuser_d = (wiiuuser == -1) ? -1 : wiiuuser_d; break; case 3: common = common ? false : true; @@ -309,16 +309,16 @@ ApplicationState::eSubState TitleOptionsState::update(Input *input) { if ( sduser > getSDaccn() -1 ) { sduser = -1; - wiiuser = -1; + wiiuuser = -1; } break; case 1: sduser = ((sduser == (getSDaccn() - 1)) ? (getSDaccn() - 1) : (sduser + 1)); - wiiuser = ((sduser > -1) && (wiiuser == -1)) ? 0 : wiiuser; + wiiuuser = ((sduser > -1) && (wiiuuser == -1)) ? 0 : wiiuuser; break; case 2: - wiiuser = ((wiiuser == (getWiiUaccn() - 1)) ? (getWiiUaccn() - 1) : (wiiuser + 1)); - wiiuser = (sduser == -1) ? -1 : wiiuser; + wiiuuser = ((wiiuuser == (getWiiUaccn() - 1)) ? (getWiiUaccn() - 1) : (wiiuuser + 1)); + wiiuuser = (sduser == -1) ? -1 : wiiuuser; break; case 3: common = common ? false : true; @@ -331,7 +331,7 @@ ApplicationState::eSubState TitleOptionsState::update(Input *input) { case 0: break; case 1: - wiiuser = ((wiiuser == (getWiiUaccn() - 1)) ? (getWiiUaccn() - 1) : (wiiuser + 1)); + wiiuuser = ((wiiuuser == (getWiiUaccn() - 1)) ? (getWiiUaccn() - 1) : (wiiuuser + 1)); break; case 2: common = common ? false : true; @@ -356,7 +356,7 @@ ApplicationState::eSubState TitleOptionsState::update(Input *input) { slot++; break; case 1: - wiiuser = ((wiiuser == (getWiiUaccn() - 1)) ? (getWiiUaccn() - 1) : (wiiuser + 1)); + wiiuuser = ((wiiuuser == (getWiiUaccn() - 1)) ? (getWiiUaccn() - 1) : (wiiuuser + 1)); break; case 2: common = common ? false : true; @@ -376,21 +376,21 @@ ApplicationState::eSubState TitleOptionsState::update(Input *input) { if (input->get(TRIGGER, PAD_BUTTON_A)) { switch (this->task) { case backup: - backupSavedata(&this->title, slot, wiiuser, common); + backupSavedata(&this->title, slot, wiiuuser, common); DrawUtils::setRedraw(true); break; case restore: - restoreSavedata(&this->title, slot, sduser, wiiuser, common); + restoreSavedata(&this->title, slot, sduser, wiiuuser, common); DrawUtils::setRedraw(true); break; case wipe: - wipeSavedata(&this->title, wiiuser, common); + wipeSavedata(&this->title, wiiuuser, common); DrawUtils::setRedraw(true); break; case copytoOtherDevice: for (int i = 0; i < this->titleCount; i++) { if (titles[i].listID == this->title.dupeID) { - copySavedata(&this->title, &titles[i], wiiuser, wiiuser_d, common); + copySavedata(&this->title, &titles[i], wiiuuser, wiiuuser_d, common); DrawUtils::setRedraw(true); break; } diff --git a/src/menu/TitleTaskState.cpp b/src/menu/TitleTaskState.cpp index e9435ad..144c4b9 100644 --- a/src/menu/TitleTaskState.cpp +++ b/src/menu/TitleTaskState.cpp @@ -10,7 +10,7 @@ static int cursorPos = 0; static int entrycount; static uint8_t slot = 0; -static int8_t wiiuser = -1, wiiuser_d = -1, sduser = -1; +static int8_t wiiuuser = -1, wiiuuser_d = -1, sduser = -1; static bool common = true; void TitleTaskState::render() { @@ -64,8 +64,8 @@ ApplicationState::eSubState TitleTaskState::update(Input *input) { if (this->task == restore) { BackupSetList::setBackupSetSubPath(); getAccountsSD(&this->title, slot); - wiiuser = ((sduser == -1) ? -1 : wiiuser); - sduser = ((wiiuser == -1) ? -1 : sduser); + wiiuuser = ((sduser == -1) ? -1 : wiiuuser); + sduser = ((wiiuuser == -1) ? -1 : sduser); } if (this->task == wipe) { @@ -103,7 +103,7 @@ ApplicationState::eSubState TitleTaskState::update(Input *input) { if (noError) { DrawUtils::setRedraw(true); this->state = STATE_DO_SUBSTATE; - this->subState = std::make_unique(this->title, this->task, this->versionList, sduser, wiiuser, common, wiiuser_d, this->titles, this->titlesCount); + this->subState = std::make_unique(this->title, this->task, this->versionList, sduser, wiiuuser, common, wiiuuser_d, this->titles, this->titlesCount); } } if (cursorPos > entrycount) diff --git a/src/savemng.cpp b/src/savemng.cpp index 5b37c3c..450c55e 100644 --- a/src/savemng.cpp +++ b/src/savemng.cpp @@ -54,16 +54,16 @@ std::string newlibtoFSA(std::string path) { return path; } -std::string getDynamicBackupPath(uint32_t highId, uint32_t lowId, uint8_t slot) { +std::string getDynamicBackupPath(uint32_t highID, uint32_t lowID, uint8_t slot) { - if (((highId & 0xFFFFFFF0) == 0x00010000) && (slot == 255)) - return StringUtils::stringFormat("%s/%08x%08x", legacyBackupPath, highId, lowId); // LegacyBackup + if (((highID & 0xFFFFFFF0) == 0x00010000) && (slot == 255)) + return StringUtils::stringFormat("%s/%08x%08x", legacyBackupPath, highID, lowID); // LegacyBackup else - return StringUtils::stringFormat("%s%s%08x%08x/%u", backupPath, BackupSetList::getBackupSetSubPath().c_str(), highId, lowId, slot); + return StringUtils::stringFormat("%s%s%08x%08x/%u", backupPath, BackupSetList::getBackupSetSubPath().c_str(), highID, lowID, slot); } -std::string getBatchBackupPath(uint32_t highId, uint32_t lowId, uint8_t slot, std::string datetime) { - return StringUtils::stringFormat("%s/%s/%08x%08x/%u", batchBackupPath, datetime.c_str(),highId, lowId, slot); +std::string getBatchBackupPath(uint32_t highID, uint32_t lowID, uint8_t slot, std::string datetime) { + return StringUtils::stringFormat("%s/%s/%08x%08x/%u", batchBackupPath, datetime.c_str(),highID, lowID, slot); } uint8_t getSDaccn() { @@ -836,7 +836,7 @@ static void FSAMakeQuotaFromDir(const char *src_path, const char *dst_path, uint closedir(src_dir); } -void copySavedata(Title *title, Title *titleb, int8_t wiiuser, int8_t wiiuser_d, bool common) { +void copySavedata(Title *title, Title *titleb, int8_t wiiuuser, int8_t wiiuuser_d, bool common) { uint32_t highID = title->highID; uint32_t lowID = title->lowID; bool isUSB = title->isTitleOnUSB; @@ -848,7 +848,7 @@ void copySavedata(Title *title, Title *titleb, int8_t wiiuser, int8_t wiiuser_d, return; int slotb = getEmptySlot(titleb->highID, titleb->lowID); if ((slotb >= 0) && promptConfirm(ST_YES_NO, LanguageUtils::gettext("Backup current savedata first to next empty slot?"))) { - backupSavedata(titleb, slotb, wiiuser, common); + backupSavedata(titleb, slotb, wiiuuser, common); promptError(LanguageUtils::gettext("Backup done. Now copying Savedata.")); } @@ -859,7 +859,7 @@ void copySavedata(Title *title, Title *titleb, int8_t wiiuser, int8_t wiiuser_d, createFolderUnlocked(dstPath); bool commonSaved = false; - if (wiiuser > -1) { + if (wiiuuser > -1) { if (common) { FSAMakeQuota(handle, newlibtoFSA(dstPath + "/common").c_str(), 0x666, titleb->accountSaveSize); if (copyDir(srcPath + "/common", dstPath + "/common")) @@ -867,8 +867,8 @@ void copySavedata(Title *title, Title *titleb, int8_t wiiuser, int8_t wiiuser_d, else promptError(LanguageUtils::gettext("Common save not found.")); } - srcPath.append(StringUtils::stringFormat("/%s", wiiuacc[wiiuser].persistentID)); - dstPath.append(StringUtils::stringFormat("/%s", wiiuacc[wiiuser_d].persistentID)); + srcPath.append(StringUtils::stringFormat("/%s", wiiuacc[wiiuuser].persistentID)); + dstPath.append(StringUtils::stringFormat("/%s", wiiuacc[wiiuuser_d].persistentID)); if (checkEntry(srcPath.c_str()) == 2) { FSAMakeQuota(handle, newlibtoFSA(dstPath).c_str(), 0x666, titleb->accountSaveSize); if (!copyDir(srcPath, dstPath)) @@ -958,7 +958,8 @@ void backupAllSave(Title *titles, int count, const std::string &batchDatetime) { uint8_t slot = ( isWii ? 0 : (isUSB ? 0 : 1)); const std::string path = (isWii ? "storage_slccmpt01:/title" : (isUSB ? (getUSB() + "/usr/save").c_str() : "storage_mlc01:/usr/save")); std::string srcPath = StringUtils::stringFormat("%s/%08x/%08x/%s", path.c_str(), highID, lowID, isWii ? "data" : "user"); - std::string dstPath = StringUtils::stringFormat("%s/%s/%08x%08x/%u", batchBackupPath, batchDatetime.c_str(), highID, lowID,slot); + //std::string dstPath = StringUtils::stringFormat("%s/%s/%08x%08x/%u", batchBackupPath, batchDatetime.c_str(), highID, lowID,slot); + std::string dstPath = getBatchBackupPath(highID,lowID,slot, batchDatetime); createFolder(dstPath.c_str()); if (!copyDir(srcPath, dstPath)) @@ -969,7 +970,7 @@ void backupAllSave(Title *titles, int count, const std::string &batchDatetime) { } -void backupSavedata(Title *title, uint8_t slot, int8_t wiiuser, bool common) { +void backupSavedata(Title *title, uint8_t slot, int8_t wiiuuser, bool common) { if (!isSlotEmpty(title->highID, title->lowID, slot) && !promptConfirm(ST_WARNING, LanguageUtils::gettext("Backup found on this slot. Overwrite it?"))) { return; @@ -984,15 +985,15 @@ void backupSavedata(Title *title, uint8_t slot, int8_t wiiuser, bool common) { dstPath = getDynamicBackupPath(highID, lowID, slot); createFolder(dstPath.c_str()); bool commonSaved = false; - if ((wiiuser > -1) && !isWii) { + if ((wiiuuser > -1) && !isWii) { if (common) { if (copyDir(srcPath+"/common", dstPath+"/common")) commonSaved = true; else promptError(LanguageUtils::gettext("Common save not found.")); } - srcPath.append(StringUtils::stringFormat("/%s", wiiuacc[wiiuser].persistentID)); - dstPath.append(StringUtils::stringFormat("/%s", wiiuacc[wiiuser].persistentID)); + srcPath.append(StringUtils::stringFormat("/%s", wiiuacc[wiiuuser].persistentID)); + dstPath.append(StringUtils::stringFormat("/%s", wiiuacc[wiiuuser].persistentID)); if (checkEntry(srcPath.c_str()) == 0) { if (commonSaved) writeMetadata(highID,lowID,slot,isUSB); @@ -1008,7 +1009,7 @@ void backupSavedata(Title *title, uint8_t slot, int8_t wiiuser, bool common) { } -void restoreSavedata(Title *title, uint8_t slot, int8_t sduser, int8_t wiiuser, bool common) { +void restoreSavedata(Title *title, uint8_t slot, int8_t sduser, int8_t wiiuuser, bool common) { if (isSlotEmpty(title->highID, title->lowID, slot)) { promptError(LanguageUtils::gettext("No backup found on selected slot.")); return; @@ -1020,7 +1021,7 @@ void restoreSavedata(Title *title, uint8_t slot, int8_t sduser, int8_t wiiuser, BackupSetList::setBackupSetSubPathToRoot(); int slotb = getEmptySlot(title->highID, title->lowID); if ((slotb >= 0) && promptConfirm(ST_YES_NO, LanguageUtils::gettext("Backup current savedata first to next empty slot?"))) - backupSavedata(title, slotb, wiiuser, common); + backupSavedata(title, slotb, wiiuuser, common); BackupSetList::restoreBackupSetSubPath(); uint32_t highID = title->highID; uint32_t lowID = title->lowID; @@ -1042,7 +1043,7 @@ void restoreSavedata(Title *title, uint8_t slot, int8_t sduser, int8_t wiiuser, promptError(LanguageUtils::gettext("Common save not restored.")); } srcPath.append(StringUtils::stringFormat("/%s", sdacc[sduser].persistentID)); - dstPath.append(StringUtils::stringFormat("/%s", wiiuacc[wiiuser].persistentID)); + dstPath.append(StringUtils::stringFormat("/%s", wiiuacc[wiiuuser].persistentID)); if (checkEntry(srcPath.c_str()) == 2) { FSAMakeQuota(handle, newlibtoFSA(dstPath).c_str(), 0x666, title->accountSaveSize); if (!copyDir(srcPath, dstPath)) @@ -1101,12 +1102,12 @@ void restoreSavedata(Title *title, uint8_t slot, int8_t sduser, int8_t wiiuser, } } -void wipeSavedata(Title *title, int8_t wiiuser, bool common) { +void wipeSavedata(Title *title, int8_t wiiuuser, bool common) { if (!promptConfirm(ST_WARNING, LanguageUtils::gettext("Are you sure?")) || !promptConfirm(ST_WARNING, LanguageUtils::gettext("Hm, are you REALLY sure?"))) return; int slotb = getEmptySlot(title->highID, title->lowID); if ((slotb >= 0) && promptConfirm(ST_YES_NO, LanguageUtils::gettext("Backup current savedata first?"))) - backupSavedata(title, slotb, wiiuser, common); + backupSavedata(title, slotb, wiiuuser, common); uint32_t highID = title->highID; uint32_t lowID = title->lowID; bool isUSB = title->isTitleOnUSB; @@ -1116,7 +1117,7 @@ void wipeSavedata(Title *title, int8_t wiiuser, bool common) { std::string path; path = (isWii ? "storage_slccmpt01:/title" : (isUSB ? (getUSB() + "/usr/save") : "storage_mlc01:/usr/save")); srcPath = StringUtils::stringFormat("%s/%08x/%08x/%s", path.c_str(), highID, lowID, isWii ? "data" : "user"); - if ((wiiuser > -1) && !isWii) { + if ((wiiuuser > -1) && !isWii) { if (common) { origPath = srcPath + "/common"; if (!removeDir(origPath)) @@ -1124,13 +1125,13 @@ void wipeSavedata(Title *title, int8_t wiiuser, bool common) { if (unlink(origPath.c_str()) == -1) promptError(LanguageUtils::gettext("Failed to delete common folder: %s"), strerror(errno)); } - srcPath += "/" + std::string(wiiuacc[wiiuser].persistentID); + srcPath += "/" + std::string(wiiuacc[wiiuuser].persistentID); } if (checkEntry(srcPath.c_str()) == 2) { if (!removeDir(srcPath)) promptError(LanguageUtils::gettext("Failed to delete savefile.")); - if ((wiiuser > -1) && !isWii) { + if ((wiiuuser > -1) && !isWii) { if (unlink(srcPath.c_str()) == -1) promptError(LanguageUtils::gettext("Failed to delete user folder: %s"), strerror(errno)); }