From 77c01cef2c82082ba5afa646d1419b4b9e5d490a Mon Sep 17 00:00:00 2001 From: N2614 Date: Fri, 22 Apr 2011 02:31:33 +0000 Subject: [PATCH] =?UTF-8?q?NUP=E5=AE=9F=E8=A1=8C=E9=83=A8=E5=88=86?= =?UTF-8?q?=E3=82=92=E9=96=A2=E6=95=B0=E3=81=AB=20eTicket=E5=90=8C?= =?UTF-8?q?=E6=9C=9F=E5=BE=8C=E3=81=ABIVS=E3=82=92=E9=80=81=E4=BF=A1?= =?UTF-8?q?=E3=81=99=E3=82=8B=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@214 385bec56-5757-e545-9c3a-d8741f4650f1 --- .../ConsoleRestore/Controller.cpp | 147 ++++++++++-------- 1 file changed, 81 insertions(+), 66 deletions(-) diff --git a/trunk/ConsoleDataMigration/ConsoleRestore/Controller.cpp b/trunk/ConsoleDataMigration/ConsoleRestore/Controller.cpp index f6bee6e..f0e53a4 100644 --- a/trunk/ConsoleDataMigration/ConsoleRestore/Controller.cpp +++ b/trunk/ConsoleDataMigration/ConsoleRestore/Controller.cpp @@ -109,6 +109,7 @@ typedef enum RestoreState DELETE_ACCOUNT, // ショップアカウントを削除する DELETE_ACCOUNT_DONE, // ショップアカウント削除完了 SYNC_TICKET, // eTicketを同期する + UPLOAD_IVS, // IVSを送信する READ_FILELIST, // ファイル一覧の読み込み RESTORE_TWL_NAND, // TWL NANDの書き込み中 RESTORE_TWL_SOUND, // TWLサウンドの書き込み中 @@ -505,6 +506,77 @@ void ShopOperationSingleTemplate( } } +void UpdateOperation(::std::vector& message, RestoreState nextState) +{ + // ACアダプタが必要か? + if (NeedsAcAdater()) + { + message.push_back(::std::string("Connect AC Adapter!!")); + } + + // アップデートを行う + if (!s_ExecuteFgNup) + { + if (ImportCountryLanguageData().IsSuccess()) + { + StartFGNetworkUpdate(); + s_ExecuteFgNup = true; + } + else + { + s_RestoreState = FAIL; + } + } + + // 動いていることを表示 + { + PutAliveMessage(message, "Updating"); + } + + if (IsNetworkUpdateFinished()) + { + FinishFGNetworkUpdate(); + // エラーがあったら表示する + if (GetUpdateResult().IsFailure()) + { + // APが見つからない + if (GetUpdateResult() == nn::ac::ResultNotFoundAccessPoint()) + { + COMMON_LOGGER("No Access Point Found!"); + } + } + + if (GetUpdateResult().IsSuccess()) + { + COMMON_LOGGER("Network Update Finished.\n"); + if(nextState == UPDATE_DONE) + { + // アップデート完了ファイルを作成 + CreateUpdateFinishedFile(); + } + + s_RestoreState = nextState; + } + else + { + if (s_FgNupRetryCount++ < RETRY_MAX) + { + // エラーのためやり直す + COMMON_LOGGER_RESULT_IF_FAILED(GetUpdateResult()); + COMMON_LOGGER("Network Update Failed. Retrying... %d\n", s_FgNupRetryCount); + + // FGNUP用のスレッドを作るとこからやり直し + s_ExecuteFgNup = false; + } + else + { + s_RestoreState = FAIL; + } + } + + } +} + bool CheckAndReadAPSetting(::std::vector& operationMessage) { using namespace common; @@ -718,71 +790,7 @@ void ControlState(::std::vector& operationMessage, bool& nextStep) // アップデート中 case UPDATE_IN_PROGRESS: { - // ACアダプタが必要か? - if (NeedsAcAdater()) - { - operationMessage.push_back(::std::string("Connect AC Adapter!!")); - } - - // アップデートを行う - if (!s_ExecuteFgNup) - { - if (ImportCountryLanguageData().IsSuccess()) - { - StartFGNetworkUpdate(); - s_ExecuteFgNup = true; - } - else - { - s_RestoreState = FAIL; - } - } - - // 動いていることを表示 - { - PutAliveMessage(operationMessage, "Updating"); - } - - if (IsNetworkUpdateFinished()) - { - FinishFGNetworkUpdate(); - // エラーがあったら表示する - if (GetUpdateResult().IsFailure()) - { - // APが見つからない - if (GetUpdateResult() == nn::ac::ResultNotFoundAccessPoint()) - { - COMMON_LOGGER("No Access Point Found!"); - } - } - - if (GetUpdateResult().IsSuccess()) - { - COMMON_LOGGER("Network Update Finished.\n"); - // アップデート完了ファイルを作成 - CreateUpdateFinishedFile(); - - s_RestoreState = UPDATE_DONE; - - } - else - { - if (s_FgNupRetryCount++ < RETRY_MAX) - { - // エラーのためやり直す - COMMON_LOGGER_RESULT_IF_FAILED(GetUpdateResult()); - COMMON_LOGGER("Network Update Failed. Retrying... %d\n", s_FgNupRetryCount); - - // FGNUP用のスレッドを作るとこからやり直し - s_ExecuteFgNup = false; - } - else - { - s_RestoreState = FAIL; - } - } - - } + UpdateOperation(operationMessage, UPDATE_DONE); } break; @@ -1042,7 +1050,14 @@ void ControlState(::std::vector& operationMessage, bool& nextStep) case SYNC_TICKET: { ShopOperationSingleTemplate(operationMessage, SHOP_OPERATION_CONNECT_ONLY, "Shop Connect", - "Shop Connect Finished.\n", "Shop Connect Failed. Retrying...", DOWNLOAD_TWL); + "Shop Connect Finished.\n", "Shop Connect Failed. Retrying...", UPLOAD_IVS); + } + break; + + // NUPすることでIVSが送信される + case UPLOAD_IVS: + { + UpdateOperation(operationMessage, DOWNLOAD_TWL); } break;