diff options
| author | 2022-02-05 12:29:09 -0500 | |
|---|---|---|
| committer | 2022-02-05 13:56:21 -0500 | |
| commit | dfe11d72e3eb14dee718b7fa67a673514d199f20 (patch) | |
| tree | f21885d513c2df4bb409e17016e0996815e37569 /src/core/hle/service/am | |
| parent | common: uuid: Add AsU128() (diff) | |
| download | yuzu-dfe11d72e3eb14dee718b7fa67a673514d199f20.tar.gz yuzu-dfe11d72e3eb14dee718b7fa67a673514d199f20.tar.xz yuzu-dfe11d72e3eb14dee718b7fa67a673514d199f20.zip | |
profile: Migrate to the new UUID implementation
Diffstat (limited to 'src/core/hle/service/am')
| -rw-r--r-- | src/core/hle/service/am/am.cpp | 6 | ||||
| -rw-r--r-- | src/core/hle/service/am/applets/applet_profile_select.cpp | 9 | ||||
| -rw-r--r-- | src/core/hle/service/am/applets/applet_profile_select.h | 6 |
3 files changed, 11 insertions, 10 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index e60661fe1..4cdc029b7 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp | |||
| @@ -55,7 +55,7 @@ constexpr u32 LAUNCH_PARAMETER_ACCOUNT_PRESELECTED_USER_MAGIC = 0xC79497CA; | |||
| 55 | struct LaunchParameterAccountPreselectedUser { | 55 | struct LaunchParameterAccountPreselectedUser { |
| 56 | u32_le magic; | 56 | u32_le magic; |
| 57 | u32_le is_account_selected; | 57 | u32_le is_account_selected; |
| 58 | u128 current_user; | 58 | Common::NewUUID current_user; |
| 59 | INSERT_PADDING_BYTES(0x70); | 59 | INSERT_PADDING_BYTES(0x70); |
| 60 | }; | 60 | }; |
| 61 | static_assert(sizeof(LaunchParameterAccountPreselectedUser) == 0x88); | 61 | static_assert(sizeof(LaunchParameterAccountPreselectedUser) == 0x88); |
| @@ -1453,8 +1453,8 @@ void IApplicationFunctions::PopLaunchParameter(Kernel::HLERequestContext& ctx) { | |||
| 1453 | 1453 | ||
| 1454 | Account::ProfileManager profile_manager{}; | 1454 | Account::ProfileManager profile_manager{}; |
| 1455 | const auto uuid = profile_manager.GetUser(static_cast<s32>(Settings::values.current_user)); | 1455 | const auto uuid = profile_manager.GetUser(static_cast<s32>(Settings::values.current_user)); |
| 1456 | ASSERT(uuid); | 1456 | ASSERT(uuid.has_value() && uuid->IsValid()); |
| 1457 | params.current_user = uuid->uuid; | 1457 | params.current_user = *uuid; |
| 1458 | 1458 | ||
| 1459 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 1459 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 1460 | 1460 | ||
diff --git a/src/core/hle/service/am/applets/applet_profile_select.cpp b/src/core/hle/service/am/applets/applet_profile_select.cpp index a6e891944..3ac32fa58 100644 --- a/src/core/hle/service/am/applets/applet_profile_select.cpp +++ b/src/core/hle/service/am/applets/applet_profile_select.cpp | |||
| @@ -54,19 +54,20 @@ void ProfileSelect::Execute() { | |||
| 54 | return; | 54 | return; |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | frontend.SelectProfile([this](std::optional<Common::UUID> uuid) { SelectionComplete(uuid); }); | 57 | frontend.SelectProfile( |
| 58 | [this](std::optional<Common::NewUUID> uuid) { SelectionComplete(uuid); }); | ||
| 58 | } | 59 | } |
| 59 | 60 | ||
| 60 | void ProfileSelect::SelectionComplete(std::optional<Common::UUID> uuid) { | 61 | void ProfileSelect::SelectionComplete(std::optional<Common::NewUUID> uuid) { |
| 61 | UserSelectionOutput output{}; | 62 | UserSelectionOutput output{}; |
| 62 | 63 | ||
| 63 | if (uuid.has_value() && uuid->IsValid()) { | 64 | if (uuid.has_value() && uuid->IsValid()) { |
| 64 | output.result = 0; | 65 | output.result = 0; |
| 65 | output.uuid_selected = uuid->uuid; | 66 | output.uuid_selected = *uuid; |
| 66 | } else { | 67 | } else { |
| 67 | status = ERR_USER_CANCELLED_SELECTION; | 68 | status = ERR_USER_CANCELLED_SELECTION; |
| 68 | output.result = ERR_USER_CANCELLED_SELECTION.raw; | 69 | output.result = ERR_USER_CANCELLED_SELECTION.raw; |
| 69 | output.uuid_selected = Common::INVALID_UUID; | 70 | output.uuid_selected = Common::InvalidUUID; |
| 70 | } | 71 | } |
| 71 | 72 | ||
| 72 | final_data = std::vector<u8>(sizeof(UserSelectionOutput)); | 73 | final_data = std::vector<u8>(sizeof(UserSelectionOutput)); |
diff --git a/src/core/hle/service/am/applets/applet_profile_select.h b/src/core/hle/service/am/applets/applet_profile_select.h index 8fb76e6c4..c5c506c41 100644 --- a/src/core/hle/service/am/applets/applet_profile_select.h +++ b/src/core/hle/service/am/applets/applet_profile_select.h | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | #include <vector> | 7 | #include <vector> |
| 8 | 8 | ||
| 9 | #include "common/common_funcs.h" | 9 | #include "common/common_funcs.h" |
| 10 | #include "common/uuid.h" | 10 | #include "common/new_uuid.h" |
| 11 | #include "core/hle/result.h" | 11 | #include "core/hle/result.h" |
| 12 | #include "core/hle/service/am/applets/applets.h" | 12 | #include "core/hle/service/am/applets/applets.h" |
| 13 | 13 | ||
| @@ -27,7 +27,7 @@ static_assert(sizeof(UserSelectionConfig) == 0xA0, "UserSelectionConfig has inco | |||
| 27 | 27 | ||
| 28 | struct UserSelectionOutput { | 28 | struct UserSelectionOutput { |
| 29 | u64 result; | 29 | u64 result; |
| 30 | u128 uuid_selected; | 30 | Common::NewUUID uuid_selected; |
| 31 | }; | 31 | }; |
| 32 | static_assert(sizeof(UserSelectionOutput) == 0x18, "UserSelectionOutput has incorrect size."); | 32 | static_assert(sizeof(UserSelectionOutput) == 0x18, "UserSelectionOutput has incorrect size."); |
| 33 | 33 | ||
| @@ -44,7 +44,7 @@ public: | |||
| 44 | void ExecuteInteractive() override; | 44 | void ExecuteInteractive() override; |
| 45 | void Execute() override; | 45 | void Execute() override; |
| 46 | 46 | ||
| 47 | void SelectionComplete(std::optional<Common::UUID> uuid); | 47 | void SelectionComplete(std::optional<Common::NewUUID> uuid); |
| 48 | 48 | ||
| 49 | private: | 49 | private: |
| 50 | const Core::Frontend::ProfileSelectApplet& frontend; | 50 | const Core::Frontend::ProfileSelectApplet& frontend; |