From f8e185d80bad6acda8c613aeb80a68f59e8e11f3 Mon Sep 17 00:00:00 2001 From: N2614 Date: Mon, 23 Jan 2012 06:49:36 +0000 Subject: [PATCH] =?UTF-8?q?=E3=83=97=E3=83=AA=E3=82=A4=E3=83=B3=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=83=BC=E3=83=AB=E3=82=A2=E3=83=97=E3=83=AA=E3=83=80?= =?UTF-8?q?=E3=82=A6=E3=83=B3=E3=83=AD=E3=83=BC=E3=83=89=E7=94=A8=E3=83=95?= =?UTF-8?q?=E3=83=A9=E3=82=B0=E3=82=92=E8=BF=BD=E5=8A=A0=20=E3=83=95?= =?UTF-8?q?=E3=83=A9=E3=82=B0=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=E3=82=92?= =?UTF-8?q?=E9=96=A2=E6=95=B0=E3=81=BE=E3=81=A8=E3=82=81=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@592 385bec56-5757-e545-9c3a-d8741f4650f1 --- .../sources/ConsoleRestore/Controller.cpp | 4 +- .../sources/ConsoleRestore/Importer.cpp | 76 +++++-------------- .../sources/ConsoleRestore/Importer.h | 2 +- 3 files changed, 24 insertions(+), 58 deletions(-) diff --git a/trunk/ConsoleDataMigration/sources/ConsoleRestore/Controller.cpp b/trunk/ConsoleDataMigration/sources/ConsoleRestore/Controller.cpp index 12d56a1..6409fca 100644 --- a/trunk/ConsoleDataMigration/sources/ConsoleRestore/Controller.cpp +++ b/trunk/ConsoleDataMigration/sources/ConsoleRestore/Controller.cpp @@ -53,6 +53,8 @@ bool s_GetIvsOnlyMode = false; bool s_CheckSdOnlyMode = false; // NUPスキップモードかどうか bool s_SkipNupMode = false; +// プリインストール書き込みモードかどうか +bool s_DownloadPreinstallMode = false; // APSettingの書式が無い警告サウンドを鳴らしたかどうか bool s_ExistAPSettingAnnotation = false; @@ -685,7 +687,7 @@ bool CheckAndReadAPSetting(::std::vector& operationMessage) if (!s_ReadSettingDone) { s_ReadSettingDone = true; - s_ReadSettingIsSuccess = ReadSetting(&s_NupOnlyMode, &s_GetIvsOnlyMode, &s_CheckSdOnlyMode, &s_SkipNupMode); + s_ReadSettingIsSuccess = ReadSetting(&s_NupOnlyMode, &s_GetIvsOnlyMode, &s_CheckSdOnlyMode, &s_SkipNupMode, &s_DownloadPreinstallMode); } if (s_NupOnlyMode && s_GetIvsOnlyMode diff --git a/trunk/ConsoleDataMigration/sources/ConsoleRestore/Importer.cpp b/trunk/ConsoleDataMigration/sources/ConsoleRestore/Importer.cpp index 14aad58..51b34bb 100644 --- a/trunk/ConsoleDataMigration/sources/ConsoleRestore/Importer.cpp +++ b/trunk/ConsoleDataMigration/sources/ConsoleRestore/Importer.cpp @@ -1128,7 +1128,21 @@ bool UpdateNetworkSetting(nn::ac::NetworkSetting& networkSetting) return retval; } -bool ReadSetting(bool* nupOnly, bool* getIvs, bool* checkSd, bool* skipNup) +void ReadSettingFlag(common::ConfigFileLoader* loader, const wchar_t* paramName, bool* flag, const char* logMessage) +{ + NN_NULL_ASSERT(flag); + if (loader->ReadAsChar(paramName) != NULL) + { + s32 num = loader->ReadAsInteger(paramName); + if (num == 1) + { + *flag = true; + COMMON_LOGGER(logMessage); + } + } +} + +bool ReadSetting(bool* nupOnly, bool* getIvs, bool* checkSd, bool* skipNup, bool* dlPreinstall) { nn::Result result; bool retval = true; @@ -1430,61 +1444,11 @@ bool ReadSetting(bool* nupOnly, bool* getIvs, bool* checkSd, bool* skipNup) } - { - const wchar_t* const NUP_ONLY_STR = L"NUP_ONLY"; - NN_NULL_ASSERT(nupOnly); - if (configfileLoader.ReadAsChar(NUP_ONLY_STR) != NULL) - { - s32 num = configfileLoader.ReadAsInteger(NUP_ONLY_STR); - if (num == 1) - { - *nupOnly = true; - COMMON_LOGGER("NUP Only Mode.\n"); - } - } - } - - { - const wchar_t* const GET_IVS_STR = L"GET_SDCI"; - NN_NULL_ASSERT(getIvs); - if (configfileLoader.ReadAsChar(GET_IVS_STR) != NULL) - { - s32 num = configfileLoader.ReadAsInteger(GET_IVS_STR); - if (num == 1) - { - *getIvs = true; - COMMON_LOGGER("GET SDCI Mode.\n"); - } - } - } - - { - const wchar_t* const CHECK_SD_STR = L"CHECK_SD"; - NN_NULL_ASSERT(checkSd); - if (configfileLoader.ReadAsChar(CHECK_SD_STR) != NULL) - { - s32 num = configfileLoader.ReadAsInteger(CHECK_SD_STR); - if (num == 1) - { - *checkSd = true; - COMMON_LOGGER("CHECK SD Mode.\n"); - } - } - } - - { - const wchar_t* const SKIP_NUP_STR = L"SKIP_NUP"; - NN_NULL_ASSERT(skipNup); - if (configfileLoader.ReadAsChar(SKIP_NUP_STR) != NULL) - { - s32 num = configfileLoader.ReadAsInteger(SKIP_NUP_STR); - if (num == 1) - { - *skipNup = true; - COMMON_LOGGER("Skip NUP Mode.\n"); - } - } - } + ReadSettingFlag(&configfileLoader, L"NUP_ONLY", nupOnly, "NUP Only Mode.\n"); + ReadSettingFlag(&configfileLoader, L"GET_SDCI", getIvs, "GET SDCI Mode.\n"); + ReadSettingFlag(&configfileLoader, L"CHECK_SD", checkSd, "CHECK SD Mode.\n"); + ReadSettingFlag(&configfileLoader, L"SKIP_NUP", skipNup, "Skip NUP Mode.\n"); + ReadSettingFlag(&configfileLoader, L"DL_PREINSTALL", dlPreinstall, "Download Preinstall App.\n"); configfileLoader.Finalize(); diff --git a/trunk/ConsoleDataMigration/sources/ConsoleRestore/Importer.h b/trunk/ConsoleDataMigration/sources/ConsoleRestore/Importer.h index f6443fe..16d9825 100644 --- a/trunk/ConsoleDataMigration/sources/ConsoleRestore/Importer.h +++ b/trunk/ConsoleDataMigration/sources/ConsoleRestore/Importer.h @@ -108,7 +108,7 @@ struct TimeZone }; // ネットワーク設定ファイルを読み込む -bool ReadSetting(bool* nupOnly, bool* getIvs, bool* checkSd, bool* skipNup); +bool ReadSetting(bool* nupOnly, bool* getIvs, bool* checkSd, bool* skipNup, bool* dlPreinstall); // ネットワーク設定ファイルからNTPサーバの名前を取得する // 先にReadSettingが成功している必要がある