summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar David Marcec2018-08-09 13:30:58 +1000
committerGravatar David Marcec2018-08-09 13:30:58 +1000
commit4e1471ef219dc376b8aa637ae05ad43851b8e407 (patch)
treef7491e79e95ee000e512e26e82507f086e930766 /src/core
parentOpen first user added (diff)
downloadyuzu-4e1471ef219dc376b8aa637ae05ad43851b8e407.tar.gz
yuzu-4e1471ef219dc376b8aa637ae05ad43851b8e407.tar.xz
yuzu-4e1471ef219dc376b8aa637ae05ad43851b8e407.zip
Don't add user if the uuid already exists
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/acc/profile_manager.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/hle/service/acc/profile_manager.cpp b/src/core/hle/service/acc/profile_manager.cpp
index 03021cb64..ff2b71cce 100644
--- a/src/core/hle/service/acc/profile_manager.cpp
+++ b/src/core/hle/service/acc/profile_manager.cpp
@@ -4,6 +4,7 @@
4namespace Service::Account { 4namespace Service::Account {
5// TODO(ogniK): Get actual error codes 5// TODO(ogniK): Get actual error codes
6constexpr ResultCode ERROR_TOO_MANY_USERS(ErrorModule::Account, -1); 6constexpr ResultCode ERROR_TOO_MANY_USERS(ErrorModule::Account, -1);
7constexpr ResultCode ERROR_USER_ALREADY_EXISTS(ErrorModule::Account, -2);
7constexpr ResultCode ERROR_ARGUMENT_IS_NULL(ErrorModule::Account, 20); 8constexpr ResultCode ERROR_ARGUMENT_IS_NULL(ErrorModule::Account, 20);
8 9
9ProfileManager::ProfileManager() { 10ProfileManager::ProfileManager() {
@@ -45,6 +46,9 @@ ResultCode ProfileManager::CreateNewUser(UUID uuid, std::array<u8, 0x20> usernam
45 return ERROR_ARGUMENT_IS_NULL; 46 return ERROR_ARGUMENT_IS_NULL;
46 if (username[0] == 0x0) 47 if (username[0] == 0x0)
47 return ERROR_ARGUMENT_IS_NULL; 48 return ERROR_ARGUMENT_IS_NULL;
49 for (unsigned i = 0; i < user_count; i++)
50 if (uuid == profiles[i].user_uuid)
51 return ERROR_USER_ALREADY_EXISTS;
48 ProfileInfo prof_inf; 52 ProfileInfo prof_inf;
49 prof_inf.user_uuid = std::move(uuid); 53 prof_inf.user_uuid = std::move(uuid);
50 prof_inf.username = std::move(username); 54 prof_inf.username = std::move(username);