summaryrefslogtreecommitdiff
path: root/src/core/hle/service/acc
diff options
context:
space:
mode:
authorGravatar Morph2022-02-05 12:35:39 -0500
committerGravatar Morph2022-02-05 13:56:21 -0500
commit25db62ce1534cbd8b93b4284869229e4bd7de54d (patch)
treedd74d3fc6ba14a0de5e88778cad5b5c65fcba248 /src/core/hle/service/acc
parentprofile: Migrate to the new UUID implementation (diff)
downloadyuzu-25db62ce1534cbd8b93b4284869229e4bd7de54d.tar.gz
yuzu-25db62ce1534cbd8b93b4284869229e4bd7de54d.tar.xz
yuzu-25db62ce1534cbd8b93b4284869229e4bd7de54d.zip
general: Rename NewUUID to UUID, and remove the previous UUID impl
This completes the removal of the old UUID implementation.
Diffstat (limited to 'src/core/hle/service/acc')
-rw-r--r--src/core/hle/service/acc/acc.cpp57
-rw-r--r--src/core/hle/service/acc/acc.h4
-rw-r--r--src/core/hle/service/acc/profile_manager.cpp40
-rw-r--r--src/core/hle/service/acc/profile_manager.h36
4 files changed, 68 insertions, 69 deletions
diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp
index 6abb7dbc4..e34ef5a78 100644
--- a/src/core/hle/service/acc/acc.cpp
+++ b/src/core/hle/service/acc/acc.cpp
@@ -39,7 +39,7 @@ constexpr ResultCode ERR_FAILED_SAVE_DATA{ErrorModule::Account, 100};
39// Thumbnails are hard coded to be at least this size 39// Thumbnails are hard coded to be at least this size
40constexpr std::size_t THUMBNAIL_SIZE = 0x24000; 40constexpr std::size_t THUMBNAIL_SIZE = 0x24000;
41 41
42static std::filesystem::path GetImagePath(const Common::NewUUID& uuid) { 42static std::filesystem::path GetImagePath(const Common::UUID& uuid) {
43 return Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / 43 return Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) /
44 fmt::format("system/save/8000000000000010/su/avators/{}.jpg", uuid.FormattedString()); 44 fmt::format("system/save/8000000000000010/su/avators/{}.jpg", uuid.FormattedString());
45} 45}
@@ -51,7 +51,7 @@ static constexpr u32 SanitizeJPEGSize(std::size_t size) {
51 51
52class IManagerForSystemService final : public ServiceFramework<IManagerForSystemService> { 52class IManagerForSystemService final : public ServiceFramework<IManagerForSystemService> {
53public: 53public:
54 explicit IManagerForSystemService(Core::System& system_, Common::NewUUID) 54 explicit IManagerForSystemService(Core::System& system_, Common::UUID)
55 : ServiceFramework{system_, "IManagerForSystemService"} { 55 : ServiceFramework{system_, "IManagerForSystemService"} {
56 // clang-format off 56 // clang-format off
57 static const FunctionInfo functions[] = { 57 static const FunctionInfo functions[] = {
@@ -87,7 +87,7 @@ public:
87// 3.0.0+ 87// 3.0.0+
88class IFloatingRegistrationRequest final : public ServiceFramework<IFloatingRegistrationRequest> { 88class IFloatingRegistrationRequest final : public ServiceFramework<IFloatingRegistrationRequest> {
89public: 89public:
90 explicit IFloatingRegistrationRequest(Core::System& system_, Common::NewUUID) 90 explicit IFloatingRegistrationRequest(Core::System& system_, Common::UUID)
91 : ServiceFramework{system_, "IFloatingRegistrationRequest"} { 91 : ServiceFramework{system_, "IFloatingRegistrationRequest"} {
92 // clang-format off 92 // clang-format off
93 static const FunctionInfo functions[] = { 93 static const FunctionInfo functions[] = {
@@ -112,7 +112,7 @@ public:
112 112
113class IAdministrator final : public ServiceFramework<IAdministrator> { 113class IAdministrator final : public ServiceFramework<IAdministrator> {
114public: 114public:
115 explicit IAdministrator(Core::System& system_, Common::NewUUID) 115 explicit IAdministrator(Core::System& system_, Common::UUID)
116 : ServiceFramework{system_, "IAdministrator"} { 116 : ServiceFramework{system_, "IAdministrator"} {
117 // clang-format off 117 // clang-format off
118 static const FunctionInfo functions[] = { 118 static const FunctionInfo functions[] = {
@@ -170,7 +170,7 @@ public:
170 170
171class IAuthorizationRequest final : public ServiceFramework<IAuthorizationRequest> { 171class IAuthorizationRequest final : public ServiceFramework<IAuthorizationRequest> {
172public: 172public:
173 explicit IAuthorizationRequest(Core::System& system_, Common::NewUUID) 173 explicit IAuthorizationRequest(Core::System& system_, Common::UUID)
174 : ServiceFramework{system_, "IAuthorizationRequest"} { 174 : ServiceFramework{system_, "IAuthorizationRequest"} {
175 // clang-format off 175 // clang-format off
176 static const FunctionInfo functions[] = { 176 static const FunctionInfo functions[] = {
@@ -189,7 +189,7 @@ public:
189 189
190class IOAuthProcedure final : public ServiceFramework<IOAuthProcedure> { 190class IOAuthProcedure final : public ServiceFramework<IOAuthProcedure> {
191public: 191public:
192 explicit IOAuthProcedure(Core::System& system_, Common::NewUUID) 192 explicit IOAuthProcedure(Core::System& system_, Common::UUID)
193 : ServiceFramework{system_, "IOAuthProcedure"} { 193 : ServiceFramework{system_, "IOAuthProcedure"} {
194 // clang-format off 194 // clang-format off
195 static const FunctionInfo functions[] = { 195 static const FunctionInfo functions[] = {
@@ -208,7 +208,7 @@ public:
208// 3.0.0+ 208// 3.0.0+
209class IOAuthProcedureForExternalNsa final : public ServiceFramework<IOAuthProcedureForExternalNsa> { 209class IOAuthProcedureForExternalNsa final : public ServiceFramework<IOAuthProcedureForExternalNsa> {
210public: 210public:
211 explicit IOAuthProcedureForExternalNsa(Core::System& system_, Common::NewUUID) 211 explicit IOAuthProcedureForExternalNsa(Core::System& system_, Common::UUID)
212 : ServiceFramework{system_, "IOAuthProcedureForExternalNsa"} { 212 : ServiceFramework{system_, "IOAuthProcedureForExternalNsa"} {
213 // clang-format off 213 // clang-format off
214 static const FunctionInfo functions[] = { 214 static const FunctionInfo functions[] = {
@@ -231,7 +231,7 @@ public:
231class IOAuthProcedureForNintendoAccountLinkage final 231class IOAuthProcedureForNintendoAccountLinkage final
232 : public ServiceFramework<IOAuthProcedureForNintendoAccountLinkage> { 232 : public ServiceFramework<IOAuthProcedureForNintendoAccountLinkage> {
233public: 233public:
234 explicit IOAuthProcedureForNintendoAccountLinkage(Core::System& system_, Common::NewUUID) 234 explicit IOAuthProcedureForNintendoAccountLinkage(Core::System& system_, Common::UUID)
235 : ServiceFramework{system_, "IOAuthProcedureForNintendoAccountLinkage"} { 235 : ServiceFramework{system_, "IOAuthProcedureForNintendoAccountLinkage"} {
236 // clang-format off 236 // clang-format off
237 static const FunctionInfo functions[] = { 237 static const FunctionInfo functions[] = {
@@ -252,7 +252,7 @@ public:
252 252
253class INotifier final : public ServiceFramework<INotifier> { 253class INotifier final : public ServiceFramework<INotifier> {
254public: 254public:
255 explicit INotifier(Core::System& system_, Common::NewUUID) 255 explicit INotifier(Core::System& system_, Common::UUID)
256 : ServiceFramework{system_, "INotifier"} { 256 : ServiceFramework{system_, "INotifier"} {
257 // clang-format off 257 // clang-format off
258 static const FunctionInfo functions[] = { 258 static const FunctionInfo functions[] = {
@@ -267,7 +267,7 @@ public:
267class IProfileCommon : public ServiceFramework<IProfileCommon> { 267class IProfileCommon : public ServiceFramework<IProfileCommon> {
268public: 268public:
269 explicit IProfileCommon(Core::System& system_, const char* name, bool editor_commands, 269 explicit IProfileCommon(Core::System& system_, const char* name, bool editor_commands,
270 Common::NewUUID user_id_, ProfileManager& profile_manager_) 270 Common::UUID user_id_, ProfileManager& profile_manager_)
271 : ServiceFramework{system_, name}, profile_manager{profile_manager_}, user_id{user_id_} { 271 : ServiceFramework{system_, name}, profile_manager{profile_manager_}, user_id{user_id_} {
272 static const FunctionInfo functions[] = { 272 static const FunctionInfo functions[] = {
273 {0, &IProfileCommon::Get, "Get"}, 273 {0, &IProfileCommon::Get, "Get"},
@@ -435,26 +435,26 @@ protected:
435 } 435 }
436 436
437 ProfileManager& profile_manager; 437 ProfileManager& profile_manager;
438 Common::NewUUID user_id{}; ///< The user id this profile refers to. 438 Common::UUID user_id{}; ///< The user id this profile refers to.
439}; 439};
440 440
441class IProfile final : public IProfileCommon { 441class IProfile final : public IProfileCommon {
442public: 442public:
443 explicit IProfile(Core::System& system_, Common::NewUUID user_id_, 443 explicit IProfile(Core::System& system_, Common::UUID user_id_,
444 ProfileManager& profile_manager_) 444 ProfileManager& profile_manager_)
445 : IProfileCommon{system_, "IProfile", false, user_id_, profile_manager_} {} 445 : IProfileCommon{system_, "IProfile", false, user_id_, profile_manager_} {}
446}; 446};
447 447
448class IProfileEditor final : public IProfileCommon { 448class IProfileEditor final : public IProfileCommon {
449public: 449public:
450 explicit IProfileEditor(Core::System& system_, Common::NewUUID user_id_, 450 explicit IProfileEditor(Core::System& system_, Common::UUID user_id_,
451 ProfileManager& profile_manager_) 451 ProfileManager& profile_manager_)
452 : IProfileCommon{system_, "IProfileEditor", true, user_id_, profile_manager_} {} 452 : IProfileCommon{system_, "IProfileEditor", true, user_id_, profile_manager_} {}
453}; 453};
454 454
455class ISessionObject final : public ServiceFramework<ISessionObject> { 455class ISessionObject final : public ServiceFramework<ISessionObject> {
456public: 456public:
457 explicit ISessionObject(Core::System& system_, Common::NewUUID) 457 explicit ISessionObject(Core::System& system_, Common::UUID)
458 : ServiceFramework{system_, "ISessionObject"} { 458 : ServiceFramework{system_, "ISessionObject"} {
459 // clang-format off 459 // clang-format off
460 static const FunctionInfo functions[] = { 460 static const FunctionInfo functions[] = {
@@ -468,7 +468,7 @@ public:
468 468
469class IGuestLoginRequest final : public ServiceFramework<IGuestLoginRequest> { 469class IGuestLoginRequest final : public ServiceFramework<IGuestLoginRequest> {
470public: 470public:
471 explicit IGuestLoginRequest(Core::System& system_, Common::NewUUID) 471 explicit IGuestLoginRequest(Core::System& system_, Common::UUID)
472 : ServiceFramework{system_, "IGuestLoginRequest"} { 472 : ServiceFramework{system_, "IGuestLoginRequest"} {
473 // clang-format off 473 // clang-format off
474 static const FunctionInfo functions[] = { 474 static const FunctionInfo functions[] = {
@@ -514,7 +514,7 @@ protected:
514 514
515class IManagerForApplication final : public ServiceFramework<IManagerForApplication> { 515class IManagerForApplication final : public ServiceFramework<IManagerForApplication> {
516public: 516public:
517 explicit IManagerForApplication(Core::System& system_, Common::NewUUID user_id_) 517 explicit IManagerForApplication(Core::System& system_, Common::UUID user_id_)
518 : ServiceFramework{system_, "IManagerForApplication"}, 518 : ServiceFramework{system_, "IManagerForApplication"},
519 ensure_token_id{std::make_shared<EnsureTokenIdCacheAsyncInterface>(system)}, 519 ensure_token_id{std::make_shared<EnsureTokenIdCacheAsyncInterface>(system)},
520 user_id{user_id_} { 520 user_id{user_id_} {
@@ -587,14 +587,14 @@ private:
587 } 587 }
588 588
589 std::shared_ptr<EnsureTokenIdCacheAsyncInterface> ensure_token_id{}; 589 std::shared_ptr<EnsureTokenIdCacheAsyncInterface> ensure_token_id{};
590 Common::NewUUID user_id{}; 590 Common::UUID user_id{};
591}; 591};
592 592
593// 6.0.0+ 593// 6.0.0+
594class IAsyncNetworkServiceLicenseKindContext final 594class IAsyncNetworkServiceLicenseKindContext final
595 : public ServiceFramework<IAsyncNetworkServiceLicenseKindContext> { 595 : public ServiceFramework<IAsyncNetworkServiceLicenseKindContext> {
596public: 596public:
597 explicit IAsyncNetworkServiceLicenseKindContext(Core::System& system_, Common::NewUUID) 597 explicit IAsyncNetworkServiceLicenseKindContext(Core::System& system_, Common::UUID)
598 : ServiceFramework{system_, "IAsyncNetworkServiceLicenseKindContext"} { 598 : ServiceFramework{system_, "IAsyncNetworkServiceLicenseKindContext"} {
599 // clang-format off 599 // clang-format off
600 static const FunctionInfo functions[] = { 600 static const FunctionInfo functions[] = {
@@ -614,7 +614,7 @@ public:
614class IOAuthProcedureForUserRegistration final 614class IOAuthProcedureForUserRegistration final
615 : public ServiceFramework<IOAuthProcedureForUserRegistration> { 615 : public ServiceFramework<IOAuthProcedureForUserRegistration> {
616public: 616public:
617 explicit IOAuthProcedureForUserRegistration(Core::System& system_, Common::NewUUID) 617 explicit IOAuthProcedureForUserRegistration(Core::System& system_, Common::UUID)
618 : ServiceFramework{system_, "IOAuthProcedureForUserRegistration"} { 618 : ServiceFramework{system_, "IOAuthProcedureForUserRegistration"} {
619 // clang-format off 619 // clang-format off
620 static const FunctionInfo functions[] = { 620 static const FunctionInfo functions[] = {
@@ -638,8 +638,7 @@ public:
638 638
639class DAUTH_O final : public ServiceFramework<DAUTH_O> { 639class DAUTH_O final : public ServiceFramework<DAUTH_O> {
640public: 640public:
641 explicit DAUTH_O(Core::System& system_, Common::NewUUID) 641 explicit DAUTH_O(Core::System& system_, Common::UUID) : ServiceFramework{system_, "dauth:o"} {
642 : ServiceFramework{system_, "dauth:o"} {
643 // clang-format off 642 // clang-format off
644 static const FunctionInfo functions[] = { 643 static const FunctionInfo functions[] = {
645 {0, nullptr, "EnsureAuthenticationTokenCacheAsync"}, 644 {0, nullptr, "EnsureAuthenticationTokenCacheAsync"},
@@ -663,7 +662,7 @@ public:
663// 6.0.0+ 662// 6.0.0+
664class IAsyncResult final : public ServiceFramework<IAsyncResult> { 663class IAsyncResult final : public ServiceFramework<IAsyncResult> {
665public: 664public:
666 explicit IAsyncResult(Core::System& system_, Common::NewUUID) 665 explicit IAsyncResult(Core::System& system_, Common::UUID)
667 : ServiceFramework{system_, "IAsyncResult"} { 666 : ServiceFramework{system_, "IAsyncResult"} {
668 // clang-format off 667 // clang-format off
669 static const FunctionInfo functions[] = { 668 static const FunctionInfo functions[] = {
@@ -687,7 +686,7 @@ void Module::Interface::GetUserCount(Kernel::HLERequestContext& ctx) {
687 686
688void Module::Interface::GetUserExistence(Kernel::HLERequestContext& ctx) { 687void Module::Interface::GetUserExistence(Kernel::HLERequestContext& ctx) {
689 IPC::RequestParser rp{ctx}; 688 IPC::RequestParser rp{ctx};
690 Common::NewUUID user_id = rp.PopRaw<Common::NewUUID>(); 689 Common::UUID user_id = rp.PopRaw<Common::UUID>();
691 LOG_DEBUG(Service_ACC, "called user_id=0x{}", user_id.RawString()); 690 LOG_DEBUG(Service_ACC, "called user_id=0x{}", user_id.RawString());
692 691
693 IPC::ResponseBuilder rb{ctx, 3}; 692 IPC::ResponseBuilder rb{ctx, 3};
@@ -713,12 +712,12 @@ void Module::Interface::GetLastOpenedUser(Kernel::HLERequestContext& ctx) {
713 LOG_DEBUG(Service_ACC, "called"); 712 LOG_DEBUG(Service_ACC, "called");
714 IPC::ResponseBuilder rb{ctx, 6}; 713 IPC::ResponseBuilder rb{ctx, 6};
715 rb.Push(ResultSuccess); 714 rb.Push(ResultSuccess);
716 rb.PushRaw<Common::NewUUID>(profile_manager->GetLastOpenedUser()); 715 rb.PushRaw<Common::UUID>(profile_manager->GetLastOpenedUser());
717} 716}
718 717
719void Module::Interface::GetProfile(Kernel::HLERequestContext& ctx) { 718void Module::Interface::GetProfile(Kernel::HLERequestContext& ctx) {
720 IPC::RequestParser rp{ctx}; 719 IPC::RequestParser rp{ctx};
721 Common::NewUUID user_id = rp.PopRaw<Common::NewUUID>(); 720 Common::UUID user_id = rp.PopRaw<Common::UUID>();
722 LOG_DEBUG(Service_ACC, "called user_id=0x{}", user_id.RawString()); 721 LOG_DEBUG(Service_ACC, "called user_id=0x{}", user_id.RawString());
723 722
724 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 723 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
@@ -832,7 +831,7 @@ void Module::Interface::InitializeApplicationInfoV2(Kernel::HLERequestContext& c
832 831
833void Module::Interface::GetProfileEditor(Kernel::HLERequestContext& ctx) { 832void Module::Interface::GetProfileEditor(Kernel::HLERequestContext& ctx) {
834 IPC::RequestParser rp{ctx}; 833 IPC::RequestParser rp{ctx};
835 Common::NewUUID user_id = rp.PopRaw<Common::NewUUID>(); 834 Common::UUID user_id = rp.PopRaw<Common::UUID>();
836 835
837 LOG_DEBUG(Service_ACC, "called, user_id=0x{}", user_id.RawString()); 836 LOG_DEBUG(Service_ACC, "called, user_id=0x{}", user_id.RawString());
838 837
@@ -874,7 +873,7 @@ void Module::Interface::ListOpenContextStoredUsers(Kernel::HLERequestContext& ct
874 873
875void Module::Interface::StoreSaveDataThumbnailApplication(Kernel::HLERequestContext& ctx) { 874void Module::Interface::StoreSaveDataThumbnailApplication(Kernel::HLERequestContext& ctx) {
876 IPC::RequestParser rp{ctx}; 875 IPC::RequestParser rp{ctx};
877 const auto uuid = rp.PopRaw<Common::NewUUID>(); 876 const auto uuid = rp.PopRaw<Common::UUID>();
878 877
879 LOG_WARNING(Service_ACC, "(STUBBED) called, uuid=0x{}", uuid.RawString()); 878 LOG_WARNING(Service_ACC, "(STUBBED) called, uuid=0x{}", uuid.RawString());
880 879
@@ -887,7 +886,7 @@ void Module::Interface::StoreSaveDataThumbnailApplication(Kernel::HLERequestCont
887 886
888void Module::Interface::StoreSaveDataThumbnailSystem(Kernel::HLERequestContext& ctx) { 887void Module::Interface::StoreSaveDataThumbnailSystem(Kernel::HLERequestContext& ctx) {
889 IPC::RequestParser rp{ctx}; 888 IPC::RequestParser rp{ctx};
890 const auto uuid = rp.PopRaw<Common::NewUUID>(); 889 const auto uuid = rp.PopRaw<Common::UUID>();
891 const auto tid = rp.Pop<u64_le>(); 890 const auto tid = rp.Pop<u64_le>();
892 891
893 LOG_WARNING(Service_ACC, "(STUBBED) called, uuid=0x{}, tid={:016X}", uuid.RawString(), tid); 892 LOG_WARNING(Service_ACC, "(STUBBED) called, uuid=0x{}, tid={:016X}", uuid.RawString(), tid);
@@ -895,7 +894,7 @@ void Module::Interface::StoreSaveDataThumbnailSystem(Kernel::HLERequestContext&
895} 894}
896 895
897void Module::Interface::StoreSaveDataThumbnail(Kernel::HLERequestContext& ctx, 896void Module::Interface::StoreSaveDataThumbnail(Kernel::HLERequestContext& ctx,
898 const Common::NewUUID& uuid, const u64 tid) { 897 const Common::UUID& uuid, const u64 tid) {
899 IPC::ResponseBuilder rb{ctx, 2}; 898 IPC::ResponseBuilder rb{ctx, 2};
900 899
901 if (tid == 0) { 900 if (tid == 0) {
diff --git a/src/core/hle/service/acc/acc.h b/src/core/hle/service/acc/acc.h
index b57342701..f7e9bc4f8 100644
--- a/src/core/hle/service/acc/acc.h
+++ b/src/core/hle/service/acc/acc.h
@@ -4,7 +4,7 @@
4 4
5#pragma once 5#pragma once
6 6
7#include "common/new_uuid.h" 7#include "common/uuid.h"
8#include "core/hle/service/glue/glue_manager.h" 8#include "core/hle/service/glue/glue_manager.h"
9#include "core/hle/service/service.h" 9#include "core/hle/service/service.h"
10 10
@@ -43,7 +43,7 @@ public:
43 43
44 private: 44 private:
45 ResultCode InitializeApplicationInfoBase(); 45 ResultCode InitializeApplicationInfoBase();
46 void StoreSaveDataThumbnail(Kernel::HLERequestContext& ctx, const Common::NewUUID& uuid, 46 void StoreSaveDataThumbnail(Kernel::HLERequestContext& ctx, const Common::UUID& uuid,
47 const u64 tid); 47 const u64 tid);
48 48
49 enum class ApplicationType : u32_le { 49 enum class ApplicationType : u32_le {
diff --git a/src/core/hle/service/acc/profile_manager.cpp b/src/core/hle/service/acc/profile_manager.cpp
index 366f3fe14..fba847142 100644
--- a/src/core/hle/service/acc/profile_manager.cpp
+++ b/src/core/hle/service/acc/profile_manager.cpp
@@ -16,11 +16,11 @@
16namespace Service::Account { 16namespace Service::Account {
17 17
18namespace FS = Common::FS; 18namespace FS = Common::FS;
19using Common::NewUUID; 19using Common::UUID;
20 20
21struct UserRaw { 21struct UserRaw {
22 NewUUID uuid{}; 22 UUID uuid{};
23 NewUUID uuid2{}; 23 UUID uuid2{};
24 u64 timestamp{}; 24 u64 timestamp{};
25 ProfileUsername username{}; 25 ProfileUsername username{};
26 ProfileData extra_data{}; 26 ProfileData extra_data{};
@@ -45,7 +45,7 @@ ProfileManager::ProfileManager() {
45 45
46 // Create an user if none are present 46 // Create an user if none are present
47 if (user_count == 0) { 47 if (user_count == 0) {
48 CreateNewUser(NewUUID::MakeRandom(), "yuzu"); 48 CreateNewUser(UUID::MakeRandom(), "yuzu");
49 } 49 }
50 50
51 auto current = 51 auto current =
@@ -97,7 +97,7 @@ ResultCode ProfileManager::AddUser(const ProfileInfo& user) {
97 97
98/// Create a new user on the system. If the uuid of the user already exists, the user is not 98/// Create a new user on the system. If the uuid of the user already exists, the user is not
99/// created. 99/// created.
100ResultCode ProfileManager::CreateNewUser(NewUUID uuid, const ProfileUsername& username) { 100ResultCode ProfileManager::CreateNewUser(UUID uuid, const ProfileUsername& username) {
101 if (user_count == MAX_USERS) { 101 if (user_count == MAX_USERS) {
102 return ERROR_TOO_MANY_USERS; 102 return ERROR_TOO_MANY_USERS;
103 } 103 }
@@ -124,7 +124,7 @@ ResultCode ProfileManager::CreateNewUser(NewUUID uuid, const ProfileUsername& us
124/// Creates a new user on the system. This function allows a much simpler method of registration 124/// Creates a new user on the system. This function allows a much simpler method of registration
125/// specifically by allowing an std::string for the username. This is required specifically since 125/// specifically by allowing an std::string for the username. This is required specifically since
126/// we're loading a string straight from the config 126/// we're loading a string straight from the config
127ResultCode ProfileManager::CreateNewUser(NewUUID uuid, const std::string& username) { 127ResultCode ProfileManager::CreateNewUser(UUID uuid, const std::string& username) {
128 ProfileUsername username_output{}; 128 ProfileUsername username_output{};
129 129
130 if (username.size() > username_output.size()) { 130 if (username.size() > username_output.size()) {
@@ -135,7 +135,7 @@ ResultCode ProfileManager::CreateNewUser(NewUUID uuid, const std::string& userna
135 return CreateNewUser(uuid, username_output); 135 return CreateNewUser(uuid, username_output);
136} 136}
137 137
138std::optional<NewUUID> ProfileManager::GetUser(std::size_t index) const { 138std::optional<UUID> ProfileManager::GetUser(std::size_t index) const {
139 if (index >= MAX_USERS) { 139 if (index >= MAX_USERS) {
140 return std::nullopt; 140 return std::nullopt;
141 } 141 }
@@ -144,7 +144,7 @@ std::optional<NewUUID> ProfileManager::GetUser(std::size_t index) const {
144} 144}
145 145
146/// Returns a users profile index based on their user id. 146/// Returns a users profile index based on their user id.
147std::optional<std::size_t> ProfileManager::GetUserIndex(const NewUUID& uuid) const { 147std::optional<std::size_t> ProfileManager::GetUserIndex(const UUID& uuid) const {
148 if (uuid.IsInvalid()) { 148 if (uuid.IsInvalid()) {
149 return std::nullopt; 149 return std::nullopt;
150 } 150 }
@@ -176,7 +176,7 @@ bool ProfileManager::GetProfileBase(std::optional<std::size_t> index, ProfileBas
176} 176}
177 177
178/// Returns the data structure used by the switch when GetProfileBase is called on acc:* 178/// Returns the data structure used by the switch when GetProfileBase is called on acc:*
179bool ProfileManager::GetProfileBase(NewUUID uuid, ProfileBase& profile) const { 179bool ProfileManager::GetProfileBase(UUID uuid, ProfileBase& profile) const {
180 const auto idx = GetUserIndex(uuid); 180 const auto idx = GetUserIndex(uuid);
181 return GetProfileBase(idx, profile); 181 return GetProfileBase(idx, profile);
182} 182}
@@ -203,7 +203,7 @@ std::size_t ProfileManager::GetOpenUserCount() const {
203} 203}
204 204
205/// Checks if a user id exists in our profile manager 205/// Checks if a user id exists in our profile manager
206bool ProfileManager::UserExists(NewUUID uuid) const { 206bool ProfileManager::UserExists(UUID uuid) const {
207 return GetUserIndex(uuid).has_value(); 207 return GetUserIndex(uuid).has_value();
208} 208}
209 209
@@ -215,7 +215,7 @@ bool ProfileManager::UserExistsIndex(std::size_t index) const {
215} 215}
216 216
217/// Opens a specific user 217/// Opens a specific user
218void ProfileManager::OpenUser(NewUUID uuid) { 218void ProfileManager::OpenUser(UUID uuid) {
219 const auto idx = GetUserIndex(uuid); 219 const auto idx = GetUserIndex(uuid);
220 if (!idx) { 220 if (!idx) {
221 return; 221 return;
@@ -226,7 +226,7 @@ void ProfileManager::OpenUser(NewUUID uuid) {
226} 226}
227 227
228/// Closes a specific user 228/// Closes a specific user
229void ProfileManager::CloseUser(NewUUID uuid) { 229void ProfileManager::CloseUser(UUID uuid) {
230 const auto idx = GetUserIndex(uuid); 230 const auto idx = GetUserIndex(uuid);
231 if (!idx) { 231 if (!idx) {
232 return; 232 return;
@@ -253,12 +253,12 @@ UserIDArray ProfileManager::GetOpenUsers() const {
253 return Common::InvalidUUID; 253 return Common::InvalidUUID;
254 }); 254 });
255 std::stable_partition(output.begin(), output.end(), 255 std::stable_partition(output.begin(), output.end(),
256 [](const NewUUID& uuid) { return uuid.IsValid(); }); 256 [](const UUID& uuid) { return uuid.IsValid(); });
257 return output; 257 return output;
258} 258}
259 259
260/// Returns the last user which was opened 260/// Returns the last user which was opened
261NewUUID ProfileManager::GetLastOpenedUser() const { 261UUID ProfileManager::GetLastOpenedUser() const {
262 return last_opened_user; 262 return last_opened_user;
263} 263}
264 264
@@ -273,7 +273,7 @@ bool ProfileManager::GetProfileBaseAndData(std::optional<std::size_t> index, Pro
273} 273}
274 274
275/// Return the users profile base and the unknown arbitary data. 275/// Return the users profile base and the unknown arbitary data.
276bool ProfileManager::GetProfileBaseAndData(NewUUID uuid, ProfileBase& profile, 276bool ProfileManager::GetProfileBaseAndData(UUID uuid, ProfileBase& profile,
277 ProfileData& data) const { 277 ProfileData& data) const {
278 const auto idx = GetUserIndex(uuid); 278 const auto idx = GetUserIndex(uuid);
279 return GetProfileBaseAndData(idx, profile, data); 279 return GetProfileBaseAndData(idx, profile, data);
@@ -292,7 +292,7 @@ bool ProfileManager::CanSystemRegisterUser() const {
292 // emulate qlaunch. Update this to dynamically change. 292 // emulate qlaunch. Update this to dynamically change.
293} 293}
294 294
295bool ProfileManager::RemoveUser(NewUUID uuid) { 295bool ProfileManager::RemoveUser(UUID uuid) {
296 const auto index = GetUserIndex(uuid); 296 const auto index = GetUserIndex(uuid);
297 if (!index) { 297 if (!index) {
298 return false; 298 return false;
@@ -304,7 +304,7 @@ bool ProfileManager::RemoveUser(NewUUID uuid) {
304 return true; 304 return true;
305} 305}
306 306
307bool ProfileManager::SetProfileBase(NewUUID uuid, const ProfileBase& profile_new) { 307bool ProfileManager::SetProfileBase(UUID uuid, const ProfileBase& profile_new) {
308 const auto index = GetUserIndex(uuid); 308 const auto index = GetUserIndex(uuid);
309 if (!index || profile_new.user_uuid.IsInvalid()) { 309 if (!index || profile_new.user_uuid.IsInvalid()) {
310 return false; 310 return false;
@@ -318,7 +318,7 @@ bool ProfileManager::SetProfileBase(NewUUID uuid, const ProfileBase& profile_new
318 return true; 318 return true;
319} 319}
320 320
321bool ProfileManager::SetProfileBaseAndData(Common::NewUUID uuid, const ProfileBase& profile_new, 321bool ProfileManager::SetProfileBaseAndData(Common::UUID uuid, const ProfileBase& profile_new,
322 const ProfileData& data_new) { 322 const ProfileData& data_new) {
323 const auto index = GetUserIndex(uuid); 323 const auto index = GetUserIndex(uuid);
324 if (index.has_value() && SetProfileBase(uuid, profile_new)) { 324 if (index.has_value() && SetProfileBase(uuid, profile_new)) {
@@ -336,14 +336,14 @@ void ProfileManager::ParseUserSaveFile() {
336 336
337 if (!save.IsOpen()) { 337 if (!save.IsOpen()) {
338 LOG_WARNING(Service_ACC, "Failed to load profile data from save data... Generating new " 338 LOG_WARNING(Service_ACC, "Failed to load profile data from save data... Generating new "
339 "user 'yuzu' with random NewUUID."); 339 "user 'yuzu' with random UUID.");
340 return; 340 return;
341 } 341 }
342 342
343 ProfileDataRaw data; 343 ProfileDataRaw data;
344 if (!save.ReadObject(data)) { 344 if (!save.ReadObject(data)) {
345 LOG_WARNING(Service_ACC, "profiles.dat is smaller than expected... Generating new user " 345 LOG_WARNING(Service_ACC, "profiles.dat is smaller than expected... Generating new user "
346 "'yuzu' with random NewUUID."); 346 "'yuzu' with random UUID.");
347 return; 347 return;
348 } 348 }
349 349
diff --git a/src/core/hle/service/acc/profile_manager.h b/src/core/hle/service/acc/profile_manager.h
index e9c58a826..17347f7ef 100644
--- a/src/core/hle/service/acc/profile_manager.h
+++ b/src/core/hle/service/acc/profile_manager.h
@@ -8,8 +8,8 @@
8#include <optional> 8#include <optional>
9 9
10#include "common/common_types.h" 10#include "common/common_types.h"
11#include "common/new_uuid.h"
12#include "common/swap.h" 11#include "common/swap.h"
12#include "common/uuid.h"
13#include "core/hle/result.h" 13#include "core/hle/result.h"
14 14
15namespace Service::Account { 15namespace Service::Account {
@@ -18,7 +18,7 @@ constexpr std::size_t MAX_USERS{8};
18constexpr std::size_t profile_username_size{32}; 18constexpr std::size_t profile_username_size{32};
19 19
20using ProfileUsername = std::array<u8, profile_username_size>; 20using ProfileUsername = std::array<u8, profile_username_size>;
21using UserIDArray = std::array<Common::NewUUID, MAX_USERS>; 21using UserIDArray = std::array<Common::UUID, MAX_USERS>;
22 22
23/// Contains extra data related to a user. 23/// Contains extra data related to a user.
24/// TODO: RE this structure 24/// TODO: RE this structure
@@ -35,7 +35,7 @@ static_assert(sizeof(ProfileData) == 0x80, "ProfileData structure has incorrect
35/// This holds general information about a users profile. This is where we store all the information 35/// This holds general information about a users profile. This is where we store all the information
36/// based on a specific user 36/// based on a specific user
37struct ProfileInfo { 37struct ProfileInfo {
38 Common::NewUUID user_uuid{}; 38 Common::UUID user_uuid{};
39 ProfileUsername username{}; 39 ProfileUsername username{};
40 u64 creation_time{}; 40 u64 creation_time{};
41 ProfileData data{}; // TODO(ognik): Work out what this is 41 ProfileData data{}; // TODO(ognik): Work out what this is
@@ -43,7 +43,7 @@ struct ProfileInfo {
43}; 43};
44 44
45struct ProfileBase { 45struct ProfileBase {
46 Common::NewUUID user_uuid; 46 Common::UUID user_uuid;
47 u64_le timestamp; 47 u64_le timestamp;
48 ProfileUsername username; 48 ProfileUsername username;
49 49
@@ -65,34 +65,34 @@ public:
65 ~ProfileManager(); 65 ~ProfileManager();
66 66
67 ResultCode AddUser(const ProfileInfo& user); 67 ResultCode AddUser(const ProfileInfo& user);
68 ResultCode CreateNewUser(Common::NewUUID uuid, const ProfileUsername& username); 68 ResultCode CreateNewUser(Common::UUID uuid, const ProfileUsername& username);
69 ResultCode CreateNewUser(Common::NewUUID uuid, const std::string& username); 69 ResultCode CreateNewUser(Common::UUID uuid, const std::string& username);
70 std::optional<Common::NewUUID> GetUser(std::size_t index) const; 70 std::optional<Common::UUID> GetUser(std::size_t index) const;
71 std::optional<std::size_t> GetUserIndex(const Common::NewUUID& uuid) const; 71 std::optional<std::size_t> GetUserIndex(const Common::UUID& uuid) const;
72 std::optional<std::size_t> GetUserIndex(const ProfileInfo& user) const; 72 std::optional<std::size_t> GetUserIndex(const ProfileInfo& user) const;
73 bool GetProfileBase(std::optional<std::size_t> index, ProfileBase& profile) const; 73 bool GetProfileBase(std::optional<std::size_t> index, ProfileBase& profile) const;
74 bool GetProfileBase(Common::NewUUID uuid, ProfileBase& profile) const; 74 bool GetProfileBase(Common::UUID uuid, ProfileBase& profile) const;
75 bool GetProfileBase(const ProfileInfo& user, ProfileBase& profile) const; 75 bool GetProfileBase(const ProfileInfo& user, ProfileBase& profile) const;
76 bool GetProfileBaseAndData(std::optional<std::size_t> index, ProfileBase& profile, 76 bool GetProfileBaseAndData(std::optional<std::size_t> index, ProfileBase& profile,
77 ProfileData& data) const; 77 ProfileData& data) const;
78 bool GetProfileBaseAndData(Common::NewUUID uuid, ProfileBase& profile, ProfileData& data) const; 78 bool GetProfileBaseAndData(Common::UUID uuid, ProfileBase& profile, ProfileData& data) const;
79 bool GetProfileBaseAndData(const ProfileInfo& user, ProfileBase& profile, 79 bool GetProfileBaseAndData(const ProfileInfo& user, ProfileBase& profile,
80 ProfileData& data) const; 80 ProfileData& data) const;
81 std::size_t GetUserCount() const; 81 std::size_t GetUserCount() const;
82 std::size_t GetOpenUserCount() const; 82 std::size_t GetOpenUserCount() const;
83 bool UserExists(Common::NewUUID uuid) const; 83 bool UserExists(Common::UUID uuid) const;
84 bool UserExistsIndex(std::size_t index) const; 84 bool UserExistsIndex(std::size_t index) const;
85 void OpenUser(Common::NewUUID uuid); 85 void OpenUser(Common::UUID uuid);
86 void CloseUser(Common::NewUUID uuid); 86 void CloseUser(Common::UUID uuid);
87 UserIDArray GetOpenUsers() const; 87 UserIDArray GetOpenUsers() const;
88 UserIDArray GetAllUsers() const; 88 UserIDArray GetAllUsers() const;
89 Common::NewUUID GetLastOpenedUser() const; 89 Common::UUID GetLastOpenedUser() const;
90 90
91 bool CanSystemRegisterUser() const; 91 bool CanSystemRegisterUser() const;
92 92
93 bool RemoveUser(Common::NewUUID uuid); 93 bool RemoveUser(Common::UUID uuid);
94 bool SetProfileBase(Common::NewUUID uuid, const ProfileBase& profile_new); 94 bool SetProfileBase(Common::UUID uuid, const ProfileBase& profile_new);
95 bool SetProfileBaseAndData(Common::NewUUID uuid, const ProfileBase& profile_new, 95 bool SetProfileBaseAndData(Common::UUID uuid, const ProfileBase& profile_new,
96 const ProfileData& data_new); 96 const ProfileData& data_new);
97 97
98private: 98private:
@@ -103,7 +103,7 @@ private:
103 103
104 std::array<ProfileInfo, MAX_USERS> profiles{}; 104 std::array<ProfileInfo, MAX_USERS> profiles{};
105 std::size_t user_count{}; 105 std::size_t user_count{};
106 Common::NewUUID last_opened_user{}; 106 Common::UUID last_opened_user{};
107}; 107};
108 108
109}; // namespace Service::Account 109}; // namespace Service::Account