From 5f8d253ce0a940cdb668861c2c96749c7b9ce626 Mon Sep 17 00:00:00 2001 From: David Marcec Date: Wed, 8 Aug 2018 21:09:45 +1000 Subject: Switched uuids from u128 to new UUID struct --- src/core/hle/service/acc/acc.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src/core/hle/service/acc/acc.cpp') diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp index e952b0518..1fb3d96f6 100644 --- a/src/core/hle/service/acc/acc.cpp +++ b/src/core/hle/service/acc/acc.cpp @@ -3,7 +3,10 @@ // Refer to the license.txt file included. #include +#include "common/common_types.h" #include "common/logging/log.h" +#include "common/swap.h" +#include "core/core_timing.h" #include "core/hle/ipc_helpers.h" #include "core/hle/service/acc/acc.h" #include "core/hle/service/acc/acc_aa.h" @@ -13,7 +16,6 @@ #include "core/settings.h" namespace Service::Account { - // TODO: RE this structure struct UserData { INSERT_PADDING_WORDS(1); @@ -33,11 +35,11 @@ struct ProfileBase { static_assert(sizeof(ProfileBase) == 0x38, "ProfileBase structure has incorrect size"); // TODO(ogniK): Generate a real user id based on username, md5(username) maybe? -static constexpr u128 DEFAULT_USER_ID{1ull, 0ull}; +static UUID DEFAULT_USER_ID{1ull, 0ull}; class IProfile final : public ServiceFramework { public: - explicit IProfile(u128 user_id) : ServiceFramework("IProfile"), user_id(user_id) { + explicit IProfile(UUID user_id) : ServiceFramework("IProfile"), user_id(user_id) { static const FunctionInfo functions[] = { {0, &IProfile::Get, "Get"}, {1, &IProfile::GetBase, "GetBase"}, @@ -51,7 +53,7 @@ private: void Get(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_ACC, "(STUBBED) called"); ProfileBase profile_base{}; - profile_base.user_id = user_id; + profile_base.user_id = user_id.uuid; if (Settings::values.username.size() > profile_base.username.size()) { std::copy_n(Settings::values.username.begin(), profile_base.username.size(), profile_base.username.begin()); @@ -70,7 +72,7 @@ private: // TODO(Subv): Retrieve this information from somewhere. ProfileBase profile_base{}; - profile_base.user_id = user_id; + profile_base.user_id = user_id.uuid; if (Settings::values.username.size() > profile_base.username.size()) { std::copy_n(Settings::values.username.begin(), profile_base.username.size(), profile_base.username.begin()); @@ -83,7 +85,7 @@ private: rb.PushRaw(profile_base); } - u128 user_id; ///< The user id this profile refers to. + UUID user_id; ///< The user id this profile refers to. }; class IManagerForApplication final : public ServiceFramework { @@ -136,7 +138,7 @@ void Module::Interface::GetUserExistence(Kernel::HLERequestContext& ctx) { void Module::Interface::ListAllUsers(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_ACC, "(STUBBED) called"); // TODO(Subv): There is only one user for now. - const std::vector user_ids = {DEFAULT_USER_ID}; + const std::vector user_ids = {DEFAULT_USER_ID}; ctx.WriteBuffer(user_ids); IPC::ResponseBuilder rb{ctx, 2}; rb.Push(RESULT_SUCCESS); @@ -145,7 +147,7 @@ void Module::Interface::ListAllUsers(Kernel::HLERequestContext& ctx) { void Module::Interface::ListOpenUsers(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_ACC, "(STUBBED) called"); // TODO(Subv): There is only one user for now. - const std::vector user_ids = {DEFAULT_USER_ID}; + const std::vector user_ids = {DEFAULT_USER_ID}; ctx.WriteBuffer(user_ids); IPC::ResponseBuilder rb{ctx, 2}; rb.Push(RESULT_SUCCESS); @@ -153,11 +155,11 @@ void Module::Interface::ListOpenUsers(Kernel::HLERequestContext& ctx) { void Module::Interface::GetProfile(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; - u128 user_id = rp.PopRaw(); + UUID user_id = rp.PopRaw(); IPC::ResponseBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); rb.PushIpcInterface(user_id); - LOG_DEBUG(Service_ACC, "called user_id=0x{:016X}{:016X}", user_id[1], user_id[0]); + LOG_DEBUG(Service_ACC, "called user_id={}", user_id.Format()); } void Module::Interface::InitializeApplicationInfo(Kernel::HLERequestContext& ctx) { -- cgit v1.2.3 From 6f691e71bfa30de8789327a969cb7c2fdd1669f2 Mon Sep 17 00:00:00 2001 From: David Marcec Date: Wed, 8 Aug 2018 22:26:42 +1000 Subject: began initial implementation of "ProfileManager" --- src/core/hle/service/acc/acc.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/core/hle/service/acc/acc.cpp') diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp index 1fb3d96f6..8efaf6171 100644 --- a/src/core/hle/service/acc/acc.cpp +++ b/src/core/hle/service/acc/acc.cpp @@ -28,7 +28,7 @@ struct UserData { static_assert(sizeof(UserData) == 0x80, "UserData structure has incorrect size"); struct ProfileBase { - u128 user_id; + UUID user_id; u64 timestamp; std::array username; }; @@ -53,7 +53,7 @@ private: void Get(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_ACC, "(STUBBED) called"); ProfileBase profile_base{}; - profile_base.user_id = user_id.uuid; + profile_base.user_id = user_id; if (Settings::values.username.size() > profile_base.username.size()) { std::copy_n(Settings::values.username.begin(), profile_base.username.size(), profile_base.username.begin()); @@ -72,7 +72,7 @@ private: // TODO(Subv): Retrieve this information from somewhere. ProfileBase profile_base{}; - profile_base.user_id = user_id.uuid; + profile_base.user_id = user_id; if (Settings::values.username.size() > profile_base.username.size()) { std::copy_n(Settings::values.username.begin(), profile_base.username.size(), profile_base.username.begin()); @@ -122,17 +122,20 @@ private: }; void Module::Interface::GetUserCount(Kernel::HLERequestContext& ctx) { - LOG_WARNING(Service_ACC, "(STUBBED) called"); + LOG_INFO(Service_ACC, "called"); IPC::ResponseBuilder rb{ctx, 3}; rb.Push(RESULT_SUCCESS); - rb.Push(1); + rb.Push(static_cast(profile_manager->GetUserCount())); } void Module::Interface::GetUserExistence(Kernel::HLERequestContext& ctx) { - LOG_WARNING(Service_ACC, "(STUBBED) called"); + IPC::RequestParser rp{ctx}; + UUID user_id = rp.PopRaw(); + LOG_INFO(Service_ACC, "called user_id={}", user_id.Format()); + IPC::ResponseBuilder rb{ctx, 3}; rb.Push(RESULT_SUCCESS); - rb.Push(true); // TODO: Check when this is supposed to return true and when not + rb.Push(profile_manager->UserExists(user_id)); } void Module::Interface::ListAllUsers(Kernel::HLERequestContext& ctx) { -- cgit v1.2.3 From 03d7faf58390216729eb828b08be7e5f0ef82727 Mon Sep 17 00:00:00 2001 From: David Marcec Date: Wed, 8 Aug 2018 23:41:12 +1000 Subject: GetProfileBase and GetProfileBaseAndData added --- src/core/hle/service/acc/acc.cpp | 77 ++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 43 deletions(-) (limited to 'src/core/hle/service/acc/acc.cpp') diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp index 8efaf6171..92141f61c 100644 --- a/src/core/hle/service/acc/acc.cpp +++ b/src/core/hle/service/acc/acc.cpp @@ -27,19 +27,13 @@ struct UserData { }; static_assert(sizeof(UserData) == 0x80, "UserData structure has incorrect size"); -struct ProfileBase { - UUID user_id; - u64 timestamp; - std::array username; -}; -static_assert(sizeof(ProfileBase) == 0x38, "ProfileBase structure has incorrect size"); - // TODO(ogniK): Generate a real user id based on username, md5(username) maybe? static UUID DEFAULT_USER_ID{1ull, 0ull}; class IProfile final : public ServiceFramework { public: - explicit IProfile(UUID user_id) : ServiceFramework("IProfile"), user_id(user_id) { + explicit IProfile(UUID user_id, ProfileManager& profile_manager) + : ServiceFramework("IProfile"), user_id(user_id), profile_manager(profile_manager) { static const FunctionInfo functions[] = { {0, &IProfile::Get, "Get"}, {1, &IProfile::GetBase, "GetBase"}, @@ -51,40 +45,41 @@ public: private: void Get(Kernel::HLERequestContext& ctx) { - LOG_WARNING(Service_ACC, "(STUBBED) called"); + LOG_INFO(Service_ACC, "called user_id={}", user_id.Format()); ProfileBase profile_base{}; - profile_base.user_id = user_id; - if (Settings::values.username.size() > profile_base.username.size()) { + std::array data{}; + /*if (Settings::values.username.size() > profile_base.username.size()) { std::copy_n(Settings::values.username.begin(), profile_base.username.size(), profile_base.username.begin()); } else { std::copy(Settings::values.username.begin(), Settings::values.username.end(), profile_base.username.begin()); + }*/ + if (profile_manager.GetProfileBaseAndData(user_id, profile_base, data)) { + ctx.WriteBuffer(data); + IPC::ResponseBuilder rb{ctx, 16}; + rb.Push(RESULT_SUCCESS); + rb.PushRaw(profile_base); + } else { + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultCode(-1)); // TODO(ogniK): Get actual error code } - - IPC::ResponseBuilder rb{ctx, 16}; - rb.Push(RESULT_SUCCESS); - rb.PushRaw(profile_base); } void GetBase(Kernel::HLERequestContext& ctx) { - LOG_WARNING(Service_ACC, "(STUBBED) called"); - - // TODO(Subv): Retrieve this information from somewhere. + LOG_INFO(Service_ACC, "called user_id={}", user_id.Format()); ProfileBase profile_base{}; - profile_base.user_id = user_id; - if (Settings::values.username.size() > profile_base.username.size()) { - std::copy_n(Settings::values.username.begin(), profile_base.username.size(), - profile_base.username.begin()); + if (profile_manager.GetProfileBase(user_id, profile_base)) { + IPC::ResponseBuilder rb{ctx, 16}; + rb.Push(RESULT_SUCCESS); + rb.PushRaw(profile_base); } else { - std::copy(Settings::values.username.begin(), Settings::values.username.end(), - profile_base.username.begin()); + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultCode(-1)); // TODO(ogniK): Get actual error code } - IPC::ResponseBuilder rb{ctx, 16}; - rb.Push(RESULT_SUCCESS); - rb.PushRaw(profile_base); } + ProfileManager& profile_manager; UUID user_id; ///< The user id this profile refers to. }; @@ -139,29 +134,32 @@ void Module::Interface::GetUserExistence(Kernel::HLERequestContext& ctx) { } void Module::Interface::ListAllUsers(Kernel::HLERequestContext& ctx) { - LOG_WARNING(Service_ACC, "(STUBBED) called"); - // TODO(Subv): There is only one user for now. - const std::vector user_ids = {DEFAULT_USER_ID}; - ctx.WriteBuffer(user_ids); + LOG_INFO(Service_ACC, "called"); + ctx.WriteBuffer(profile_manager->GetAllUsers()); IPC::ResponseBuilder rb{ctx, 2}; rb.Push(RESULT_SUCCESS); } void Module::Interface::ListOpenUsers(Kernel::HLERequestContext& ctx) { - LOG_WARNING(Service_ACC, "(STUBBED) called"); - // TODO(Subv): There is only one user for now. - const std::vector user_ids = {DEFAULT_USER_ID}; - ctx.WriteBuffer(user_ids); + LOG_INFO(Service_ACC, "called"); + ctx.WriteBuffer(profile_manager->GetOpenUsers()); IPC::ResponseBuilder rb{ctx, 2}; rb.Push(RESULT_SUCCESS); } +void Module::Interface::GetLastOpenedUser(Kernel::HLERequestContext& ctx) { + LOG_INFO(Service_ACC, "called"); + IPC::ResponseBuilder rb{ctx, 6}; + rb.Push(RESULT_SUCCESS); + rb.PushRaw(profile_manager->GetLastOpennedUser()); +} + void Module::Interface::GetProfile(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; UUID user_id = rp.PopRaw(); IPC::ResponseBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); - rb.PushIpcInterface(user_id); + rb.PushIpcInterface(user_id, *profile_manager); LOG_DEBUG(Service_ACC, "called user_id={}", user_id.Format()); } @@ -178,13 +176,6 @@ void Module::Interface::GetBaasAccountManagerForApplication(Kernel::HLERequestCo LOG_DEBUG(Service_ACC, "called"); } -void Module::Interface::GetLastOpenedUser(Kernel::HLERequestContext& ctx) { - LOG_WARNING(Service_ACC, "(STUBBED) called"); - IPC::ResponseBuilder rb{ctx, 6}; - rb.Push(RESULT_SUCCESS); - rb.PushRaw(DEFAULT_USER_ID); -} - Module::Interface::Interface(std::shared_ptr module, const char* name) : ServiceFramework(name), module(std::move(module)) {} -- cgit v1.2.3 From 75169c75708d9f54297537b387182bee10ada9ab Mon Sep 17 00:00:00 2001 From: David Marcec Date: Thu, 9 Aug 2018 01:09:12 +1000 Subject: Inital pass of account backend implementation This commit verified working on puyo --- src/core/hle/service/acc/acc.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/core/hle/service/acc/acc.cpp') diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp index 92141f61c..7c62d99f6 100644 --- a/src/core/hle/service/acc/acc.cpp +++ b/src/core/hle/service/acc/acc.cpp @@ -48,13 +48,6 @@ private: LOG_INFO(Service_ACC, "called user_id={}", user_id.Format()); ProfileBase profile_base{}; std::array data{}; - /*if (Settings::values.username.size() > profile_base.username.size()) { - std::copy_n(Settings::values.username.begin(), profile_base.username.size(), - profile_base.username.begin()); - } else { - std::copy(Settings::values.username.begin(), Settings::values.username.end(), - profile_base.username.begin()); - }*/ if (profile_manager.GetProfileBaseAndData(user_id, profile_base, data)) { ctx.WriteBuffer(data); IPC::ResponseBuilder rb{ctx, 16}; @@ -177,7 +170,9 @@ void Module::Interface::GetBaasAccountManagerForApplication(Kernel::HLERequestCo } Module::Interface::Interface(std::shared_ptr module, const char* name) - : ServiceFramework(name), module(std::move(module)) {} + : ServiceFramework(name), module(std::move(module)) { + profile_manager = std::make_unique(); +} void InstallInterfaces(SM::ServiceManager& service_manager) { auto module = std::make_shared(); -- cgit v1.2.3 From 2a3b335b156552515e28f62df2617d06c241a29a Mon Sep 17 00:00:00 2001 From: David Marcec Date: Sat, 11 Aug 2018 10:33:11 +1000 Subject: Added IsUserRegistrationRequestPermitted --- src/core/hle/service/acc/acc.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/core/hle/service/acc/acc.cpp') diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp index 7c62d99f6..0a6cac5b7 100644 --- a/src/core/hle/service/acc/acc.cpp +++ b/src/core/hle/service/acc/acc.cpp @@ -156,6 +156,13 @@ void Module::Interface::GetProfile(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_ACC, "called user_id={}", user_id.Format()); } +void Module::Interface::IsUserRegistrationRequestPermitted(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service_ACC, "(STUBBED) called"); + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(RESULT_SUCCESS); + rb.Push(profile_manager->CanSystemRegisterUser()); +} + void Module::Interface::InitializeApplicationInfo(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_ACC, "(STUBBED) called"); IPC::ResponseBuilder rb{ctx, 2}; -- cgit v1.2.3 From 6aa8ee6943f6ae8b0ed1770b91355b36c2618a4c Mon Sep 17 00:00:00 2001 From: David Marcec Date: Sat, 11 Aug 2018 13:17:06 +1000 Subject: Refactored profile manager sharing --- src/core/hle/service/acc/acc.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/core/hle/service/acc/acc.cpp') diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp index e74379a24..22e44368a 100644 --- a/src/core/hle/service/acc/acc.cpp +++ b/src/core/hle/service/acc/acc.cpp @@ -197,17 +197,18 @@ void Module::Interface::GetBaasAccountManagerForApplication(Kernel::HLERequestCo LOG_DEBUG(Service_ACC, "called"); } -Module::Interface::Interface(std::shared_ptr module, const char* name) - : ServiceFramework(name), module(std::move(module)) { - profile_manager = std::make_unique(); -} +Module::Interface::Interface(std::shared_ptr module, + std::shared_ptr profile_manager, const char* name) + : ServiceFramework(name), module(std::move(module)), + profile_manager(std::make_shared(*profile_manager)) {} void InstallInterfaces(SM::ServiceManager& service_manager) { auto module = std::make_shared(); - std::make_shared(module)->InstallAsService(service_manager); - std::make_shared(module)->InstallAsService(service_manager); - std::make_shared(module)->InstallAsService(service_manager); - std::make_shared(module)->InstallAsService(service_manager); + auto profile_manager = std::make_shared(); + std::make_shared(module, profile_manager)->InstallAsService(service_manager); + std::make_shared(module, profile_manager)->InstallAsService(service_manager); + std::make_shared(module, profile_manager)->InstallAsService(service_manager); + std::make_shared(module, profile_manager)->InstallAsService(service_manager); } } // namespace Service::Account -- cgit v1.2.3 From 82fa0bcea7c0231742716f7c79255eb107d4a933 Mon Sep 17 00:00:00 2001 From: David Marcec Date: Sat, 11 Aug 2018 16:47:33 +1000 Subject: First round of account changes --- src/core/hle/service/acc/acc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/hle/service/acc/acc.cpp') diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp index 22e44368a..9a7c3b9f4 100644 --- a/src/core/hle/service/acc/acc.cpp +++ b/src/core/hle/service/acc/acc.cpp @@ -165,7 +165,7 @@ void Module::Interface::GetLastOpenedUser(Kernel::HLERequestContext& ctx) { LOG_INFO(Service_ACC, "called"); IPC::ResponseBuilder rb{ctx, 6}; rb.Push(RESULT_SUCCESS); - rb.PushRaw(profile_manager->GetLastOpennedUser()); + rb.PushRaw(profile_manager->GetLastOpenedUser()); } void Module::Interface::GetProfile(Kernel::HLERequestContext& ctx) { -- cgit v1.2.3 From c3013c7c9c4498ea0fc0d50dfe674fdff4c0e1c3 Mon Sep 17 00:00:00 2001 From: David Marcec Date: Sat, 11 Aug 2018 20:06:06 +1000 Subject: Added missing ListAllUsers count --- src/core/hle/service/acc/acc.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/core/hle/service/acc/acc.cpp') diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp index 9a7c3b9f4..9a377e86d 100644 --- a/src/core/hle/service/acc/acc.cpp +++ b/src/core/hle/service/acc/acc.cpp @@ -150,8 +150,9 @@ void Module::Interface::GetUserExistence(Kernel::HLERequestContext& ctx) { void Module::Interface::ListAllUsers(Kernel::HLERequestContext& ctx) { LOG_INFO(Service_ACC, "called"); ctx.WriteBuffer(profile_manager->GetAllUsers()); - IPC::ResponseBuilder rb{ctx, 2}; + IPC::ResponseBuilder rb{ctx, 3}; rb.Push(RESULT_SUCCESS); + rb.Push(static_cast(profile_manager->GetUserCount())); } void Module::Interface::ListOpenUsers(Kernel::HLERequestContext& ctx) { -- cgit v1.2.3 From b8e70faa2df59086f04ad1d128c742ea23037dc3 Mon Sep 17 00:00:00 2001 From: David Marcec Date: Sat, 11 Aug 2018 20:45:06 +1000 Subject: Added GetOpenUserCount --- src/core/hle/service/acc/acc.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/core/hle/service/acc/acc.cpp') diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp index 9a377e86d..c9ab8311e 100644 --- a/src/core/hle/service/acc/acc.cpp +++ b/src/core/hle/service/acc/acc.cpp @@ -158,8 +158,9 @@ void Module::Interface::ListAllUsers(Kernel::HLERequestContext& ctx) { void Module::Interface::ListOpenUsers(Kernel::HLERequestContext& ctx) { LOG_INFO(Service_ACC, "called"); ctx.WriteBuffer(profile_manager->GetOpenUsers()); - IPC::ResponseBuilder rb{ctx, 2}; + IPC::ResponseBuilder rb{ctx, 3}; rb.Push(RESULT_SUCCESS); + rb.Push(static_cast(profile_manager->GetOpenUserCount())); } void Module::Interface::GetLastOpenedUser(Kernel::HLERequestContext& ctx) { -- cgit v1.2.3 From 0b6f8ba51e61792ea23a55394a963d0961a9906f Mon Sep 17 00:00:00 2001 From: David Marcec Date: Sun, 12 Aug 2018 01:34:22 +1000 Subject: Code cleanup for profile manager --- src/core/hle/service/acc/acc.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/core/hle/service/acc/acc.cpp') diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp index c9ab8311e..b94dda9ea 100644 --- a/src/core/hle/service/acc/acc.cpp +++ b/src/core/hle/service/acc/acc.cpp @@ -54,6 +54,8 @@ private: rb.Push(RESULT_SUCCESS); rb.PushRaw(profile_base); } else { + LOG_ERROR(Service_ACC, "Failed to get profile base and data for user={}", + user_id.Format()); IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ResultCode(-1)); // TODO(ogniK): Get actual error code } @@ -67,6 +69,7 @@ private: rb.Push(RESULT_SUCCESS); rb.PushRaw(profile_base); } else { + LOG_ERROR(Service_ACC, "Failed to get profile base for user={}", user_id.Format()); IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ResultCode(-1)); // TODO(ogniK): Get actual error code } @@ -93,7 +96,7 @@ private: rb.Push(jpeg_size); } - ProfileManager& profile_manager; + const ProfileManager& profile_manager; UUID user_id; ///< The user id this profile refers to. }; @@ -202,7 +205,7 @@ void Module::Interface::GetBaasAccountManagerForApplication(Kernel::HLERequestCo Module::Interface::Interface(std::shared_ptr module, std::shared_ptr profile_manager, const char* name) : ServiceFramework(name), module(std::move(module)), - profile_manager(std::make_shared(*profile_manager)) {} + profile_manager(std::move(profile_manager)) {} void InstallInterfaces(SM::ServiceManager& service_manager) { auto module = std::make_shared(); -- cgit v1.2.3 From 448290bee43b49d7502269b185938d6e8c1aca03 Mon Sep 17 00:00:00 2001 From: David Marcec Date: Sun, 12 Aug 2018 02:11:04 +1000 Subject: Removed un-needed count from ListOpenUsers and ListAllUsers --- src/core/hle/service/acc/acc.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/core/hle/service/acc/acc.cpp') diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp index b94dda9ea..979f2f892 100644 --- a/src/core/hle/service/acc/acc.cpp +++ b/src/core/hle/service/acc/acc.cpp @@ -153,17 +153,15 @@ void Module::Interface::GetUserExistence(Kernel::HLERequestContext& ctx) { void Module::Interface::ListAllUsers(Kernel::HLERequestContext& ctx) { LOG_INFO(Service_ACC, "called"); ctx.WriteBuffer(profile_manager->GetAllUsers()); - IPC::ResponseBuilder rb{ctx, 3}; + IPC::ResponseBuilder rb{ctx, 2}; rb.Push(RESULT_SUCCESS); - rb.Push(static_cast(profile_manager->GetUserCount())); } void Module::Interface::ListOpenUsers(Kernel::HLERequestContext& ctx) { LOG_INFO(Service_ACC, "called"); ctx.WriteBuffer(profile_manager->GetOpenUsers()); - IPC::ResponseBuilder rb{ctx, 3}; + IPC::ResponseBuilder rb{ctx, 2}; rb.Push(RESULT_SUCCESS); - rb.Push(static_cast(profile_manager->GetOpenUserCount())); } void Module::Interface::GetLastOpenedUser(Kernel::HLERequestContext& ctx) { -- cgit v1.2.3