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@796 385bec56-5757-e545-9c3a-d8741f4650f1
78 lines
2.2 KiB
C++
78 lines
2.2 KiB
C++
/*---------------------------------------------------------------------------*
|
|
Project: Horizon
|
|
File: AgeChecker.cpp
|
|
|
|
Copyright (C)2014 Nintendo Co., Ltd. All rights reserved.
|
|
|
|
These coded instructions, statements, and computer programs contain
|
|
proprietary information of Nintendo of America Inc. and/or Nintendo
|
|
Company Ltd., and are protected by Federal copyright law. They may
|
|
not be disclosed to third parties or copied or duplicated in any form,
|
|
in whole or in part, without the prior written consent of Nintendo.
|
|
|
|
$Rev$
|
|
*---------------------------------------------------------------------------*/
|
|
|
|
#include "AgeChecker.h"
|
|
|
|
using namespace nn::cfg::CTR;
|
|
|
|
namespace ConsoleRestore
|
|
{
|
|
|
|
const u32 PIN_REQUIRED_AGE_IN_AUSTRALIA_AND_NEW_ZEALAND = 18;
|
|
const u32 PIN_REQUIRED_AGE_IN_EUROPE = 13;
|
|
const u32 PIN_REQUIRED_AGE_IN_UNITED_STATES_AND_CANADA = 13;
|
|
const u32 COPPA_REQUIRED_AGE = 13;
|
|
|
|
AgeChecker::AgeChecker()
|
|
{
|
|
// TODO 自動生成されたコンストラクター・スタブ
|
|
|
|
}
|
|
|
|
AgeChecker::~AgeChecker()
|
|
{
|
|
// TODO Auto-generated destructor stub
|
|
}
|
|
|
|
bool AgeChecker::IsPinRestrictionRequired(u32 age, CfgRegionCode region, CfgCountryCode country)
|
|
{
|
|
if (region == CFG_REGION_EUROPE)
|
|
{
|
|
switch (country)
|
|
{
|
|
case CFG_COUNTRY_AUSTRALIA:
|
|
case CFG_COUNTRY_NEW_ZEALAND:
|
|
{
|
|
return age < PIN_REQUIRED_AGE_IN_AUSTRALIA_AND_NEW_ZEALAND;
|
|
}
|
|
default:
|
|
{
|
|
return age < PIN_REQUIRED_AGE_IN_EUROPE;
|
|
}
|
|
}
|
|
}
|
|
else if (region == CFG_REGION_AMERICA && (country == CFG_COUNTRY_UNITED_STATES || country == CFG_COUNTRY_CANADA))
|
|
{
|
|
return age < PIN_REQUIRED_AGE_IN_UNITED_STATES_AND_CANADA;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
bool AgeChecker::IsCoppaRequired(u32 age, nn::cfg::CTR::CfgRegionCode region, nn::cfg::CTR::CfgCountryCode country)
|
|
{
|
|
if ((region == CFG_REGION_AMERICA && country == CFG_COUNTRY_UNITED_STATES && age < COPPA_REQUIRED_AGE) ||
|
|
(region == CFG_REGION_AMERICA && country == CFG_COUNTRY_CANADA && age < COPPA_REQUIRED_AGE))
|
|
{
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
} /* namespace ConsoleRestore */
|