Browse Source
Merge pull request #1655 from ogniK5377/shantae
Implement acc:TrySelectUserWithoutInteraction
pull/15/merge
bunnei
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with
26 additions and
3 deletions
-
src/core/hle/service/acc/acc.cpp
-
src/core/hle/service/acc/acc.h
-
src/core/hle/service/acc/acc_su.cpp
-
src/core/hle/service/acc/acc_u0.cpp
-
src/core/hle/service/acc/acc_u1.cpp
|
|
|
@ -242,6 +242,28 @@ void Module::Interface::GetBaasAccountManagerForApplication(Kernel::HLERequestCo |
|
|
|
LOG_DEBUG(Service_ACC, "called"); |
|
|
|
} |
|
|
|
|
|
|
|
void Module::Interface::TrySelectUserWithoutInteraction(Kernel::HLERequestContext& ctx) { |
|
|
|
LOG_DEBUG(Service_ACC, "called"); |
|
|
|
// A u8 is passed into this function which we can safely ignore. It's to determine if we have
|
|
|
|
// access to use the network or not by the looks of it
|
|
|
|
IPC::ResponseBuilder rb{ctx, 6}; |
|
|
|
if (profile_manager->GetUserCount() != 1) { |
|
|
|
rb.Push(RESULT_SUCCESS); |
|
|
|
rb.PushRaw<u128>(INVALID_UUID); |
|
|
|
return; |
|
|
|
} |
|
|
|
auto user_list = profile_manager->GetAllUsers(); |
|
|
|
if (user_list.empty()) { |
|
|
|
rb.Push(ResultCode(-1)); // TODO(ogniK): Find the correct error code
|
|
|
|
rb.PushRaw<u128>(INVALID_UUID); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
// Select the first user we have
|
|
|
|
rb.Push(RESULT_SUCCESS); |
|
|
|
rb.PushRaw<u128>(profile_manager->GetUser(0)->uuid); |
|
|
|
} |
|
|
|
|
|
|
|
Module::Interface::Interface(std::shared_ptr<Module> module, |
|
|
|
std::shared_ptr<ProfileManager> profile_manager, const char* name) |
|
|
|
: ServiceFramework(name), module(std::move(module)), |
|
|
|
|
|
|
|
@ -27,6 +27,7 @@ public: |
|
|
|
void InitializeApplicationInfo(Kernel::HLERequestContext& ctx); |
|
|
|
void GetBaasAccountManagerForApplication(Kernel::HLERequestContext& ctx); |
|
|
|
void IsUserRegistrationRequestPermitted(Kernel::HLERequestContext& ctx); |
|
|
|
void TrySelectUserWithoutInteraction(Kernel::HLERequestContext& ctx); |
|
|
|
|
|
|
|
protected: |
|
|
|
std::shared_ptr<Module> module; |
|
|
|
|
|
|
|
@ -17,7 +17,7 @@ ACC_SU::ACC_SU(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> p |
|
|
|
{5, &ACC_SU::GetProfile, "GetProfile"}, |
|
|
|
{6, nullptr, "GetProfileDigest"}, |
|
|
|
{50, &ACC_SU::IsUserRegistrationRequestPermitted, "IsUserRegistrationRequestPermitted"}, |
|
|
|
{51, nullptr, "TrySelectUserWithoutInteraction"}, |
|
|
|
{51, &ACC_SU::TrySelectUserWithoutInteraction, "TrySelectUserWithoutInteraction"}, |
|
|
|
{60, nullptr, "ListOpenContextStoredUsers"}, |
|
|
|
{100, nullptr, "GetUserRegistrationNotifier"}, |
|
|
|
{101, nullptr, "GetUserStateChangeNotifier"}, |
|
|
|
|
|
|
|
@ -17,7 +17,7 @@ ACC_U0::ACC_U0(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> p |
|
|
|
{5, &ACC_U0::GetProfile, "GetProfile"}, |
|
|
|
{6, nullptr, "GetProfileDigest"}, |
|
|
|
{50, &ACC_U0::IsUserRegistrationRequestPermitted, "IsUserRegistrationRequestPermitted"}, |
|
|
|
{51, nullptr, "TrySelectUserWithoutInteraction"}, |
|
|
|
{51, &ACC_U0::TrySelectUserWithoutInteraction, "TrySelectUserWithoutInteraction"}, |
|
|
|
{60, nullptr, "ListOpenContextStoredUsers"}, |
|
|
|
{100, &ACC_U0::InitializeApplicationInfo, "InitializeApplicationInfo"}, |
|
|
|
{101, &ACC_U0::GetBaasAccountManagerForApplication, "GetBaasAccountManagerForApplication"}, |
|
|
|
|
|
|
|
@ -17,7 +17,7 @@ ACC_U1::ACC_U1(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> p |
|
|
|
{5, &ACC_U1::GetProfile, "GetProfile"}, |
|
|
|
{6, nullptr, "GetProfileDigest"}, |
|
|
|
{50, &ACC_U1::IsUserRegistrationRequestPermitted, "IsUserRegistrationRequestPermitted"}, |
|
|
|
{51, nullptr, "TrySelectUserWithoutInteraction"}, |
|
|
|
{51, &ACC_U1::TrySelectUserWithoutInteraction, "TrySelectUserWithoutInteraction"}, |
|
|
|
{60, nullptr, "ListOpenContextStoredUsers"}, |
|
|
|
{100, nullptr, "GetUserRegistrationNotifier"}, |
|
|
|
{101, nullptr, "GetUserStateChangeNotifier"}, |
|
|
|
|