NUP専用モードの時は必ずアカウント削除するように

git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@281 385bec56-5757-e545-9c3a-d8741f4650f1
This commit is contained in:
N2614 2011-05-25 10:49:17 +00:00
parent 8aa28f5fb7
commit a81fc8785b
3 changed files with 53 additions and 21 deletions

View File

@ -483,7 +483,7 @@ void CheckRegioinSd(common::HardwareStateManager& manager, ::std::vector<std::st
void ShopOperationSuccess(ShopOperation op, const char* logMessage, RestoreState nextState)
{
COMMON_LOGGER("%s", logMessage);
if (op == SHOP_OPERATION_UNREGISTER)
if (op == SHOP_OPERATION_UNREGISTER || op == SHOP_OPERATION_FORCE_UNREGISTER)
{
CreateDeleteAccountFinishedFile();
}
@ -1047,8 +1047,17 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
case DELETE_ACCOUNT:
{
ShopOperationSingleTemplate(manager, operationMessage, SHOP_OPERATION_UNREGISTER, "Deleting Account",
"Delete Account Finished.\n", "Delete Account Failed. Retrying...", DELETE_ACCOUNT_DONE);
if(s_NupOnlyMode)
{
ShopOperationSingleTemplate(manager, operationMessage, SHOP_OPERATION_FORCE_UNREGISTER, "Deleting Account",
"Delete Account Finished.\n", "Delete Account Failed. Retrying...", DELETE_ACCOUNT_DONE);
}
else
{
ShopOperationSingleTemplate(manager, operationMessage, SHOP_OPERATION_UNREGISTER, "Deleting Account",
"Delete Account Finished.\n", "Delete Account Failed. Retrying...", DELETE_ACCOUNT_DONE);
}
}
break;

View File

@ -370,6 +370,39 @@ nn::Result ShopOperationFinalize()
namespace
{
void ShopOperationUnregisterCore(bool force)
{
nn::Result result;
result = ShopOperationInitialize();
NIM_SHOP_RESULT_CHECK(result);
ECAccountInfo* pAccountInfo;
result = ShopOperationConnect(&pAccountInfo);
NIM_SHOP_RESULT_CHECK(result);
if(force)
{
if (pAccountInfo->accountStatus && (pAccountInfo->accountStatus[0] == 'R' ||
pAccountInfo->accountStatus[0] == 'T'))
{
NN_LOG("nim::Shop::Unregister\n");
result = nn::nim::Shop::Unregister();
NIM_SHOP_RESULT_CHECK(result);
}
}
else
{
if (pAccountInfo->accountStatus && (pAccountInfo->accountStatus[0] == 'R'))
{
NN_LOG("nim::Shop::Unregister\n");
result = nn::nim::Shop::Unregister();
NIM_SHOP_RESULT_CHECK(result);
}
else
{
NN_LOG("Not registered.\n");
}
}
}
// メイン関数
void ShopOperationSingleThreadFunc(ShopThreadParam param)
{
@ -403,24 +436,13 @@ void ShopOperationSingleThreadFunc(ShopThreadParam param)
case SHOP_OPERATION_UNREGISTER:
{
result = ShopOperationInitialize();
NIM_SHOP_RESULT_CHECK(result);
ECAccountInfo* pAccountInfo;
result = ShopOperationConnect(&pAccountInfo);
NIM_SHOP_RESULT_CHECK(result);
if (pAccountInfo->accountStatus && (pAccountInfo->accountStatus[0] == 'R'))
{
/* ---------------------------------------------------------------
Unregister
---------------------------------------------------------------- */
NN_LOG("nim::Shop::Unregister\n");
result = nn::nim::Shop::Unregister();
NIM_SHOP_RESULT_CHECK(result);
}
else
{
NN_LOG("Not registered.\n");
}
ShopOperationUnregisterCore(false);
}
break;
case SHOP_OPERATION_FORCE_UNREGISTER:
{
ShopOperationUnregisterCore(true);
}
break;

View File

@ -30,6 +30,7 @@ typedef enum SHOP_OPERATION
SHOP_OPERATION_CONNECT, // Shop::ConnectしてCloseするだけ
SHOP_OPERATION_GET_IVS, // Shop::ImportIvsFromInfrastructureを実行
SHOP_OPERATION_UNREGISTER, // Shop::Unregisterを実行
SHOP_OPERATION_FORCE_UNREGISTER, // アカウント移行後でもUnregisterを実行
SHOP_OPERATION_CONNECT_WITHOUT_CLOSE, // Shop::ConnectしてCloseしない
SHOP_OPERATION_DOWNLOAD_TITLE, // Titleをダウンロードする
SHOP_OPERATION_NUM_MAX