diff options
author | David Marcec <dmarcecguzman@gmail.com> | 2018-08-09 05:30:58 +0200 |
---|---|---|
committer | David Marcec <dmarcecguzman@gmail.com> | 2018-08-09 05:30:58 +0200 |
commit | 4e1471ef219dc376b8aa637ae05ad43851b8e407 (patch) | |
tree | f7491e79e95ee000e512e26e82507f086e930766 | |
parent | Open first user added (diff) | |
download | yuzu-4e1471ef219dc376b8aa637ae05ad43851b8e407.tar yuzu-4e1471ef219dc376b8aa637ae05ad43851b8e407.tar.gz yuzu-4e1471ef219dc376b8aa637ae05ad43851b8e407.tar.bz2 yuzu-4e1471ef219dc376b8aa637ae05ad43851b8e407.tar.lz yuzu-4e1471ef219dc376b8aa637ae05ad43851b8e407.tar.xz yuzu-4e1471ef219dc376b8aa637ae05ad43851b8e407.tar.zst yuzu-4e1471ef219dc376b8aa637ae05ad43851b8e407.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/acc/profile_manager.cpp | 4 |
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 @@ namespace Service::Account { // TODO(ogniK): Get actual error codes constexpr ResultCode ERROR_TOO_MANY_USERS(ErrorModule::Account, -1); +constexpr ResultCode ERROR_USER_ALREADY_EXISTS(ErrorModule::Account, -2); constexpr ResultCode ERROR_ARGUMENT_IS_NULL(ErrorModule::Account, 20); ProfileManager::ProfileManager() { @@ -45,6 +46,9 @@ ResultCode ProfileManager::CreateNewUser(UUID uuid, std::array<u8, 0x20> usernam return ERROR_ARGUMENT_IS_NULL; if (username[0] == 0x0) return ERROR_ARGUMENT_IS_NULL; + for (unsigned i = 0; i < user_count; i++) + if (uuid == profiles[i].user_uuid) + return ERROR_USER_ALREADY_EXISTS; ProfileInfo prof_inf; prof_inf.user_uuid = std::move(uuid); prof_inf.username = std::move(username); |