From 00fc32c49e775ebf595f1e1668205ab9ab1e758b Mon Sep 17 00:00:00 2001 From: N2614 Date: Mon, 21 Feb 2011 04:55:01 +0000 Subject: [PATCH] =?UTF-8?q?NUP=E7=A6=81=E6=AD=A2=E3=83=A2=E3=83=BC?= =?UTF-8?q?=E3=83=89=E3=81=AE=E8=BF=BD=E5=8A=A0=20FAIL=E3=81=97=E3=81=9F?= =?UTF-8?q?=E3=82=89=E5=88=9D=E6=9C=9F=E7=8A=B6=E6=85=8B=E3=81=8B=E3=82=89?= =?UTF-8?q?=E3=82=84=E3=82=8A=E7=9B=B4=E3=81=99=E3=82=88=E3=81=86=E3=81=AB?= 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@72 385bec56-5757-e545-9c3a-d8741f4650f1 --- .../ConsoleRestore/Controller.cpp | 22 ++++++++++++++----- .../ConsoleRestore/Importer.cpp | 22 ++++++++++++++++++- .../ConsoleRestore/Importer.h | 2 +- 3 files changed, 39 insertions(+), 7 deletions(-) diff --git a/trunk/ConsoleDataMigration/ConsoleRestore/Controller.cpp b/trunk/ConsoleDataMigration/ConsoleRestore/Controller.cpp index 1c30417..1304542 100644 --- a/trunk/ConsoleDataMigration/ConsoleRestore/Controller.cpp +++ b/trunk/ConsoleDataMigration/ConsoleRestore/Controller.cpp @@ -71,6 +71,8 @@ bool s_ReadSettingDone = false; bool s_ReadSettingSuccess = false; // NUP専用モードかどうか bool s_NupOnlyMode = false; +// NUP禁止モードかどうか +bool s_NeverNup = false; // APSettingの書式が無い警告サウンドを鳴らしたかどうか bool s_ExistAPSettingAnnotation = false; @@ -119,7 +121,7 @@ bool CheckAndReadAPSetting(::std::vector& operationMessage) if (!s_ReadSettingDone) { s_ReadSettingDone = true; - s_ReadSettingSuccess = ReadSetting(&s_NupOnlyMode); + s_ReadSettingSuccess = ReadSetting(&s_NupOnlyMode, &s_NeverNup); } if(s_NupOnlyMode) @@ -192,10 +194,12 @@ void ControlState(::std::vector& operationMessage, bool& nextStep, // SDカードが挿入されているか? if (nn::fs::IsSdmcInserted()) { - // SDカードにアップデート完了ファイルがあるか? - if (ExistsUpdateCheckedFile()) + validApSetting = CheckAndReadAPSetting(operationMessage); + + // NUP禁止モードか、SDカードにアップデート完了ファイルがあるか? + if (s_NeverNup || ExistsUpdateCheckedFile()) { - validApSetting = CheckAndReadAPSetting(operationMessage); + // NUP専用モードなら終了処理に移る if (s_NupOnlyMode) { s_RestoreState = NUP_ONLY_WAIT_SD_EJECT; @@ -292,7 +296,7 @@ void ControlState(::std::vector& operationMessage, bool& nextStep, } else { - if (CheckAndReadAPSetting(operationMessage)) + if (validApSetting) { // ネットワークアップデートを行う needsUpdate = true; @@ -704,6 +708,14 @@ void ControlState(::std::vector& operationMessage, bool& nextStep, // 書き込み失敗 case FAIL: { + static bool init = true; + if(init) + { + // 状態初期化 + DeleteAllCheckFiles(); + init = false; + } + operationMessage.push_back(::std::string("Failed.")); if (!s_PlayedFailSound) { diff --git a/trunk/ConsoleDataMigration/ConsoleRestore/Importer.cpp b/trunk/ConsoleDataMigration/ConsoleRestore/Importer.cpp index 3c7c4ca..ba3838a 100644 --- a/trunk/ConsoleDataMigration/ConsoleRestore/Importer.cpp +++ b/trunk/ConsoleDataMigration/ConsoleRestore/Importer.cpp @@ -835,7 +835,7 @@ bool UpdateNetworkSetting(nn::ac::NetworkSetting& networkSetting) return retval; } -bool ReadSetting(bool* nupOnly) +bool ReadSetting(bool* nupOnly, bool* neverNup) { nn::Result result; bool retval = true; @@ -1136,6 +1136,25 @@ bool ReadSetting(bool* nupOnly) } + { + NN_NULL_ASSERT(neverNup); + if (configfileLoader.ReadAsChar(L"NEVER_NUP") != NULL) + { + s32 num = configfileLoader.ReadAsInteger(L"NEVER_NUP"); + if (num == 1) + { + *neverNup = true; + COMMON_LOGGER("NEVER_NUP Mode.\n"); + } + else + { + + } + } + } + + // NEVER_NUPがNUP専用モードよりも優先 + if(!(*neverNup)) { NN_NULL_ASSERT(nupOnly); if (configfileLoader.ReadAsChar(L"NUP_ONLY") != NULL) @@ -1149,6 +1168,7 @@ bool ReadSetting(bool* nupOnly) } } + configfileLoader.Finalize(); // 書き込み完了しなければfalse diff --git a/trunk/ConsoleDataMigration/ConsoleRestore/Importer.h b/trunk/ConsoleDataMigration/ConsoleRestore/Importer.h index 1775d87..759a379 100644 --- a/trunk/ConsoleDataMigration/ConsoleRestore/Importer.h +++ b/trunk/ConsoleDataMigration/ConsoleRestore/Importer.h @@ -60,7 +60,7 @@ struct TimeZone NN_PADDING3; }; -bool ReadSetting(bool* nupOnly); +bool ReadSetting(bool* nupOnly, bool* neverNup); char* GetNtpServerName(); TimeZone GetTimeZone();