diff options
| author | 2020-05-03 23:15:03 -0400 | |
|---|---|---|
| committer | 2020-05-03 23:15:03 -0400 | |
| commit | 29fce1a1872909f7200a3b727adcc3dfb71013a1 (patch) | |
| tree | 66cc98f31a0c4f36f6e77059b943c26d1ac6b984 | |
| parent | settings: Add anisotropic filtering level to the yuzu configuration log (#3875) (diff) | |
| parent | acc: Return a unique value per account for GetAccountId (diff) | |
| download | yuzu-29fce1a1872909f7200a3b727adcc3dfb71013a1.tar.gz yuzu-29fce1a1872909f7200a3b727adcc3dfb71013a1.tar.xz yuzu-29fce1a1872909f7200a3b727adcc3dfb71013a1.zip | |
Merge pull request #3822 from ogniK5377/GetAccountId
acc: Return a unique value per account for GetAccountId
Diffstat (limited to '')
| -rw-r--r-- | src/common/uuid.h | 5 | ||||
| -rw-r--r-- | src/core/hle/service/acc/acc.cpp | 13 |
2 files changed, 13 insertions, 5 deletions
diff --git a/src/common/uuid.h b/src/common/uuid.h index f6ad064fb..4d3af8cec 100644 --- a/src/common/uuid.h +++ b/src/common/uuid.h | |||
| @@ -40,6 +40,11 @@ struct UUID { | |||
| 40 | uuid = INVALID_UUID; | 40 | uuid = INVALID_UUID; |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | // TODO(ogniK): Properly generate a Nintendo ID | ||
| 44 | constexpr u64 GetNintendoID() const { | ||
| 45 | return uuid[0]; | ||
| 46 | } | ||
| 47 | |||
| 43 | std::string Format() const; | 48 | std::string Format() const; |
| 44 | std::string FormatSwitch() const; | 49 | std::string FormatSwitch() const; |
| 45 | }; | 50 | }; |
diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp index 9a7992f58..630a8b048 100644 --- a/src/core/hle/service/acc/acc.cpp +++ b/src/core/hle/service/acc/acc.cpp | |||
| @@ -228,7 +228,8 @@ public: | |||
| 228 | 228 | ||
| 229 | class IManagerForApplication final : public ServiceFramework<IManagerForApplication> { | 229 | class IManagerForApplication final : public ServiceFramework<IManagerForApplication> { |
| 230 | public: | 230 | public: |
| 231 | IManagerForApplication() : ServiceFramework("IManagerForApplication") { | 231 | explicit IManagerForApplication(Common::UUID user_id) |
| 232 | : ServiceFramework("IManagerForApplication"), user_id(user_id) { | ||
| 232 | // clang-format off | 233 | // clang-format off |
| 233 | static const FunctionInfo functions[] = { | 234 | static const FunctionInfo functions[] = { |
| 234 | {0, &IManagerForApplication::CheckAvailability, "CheckAvailability"}, | 235 | {0, &IManagerForApplication::CheckAvailability, "CheckAvailability"}, |
| @@ -254,12 +255,14 @@ private: | |||
| 254 | } | 255 | } |
| 255 | 256 | ||
| 256 | void GetAccountId(Kernel::HLERequestContext& ctx) { | 257 | void GetAccountId(Kernel::HLERequestContext& ctx) { |
| 257 | LOG_WARNING(Service_ACC, "(STUBBED) called"); | 258 | LOG_DEBUG(Service_ACC, "called"); |
| 258 | // Should return a nintendo account ID | 259 | |
| 259 | IPC::ResponseBuilder rb{ctx, 4}; | 260 | IPC::ResponseBuilder rb{ctx, 4}; |
| 260 | rb.Push(RESULT_SUCCESS); | 261 | rb.Push(RESULT_SUCCESS); |
| 261 | rb.PushRaw<u64>(1); | 262 | rb.PushRaw<u64>(user_id.GetNintendoID()); |
| 262 | } | 263 | } |
| 264 | |||
| 265 | Common::UUID user_id; | ||
| 263 | }; | 266 | }; |
| 264 | 267 | ||
| 265 | void Module::Interface::GetUserCount(Kernel::HLERequestContext& ctx) { | 268 | void Module::Interface::GetUserCount(Kernel::HLERequestContext& ctx) { |
| @@ -382,7 +385,7 @@ void Module::Interface::GetBaasAccountManagerForApplication(Kernel::HLERequestCo | |||
| 382 | LOG_DEBUG(Service_ACC, "called"); | 385 | LOG_DEBUG(Service_ACC, "called"); |
| 383 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 386 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 384 | rb.Push(RESULT_SUCCESS); | 387 | rb.Push(RESULT_SUCCESS); |
| 385 | rb.PushIpcInterface<IManagerForApplication>(); | 388 | rb.PushIpcInterface<IManagerForApplication>(profile_manager->GetLastOpenedUser()); |
| 386 | } | 389 | } |
| 387 | 390 | ||
| 388 | void Module::Interface::IsUserAccountSwitchLocked(Kernel::HLERequestContext& ctx) { | 391 | void Module::Interface::IsUserAccountSwitchLocked(Kernel::HLERequestContext& ctx) { |