mirror of
https://github.com/rvtr/ctr_Repair.git
synced 2025-10-31 13:51:08 -04:00
バショトリャー用セーブデータは問答無用で消すように
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@447 385bec56-5757-e545-9c3a-d8741f4650f1
This commit is contained in:
parent
f249a05540
commit
e5d60c4232
@ -19,6 +19,7 @@
|
|||||||
#include "SavedataChecker.h"
|
#include "SavedataChecker.h"
|
||||||
#include "CommonLogger.h"
|
#include "CommonLogger.h"
|
||||||
#include "FileTransfer.h"
|
#include "FileTransfer.h"
|
||||||
|
#include "FileName.h"
|
||||||
|
|
||||||
namespace ConsoleBackup
|
namespace ConsoleBackup
|
||||||
{
|
{
|
||||||
@ -114,11 +115,18 @@ nn::Result SavedataCheckerBase::CleanUpFilesRecursively(bool* modified, std::str
|
|||||||
if(result.IsFailure())
|
if(result.IsFailure())
|
||||||
{
|
{
|
||||||
nn::dbg::PrintResult(result);
|
nn::dbg::PrintResult(result);
|
||||||
COMMON_LOGGER_WARN("Error: %s/%s\n", baseName.c_str(), common::GetCharStr(GetFilePathWithoutArchive(filePath).c_str()));
|
const bool silent = IsForceDeleteFile(common::GetCharStr(entry.entryName));
|
||||||
m_CheckErrorOccured = true;
|
if(!silent)
|
||||||
if (erase)
|
|
||||||
{
|
{
|
||||||
COMMON_LOGGER_WARN("Deleting: %s/%s\n", baseName.c_str(), common::GetCharStr(GetFilePathWithoutArchive(filePath).c_str()));
|
COMMON_LOGGER_WARN("Error: %s/%s\n", baseName.c_str(), common::GetCharStr(GetFilePathWithoutArchive(filePath).c_str()));
|
||||||
|
m_CheckErrorOccured = true;
|
||||||
|
}
|
||||||
|
if (erase || silent)
|
||||||
|
{
|
||||||
|
if(!silent)
|
||||||
|
{
|
||||||
|
COMMON_LOGGER_WARN("Deleting: %s/%s\n", baseName.c_str(), common::GetCharStr(GetFilePathWithoutArchive(filePath).c_str()));
|
||||||
|
}
|
||||||
result = nn::fs::TryDeleteFile(path);
|
result = nn::fs::TryDeleteFile(path);
|
||||||
*modified = true;
|
*modified = true;
|
||||||
}
|
}
|
||||||
@ -132,13 +140,21 @@ nn::Result SavedataCheckerBase::CleanUpFilesRecursively(bool* modified, std::str
|
|||||||
if(result.IsFailure())
|
if(result.IsFailure())
|
||||||
{
|
{
|
||||||
nn::dbg::PrintResult(result);
|
nn::dbg::PrintResult(result);
|
||||||
COMMON_LOGGER_WARN("Error: %s/%s\n", baseName.c_str(), common::GetCharStr(GetFilePathWithoutArchive(filePath).c_str()));
|
const bool silent = IsForceDeleteFile(common::GetCharStr(entry.entryName));
|
||||||
|
if(!silent)
|
||||||
|
{
|
||||||
|
COMMON_LOGGER_WARN("Error: %s/%s\n", baseName.c_str(), common::GetCharStr(GetFilePathWithoutArchive(filePath).c_str()));
|
||||||
|
m_CheckErrorOccured = true;
|
||||||
|
}
|
||||||
|
|
||||||
m_TotalReadSize += file.GetSize();
|
m_TotalReadSize += file.GetSize();
|
||||||
file.Finalize();
|
file.Finalize();
|
||||||
m_CheckErrorOccured = true;
|
if (erase || silent)
|
||||||
if (erase)
|
|
||||||
{
|
{
|
||||||
COMMON_LOGGER_WARN("Deleting: %s/%s\n", baseName.c_str(), common::GetCharStr(GetFilePathWithoutArchive(filePath).c_str()));
|
if(!silent)
|
||||||
|
{
|
||||||
|
COMMON_LOGGER_WARN("Deleting: %s/%s\n", baseName.c_str(), common::GetCharStr(GetFilePathWithoutArchive(filePath).c_str()));
|
||||||
|
}
|
||||||
result = nn::fs::TryDeleteFile(path);
|
result = nn::fs::TryDeleteFile(path);
|
||||||
COMMON_LOGGER_RESULT_IF_FAILED(result);
|
COMMON_LOGGER_RESULT_IF_FAILED(result);
|
||||||
*modified = true;
|
*modified = true;
|
||||||
@ -248,6 +264,11 @@ std::wstring SavedataCheckerBase::GetFilePathWithoutArchive(std::wstring path)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool SavedataCheckerBase::IsForceDeleteFile(const char* name)
|
||||||
|
{
|
||||||
|
return std::strcmp(common::BASHOTORYA_FILE_NAME, name) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
NandSavedataChecker::NandSavedataChecker()
|
NandSavedataChecker::NandSavedataChecker()
|
||||||
{
|
{
|
||||||
// TODO 自動生成されたコンストラクター・スタブ
|
// TODO 自動生成されたコンストラクター・スタブ
|
||||||
|
|||||||
@ -139,9 +139,9 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
//! @brief ファイルとディレクトリを再帰的にチェックする。エラーがあれば削除する
|
//! @brief ファイルとディレクトリを再帰的にチェックする。エラーがあれば削除する
|
||||||
//! @param[out] modified ファイルかディレクトリを削除したかどうか
|
//! @param[out] modified ファイルかディレクトリを削除したかどうか。Commitするかどうかの判断に使用する
|
||||||
//! @param[in] baseName 削除するセーブデータの区別に表示するための名前
|
//! @param[in] baseName 削除するセーブデータの区別に表示するための名前
|
||||||
//! @param[in] currentDirectory チェックを開始するディレクトリ。スラッシュで終端すること。
|
//! @param[in] currentDirectory チェックを開始するディレクトリ。スラッシュで終端すること
|
||||||
//! @param[in] erase ファイルかディレクトリを削除するかどうか
|
//! @param[in] erase ファイルかディレクトリを削除するかどうか
|
||||||
nn::Result CleanUpFilesRecursively(bool* modified, std::string baseName, std::wstring currentDirectory,
|
nn::Result CleanUpFilesRecursively(bool* modified, std::string baseName, std::wstring currentDirectory,
|
||||||
bool erase);
|
bool erase);
|
||||||
@ -171,6 +171,7 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
std::wstring GetFilePathWithoutArchive(std::wstring path);
|
std::wstring GetFilePathWithoutArchive(std::wstring path);
|
||||||
|
bool IsForceDeleteFile(const char* name);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -27,6 +27,8 @@ const char* const NAND_TWL_PHOTO_ARCHIVE_NAME = "twlp:";
|
|||||||
const char* const NAND_TWL_SOUND_ARCHIVE_NAME = "twls:";
|
const char* const NAND_TWL_SOUND_ARCHIVE_NAME = "twls:";
|
||||||
const char* const NAND_TWL_ARCHIVE_NAME = "twln:";
|
const char* const NAND_TWL_ARCHIVE_NAME = "twln:";
|
||||||
|
|
||||||
|
const char* const BASHOTORYA_FILE_NAME = "bashotorya.dat";
|
||||||
|
|
||||||
const wchar_t* const LOG_ROOT_DIRECTORY_PATH = L"sdmc:/CTR_Console_Repair";
|
const wchar_t* const LOG_ROOT_DIRECTORY_PATH = L"sdmc:/CTR_Console_Repair";
|
||||||
const wchar_t* const SD_SAVEDATA_ROOT_NAME = L"CTR_Console_Repair/CTRBackup/";
|
const wchar_t* const SD_SAVEDATA_ROOT_NAME = L"CTR_Console_Repair/CTRBackup/";
|
||||||
const wchar_t* const SD_SAVEDATA_TWL_PHOTO_ROOT_NAME = L"CTR_Console_Repair/TWLPhotoBackup/";
|
const wchar_t* const SD_SAVEDATA_TWL_PHOTO_ROOT_NAME = L"CTR_Console_Repair/TWLPhotoBackup/";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user