diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/frontend/applets/profile_select.cpp | 5 | ||||
| -rw-r--r-- | src/core/frontend/applets/profile_select.h | 7 | ||||
| -rw-r--r-- | src/core/hle/service/acc/acc.cpp | 93 | ||||
| -rw-r--r-- | src/core/hle/service/acc/acc.h | 4 | ||||
| -rw-r--r-- | src/core/hle/service/acc/profile_manager.cpp | 51 | ||||
| -rw-r--r-- | src/core/hle/service/acc/profile_manager.h | 38 | ||||
| -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 | ||||
| -rw-r--r-- | src/yuzu/applets/qt_profile_select.cpp | 14 | ||||
| -rw-r--r-- | src/yuzu/applets/qt_profile_select.h | 7 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_profile_manager.cpp | 14 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu/main.h | 2 |
14 files changed, 131 insertions, 127 deletions
diff --git a/src/core/frontend/applets/profile_select.cpp b/src/core/frontend/applets/profile_select.cpp index 3e4f90be2..a7ff2ccf9 100644 --- a/src/core/frontend/applets/profile_select.cpp +++ b/src/core/frontend/applets/profile_select.cpp | |||
| @@ -11,10 +11,9 @@ namespace Core::Frontend { | |||
| 11 | ProfileSelectApplet::~ProfileSelectApplet() = default; | 11 | ProfileSelectApplet::~ProfileSelectApplet() = default; |
| 12 | 12 | ||
| 13 | void DefaultProfileSelectApplet::SelectProfile( | 13 | void DefaultProfileSelectApplet::SelectProfile( |
| 14 | std::function<void(std::optional<Common::UUID>)> callback) const { | 14 | std::function<void(std::optional<Common::NewUUID>)> callback) const { |
| 15 | Service::Account::ProfileManager manager; | 15 | Service::Account::ProfileManager manager; |
| 16 | callback(manager.GetUser(Settings::values.current_user.GetValue()) | 16 | callback(manager.GetUser(Settings::values.current_user.GetValue()).value_or(Common::NewUUID{})); |
| 17 | .value_or(Common::UUID{Common::INVALID_UUID})); | ||
| 18 | LOG_INFO(Service_ACC, "called, selecting current user instead of prompting..."); | 17 | LOG_INFO(Service_ACC, "called, selecting current user instead of prompting..."); |
| 19 | } | 18 | } |
| 20 | 19 | ||
diff --git a/src/core/frontend/applets/profile_select.h b/src/core/frontend/applets/profile_select.h index 3506b9885..5b2346e72 100644 --- a/src/core/frontend/applets/profile_select.h +++ b/src/core/frontend/applets/profile_select.h | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | #include <functional> | 7 | #include <functional> |
| 8 | #include <optional> | 8 | #include <optional> |
| 9 | #include "common/uuid.h" | 9 | #include "common/new_uuid.h" |
| 10 | 10 | ||
| 11 | namespace Core::Frontend { | 11 | namespace Core::Frontend { |
| 12 | 12 | ||
| @@ -14,12 +14,13 @@ class ProfileSelectApplet { | |||
| 14 | public: | 14 | public: |
| 15 | virtual ~ProfileSelectApplet(); | 15 | virtual ~ProfileSelectApplet(); |
| 16 | 16 | ||
| 17 | virtual void SelectProfile(std::function<void(std::optional<Common::UUID>)> callback) const = 0; | 17 | virtual void SelectProfile( |
| 18 | std::function<void(std::optional<Common::NewUUID>)> callback) const = 0; | ||
| 18 | }; | 19 | }; |
| 19 | 20 | ||
| 20 | class DefaultProfileSelectApplet final : public ProfileSelectApplet { | 21 | class DefaultProfileSelectApplet final : public ProfileSelectApplet { |
| 21 | public: | 22 | public: |
| 22 | void SelectProfile(std::function<void(std::optional<Common::UUID>)> callback) const override; | 23 | void SelectProfile(std::function<void(std::optional<Common::NewUUID>)> callback) const override; |
| 23 | }; | 24 | }; |
| 24 | 25 | ||
| 25 | } // namespace Core::Frontend | 26 | } // namespace Core::Frontend |
diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp index 6e63e057e..6abb7dbc4 100644 --- a/src/core/hle/service/acc/acc.cpp +++ b/src/core/hle/service/acc/acc.cpp | |||
| @@ -39,9 +39,9 @@ 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 |
| 40 | constexpr std::size_t THUMBNAIL_SIZE = 0x24000; | 40 | constexpr std::size_t THUMBNAIL_SIZE = 0x24000; |
| 41 | 41 | ||
| 42 | static std::filesystem::path GetImagePath(Common::UUID uuid) { | 42 | static std::filesystem::path GetImagePath(const Common::NewUUID& 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.FormatSwitch()); | 44 | fmt::format("system/save/8000000000000010/su/avators/{}.jpg", uuid.FormattedString()); |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | static constexpr u32 SanitizeJPEGSize(std::size_t size) { | 47 | static constexpr u32 SanitizeJPEGSize(std::size_t size) { |
| @@ -51,7 +51,7 @@ static constexpr u32 SanitizeJPEGSize(std::size_t size) { | |||
| 51 | 51 | ||
| 52 | class IManagerForSystemService final : public ServiceFramework<IManagerForSystemService> { | 52 | class IManagerForSystemService final : public ServiceFramework<IManagerForSystemService> { |
| 53 | public: | 53 | public: |
| 54 | explicit IManagerForSystemService(Core::System& system_, Common::UUID) | 54 | explicit IManagerForSystemService(Core::System& system_, Common::NewUUID) |
| 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+ |
| 88 | class IFloatingRegistrationRequest final : public ServiceFramework<IFloatingRegistrationRequest> { | 88 | class IFloatingRegistrationRequest final : public ServiceFramework<IFloatingRegistrationRequest> { |
| 89 | public: | 89 | public: |
| 90 | explicit IFloatingRegistrationRequest(Core::System& system_, Common::UUID) | 90 | explicit IFloatingRegistrationRequest(Core::System& system_, Common::NewUUID) |
| 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 | ||
| 113 | class IAdministrator final : public ServiceFramework<IAdministrator> { | 113 | class IAdministrator final : public ServiceFramework<IAdministrator> { |
| 114 | public: | 114 | public: |
| 115 | explicit IAdministrator(Core::System& system_, Common::UUID) | 115 | explicit IAdministrator(Core::System& system_, Common::NewUUID) |
| 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 | ||
| 171 | class IAuthorizationRequest final : public ServiceFramework<IAuthorizationRequest> { | 171 | class IAuthorizationRequest final : public ServiceFramework<IAuthorizationRequest> { |
| 172 | public: | 172 | public: |
| 173 | explicit IAuthorizationRequest(Core::System& system_, Common::UUID) | 173 | explicit IAuthorizationRequest(Core::System& system_, Common::NewUUID) |
| 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 | ||
| 190 | class IOAuthProcedure final : public ServiceFramework<IOAuthProcedure> { | 190 | class IOAuthProcedure final : public ServiceFramework<IOAuthProcedure> { |
| 191 | public: | 191 | public: |
| 192 | explicit IOAuthProcedure(Core::System& system_, Common::UUID) | 192 | explicit IOAuthProcedure(Core::System& system_, Common::NewUUID) |
| 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+ |
| 209 | class IOAuthProcedureForExternalNsa final : public ServiceFramework<IOAuthProcedureForExternalNsa> { | 209 | class IOAuthProcedureForExternalNsa final : public ServiceFramework<IOAuthProcedureForExternalNsa> { |
| 210 | public: | 210 | public: |
| 211 | explicit IOAuthProcedureForExternalNsa(Core::System& system_, Common::UUID) | 211 | explicit IOAuthProcedureForExternalNsa(Core::System& system_, Common::NewUUID) |
| 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: | |||
| 231 | class IOAuthProcedureForNintendoAccountLinkage final | 231 | class IOAuthProcedureForNintendoAccountLinkage final |
| 232 | : public ServiceFramework<IOAuthProcedureForNintendoAccountLinkage> { | 232 | : public ServiceFramework<IOAuthProcedureForNintendoAccountLinkage> { |
| 233 | public: | 233 | public: |
| 234 | explicit IOAuthProcedureForNintendoAccountLinkage(Core::System& system_, Common::UUID) | 234 | explicit IOAuthProcedureForNintendoAccountLinkage(Core::System& system_, Common::NewUUID) |
| 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 | ||
| 253 | class INotifier final : public ServiceFramework<INotifier> { | 253 | class INotifier final : public ServiceFramework<INotifier> { |
| 254 | public: | 254 | public: |
| 255 | explicit INotifier(Core::System& system_, Common::UUID) | 255 | explicit INotifier(Core::System& system_, Common::NewUUID) |
| 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: | |||
| 267 | class IProfileCommon : public ServiceFramework<IProfileCommon> { | 267 | class IProfileCommon : public ServiceFramework<IProfileCommon> { |
| 268 | public: | 268 | public: |
| 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::UUID user_id_, ProfileManager& profile_manager_) | 270 | Common::NewUUID 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"}, |
| @@ -290,7 +290,7 @@ public: | |||
| 290 | 290 | ||
| 291 | protected: | 291 | protected: |
| 292 | void Get(Kernel::HLERequestContext& ctx) { | 292 | void Get(Kernel::HLERequestContext& ctx) { |
| 293 | LOG_DEBUG(Service_ACC, "called user_id=0x{}", user_id.Format()); | 293 | LOG_DEBUG(Service_ACC, "called user_id=0x{}", user_id.RawString()); |
| 294 | ProfileBase profile_base{}; | 294 | ProfileBase profile_base{}; |
| 295 | ProfileData data{}; | 295 | ProfileData data{}; |
| 296 | if (profile_manager.GetProfileBaseAndData(user_id, profile_base, data)) { | 296 | if (profile_manager.GetProfileBaseAndData(user_id, profile_base, data)) { |
| @@ -300,21 +300,21 @@ protected: | |||
| 300 | rb.PushRaw(profile_base); | 300 | rb.PushRaw(profile_base); |
| 301 | } else { | 301 | } else { |
| 302 | LOG_ERROR(Service_ACC, "Failed to get profile base and data for user=0x{}", | 302 | LOG_ERROR(Service_ACC, "Failed to get profile base and data for user=0x{}", |
| 303 | user_id.Format()); | 303 | user_id.RawString()); |
| 304 | IPC::ResponseBuilder rb{ctx, 2}; | 304 | IPC::ResponseBuilder rb{ctx, 2}; |
| 305 | rb.Push(ResultUnknown); // TODO(ogniK): Get actual error code | 305 | rb.Push(ResultUnknown); // TODO(ogniK): Get actual error code |
| 306 | } | 306 | } |
| 307 | } | 307 | } |
| 308 | 308 | ||
| 309 | void GetBase(Kernel::HLERequestContext& ctx) { | 309 | void GetBase(Kernel::HLERequestContext& ctx) { |
| 310 | LOG_DEBUG(Service_ACC, "called user_id=0x{}", user_id.Format()); | 310 | LOG_DEBUG(Service_ACC, "called user_id=0x{}", user_id.RawString()); |
| 311 | ProfileBase profile_base{}; | 311 | ProfileBase profile_base{}; |
| 312 | if (profile_manager.GetProfileBase(user_id, profile_base)) { | 312 | if (profile_manager.GetProfileBase(user_id, profile_base)) { |
| 313 | IPC::ResponseBuilder rb{ctx, 16}; | 313 | IPC::ResponseBuilder rb{ctx, 16}; |
| 314 | rb.Push(ResultSuccess); | 314 | rb.Push(ResultSuccess); |
| 315 | rb.PushRaw(profile_base); | 315 | rb.PushRaw(profile_base); |
| 316 | } else { | 316 | } else { |
| 317 | LOG_ERROR(Service_ACC, "Failed to get profile base for user=0x{}", user_id.Format()); | 317 | LOG_ERROR(Service_ACC, "Failed to get profile base for user=0x{}", user_id.RawString()); |
| 318 | IPC::ResponseBuilder rb{ctx, 2}; | 318 | IPC::ResponseBuilder rb{ctx, 2}; |
| 319 | rb.Push(ResultUnknown); // TODO(ogniK): Get actual error code | 319 | rb.Push(ResultUnknown); // TODO(ogniK): Get actual error code |
| 320 | } | 320 | } |
| @@ -373,7 +373,7 @@ protected: | |||
| 373 | LOG_DEBUG(Service_ACC, "called, username='{}', timestamp={:016X}, uuid=0x{}", | 373 | LOG_DEBUG(Service_ACC, "called, username='{}', timestamp={:016X}, uuid=0x{}", |
| 374 | Common::StringFromFixedZeroTerminatedBuffer( | 374 | Common::StringFromFixedZeroTerminatedBuffer( |
| 375 | reinterpret_cast<const char*>(base.username.data()), base.username.size()), | 375 | reinterpret_cast<const char*>(base.username.data()), base.username.size()), |
| 376 | base.timestamp, base.user_uuid.Format()); | 376 | base.timestamp, base.user_uuid.RawString()); |
| 377 | 377 | ||
| 378 | if (user_data.size() < sizeof(ProfileData)) { | 378 | if (user_data.size() < sizeof(ProfileData)) { |
| 379 | LOG_ERROR(Service_ACC, "ProfileData buffer too small!"); | 379 | LOG_ERROR(Service_ACC, "ProfileData buffer too small!"); |
| @@ -406,7 +406,7 @@ protected: | |||
| 406 | LOG_DEBUG(Service_ACC, "called, username='{}', timestamp={:016X}, uuid=0x{}", | 406 | LOG_DEBUG(Service_ACC, "called, username='{}', timestamp={:016X}, uuid=0x{}", |
| 407 | Common::StringFromFixedZeroTerminatedBuffer( | 407 | Common::StringFromFixedZeroTerminatedBuffer( |
| 408 | reinterpret_cast<const char*>(base.username.data()), base.username.size()), | 408 | reinterpret_cast<const char*>(base.username.data()), base.username.size()), |
| 409 | base.timestamp, base.user_uuid.Format()); | 409 | base.timestamp, base.user_uuid.RawString()); |
| 410 | 410 | ||
| 411 | if (user_data.size() < sizeof(ProfileData)) { | 411 | if (user_data.size() < sizeof(ProfileData)) { |
| 412 | LOG_ERROR(Service_ACC, "ProfileData buffer too small!"); | 412 | LOG_ERROR(Service_ACC, "ProfileData buffer too small!"); |
| @@ -435,26 +435,26 @@ protected: | |||
| 435 | } | 435 | } |
| 436 | 436 | ||
| 437 | ProfileManager& profile_manager; | 437 | ProfileManager& profile_manager; |
| 438 | Common::UUID user_id{Common::INVALID_UUID}; ///< The user id this profile refers to. | 438 | Common::NewUUID user_id{}; ///< The user id this profile refers to. |
| 439 | }; | 439 | }; |
| 440 | 440 | ||
| 441 | class IProfile final : public IProfileCommon { | 441 | class IProfile final : public IProfileCommon { |
| 442 | public: | 442 | public: |
| 443 | explicit IProfile(Core::System& system_, Common::UUID user_id_, | 443 | explicit IProfile(Core::System& system_, Common::NewUUID 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 | ||
| 448 | class IProfileEditor final : public IProfileCommon { | 448 | class IProfileEditor final : public IProfileCommon { |
| 449 | public: | 449 | public: |
| 450 | explicit IProfileEditor(Core::System& system_, Common::UUID user_id_, | 450 | explicit IProfileEditor(Core::System& system_, Common::NewUUID 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 | ||
| 455 | class ISessionObject final : public ServiceFramework<ISessionObject> { | 455 | class ISessionObject final : public ServiceFramework<ISessionObject> { |
| 456 | public: | 456 | public: |
| 457 | explicit ISessionObject(Core::System& system_, Common::UUID) | 457 | explicit ISessionObject(Core::System& system_, Common::NewUUID) |
| 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 | ||
| 469 | class IGuestLoginRequest final : public ServiceFramework<IGuestLoginRequest> { | 469 | class IGuestLoginRequest final : public ServiceFramework<IGuestLoginRequest> { |
| 470 | public: | 470 | public: |
| 471 | explicit IGuestLoginRequest(Core::System& system_, Common::UUID) | 471 | explicit IGuestLoginRequest(Core::System& system_, Common::NewUUID) |
| 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 | ||
| 515 | class IManagerForApplication final : public ServiceFramework<IManagerForApplication> { | 515 | class IManagerForApplication final : public ServiceFramework<IManagerForApplication> { |
| 516 | public: | 516 | public: |
| 517 | explicit IManagerForApplication(Core::System& system_, Common::UUID user_id_) | 517 | explicit IManagerForApplication(Core::System& system_, Common::NewUUID 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_} { |
| @@ -547,7 +547,7 @@ private: | |||
| 547 | 547 | ||
| 548 | IPC::ResponseBuilder rb{ctx, 4}; | 548 | IPC::ResponseBuilder rb{ctx, 4}; |
| 549 | rb.Push(ResultSuccess); | 549 | rb.Push(ResultSuccess); |
| 550 | rb.PushRaw<u64>(user_id.GetNintendoID()); | 550 | rb.PushRaw<u64>(user_id.Hash()); |
| 551 | } | 551 | } |
| 552 | 552 | ||
| 553 | void EnsureIdTokenCacheAsync(Kernel::HLERequestContext& ctx) { | 553 | void EnsureIdTokenCacheAsync(Kernel::HLERequestContext& ctx) { |
| @@ -577,7 +577,7 @@ private: | |||
| 577 | 577 | ||
| 578 | IPC::ResponseBuilder rb{ctx, 4}; | 578 | IPC::ResponseBuilder rb{ctx, 4}; |
| 579 | rb.Push(ResultSuccess); | 579 | rb.Push(ResultSuccess); |
| 580 | rb.PushRaw<u64>(user_id.GetNintendoID()); | 580 | rb.PushRaw<u64>(user_id.Hash()); |
| 581 | } | 581 | } |
| 582 | 582 | ||
| 583 | void StoreOpenContext(Kernel::HLERequestContext& ctx) { | 583 | void StoreOpenContext(Kernel::HLERequestContext& ctx) { |
| @@ -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::UUID user_id{Common::INVALID_UUID}; | 590 | Common::NewUUID user_id{}; |
| 591 | }; | 591 | }; |
| 592 | 592 | ||
| 593 | // 6.0.0+ | 593 | // 6.0.0+ |
| 594 | class IAsyncNetworkServiceLicenseKindContext final | 594 | class IAsyncNetworkServiceLicenseKindContext final |
| 595 | : public ServiceFramework<IAsyncNetworkServiceLicenseKindContext> { | 595 | : public ServiceFramework<IAsyncNetworkServiceLicenseKindContext> { |
| 596 | public: | 596 | public: |
| 597 | explicit IAsyncNetworkServiceLicenseKindContext(Core::System& system_, Common::UUID) | 597 | explicit IAsyncNetworkServiceLicenseKindContext(Core::System& system_, Common::NewUUID) |
| 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: | |||
| 614 | class IOAuthProcedureForUserRegistration final | 614 | class IOAuthProcedureForUserRegistration final |
| 615 | : public ServiceFramework<IOAuthProcedureForUserRegistration> { | 615 | : public ServiceFramework<IOAuthProcedureForUserRegistration> { |
| 616 | public: | 616 | public: |
| 617 | explicit IOAuthProcedureForUserRegistration(Core::System& system_, Common::UUID) | 617 | explicit IOAuthProcedureForUserRegistration(Core::System& system_, Common::NewUUID) |
| 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,7 +638,8 @@ public: | |||
| 638 | 638 | ||
| 639 | class DAUTH_O final : public ServiceFramework<DAUTH_O> { | 639 | class DAUTH_O final : public ServiceFramework<DAUTH_O> { |
| 640 | public: | 640 | public: |
| 641 | explicit DAUTH_O(Core::System& system_, Common::UUID) : ServiceFramework{system_, "dauth:o"} { | 641 | explicit DAUTH_O(Core::System& system_, Common::NewUUID) |
| 642 | : ServiceFramework{system_, "dauth:o"} { | ||
| 642 | // clang-format off | 643 | // clang-format off |
| 643 | static const FunctionInfo functions[] = { | 644 | static const FunctionInfo functions[] = { |
| 644 | {0, nullptr, "EnsureAuthenticationTokenCacheAsync"}, | 645 | {0, nullptr, "EnsureAuthenticationTokenCacheAsync"}, |
| @@ -662,7 +663,7 @@ public: | |||
| 662 | // 6.0.0+ | 663 | // 6.0.0+ |
| 663 | class IAsyncResult final : public ServiceFramework<IAsyncResult> { | 664 | class IAsyncResult final : public ServiceFramework<IAsyncResult> { |
| 664 | public: | 665 | public: |
| 665 | explicit IAsyncResult(Core::System& system_, Common::UUID) | 666 | explicit IAsyncResult(Core::System& system_, Common::NewUUID) |
| 666 | : ServiceFramework{system_, "IAsyncResult"} { | 667 | : ServiceFramework{system_, "IAsyncResult"} { |
| 667 | // clang-format off | 668 | // clang-format off |
| 668 | static const FunctionInfo functions[] = { | 669 | static const FunctionInfo functions[] = { |
| @@ -686,8 +687,8 @@ void Module::Interface::GetUserCount(Kernel::HLERequestContext& ctx) { | |||
| 686 | 687 | ||
| 687 | void Module::Interface::GetUserExistence(Kernel::HLERequestContext& ctx) { | 688 | void Module::Interface::GetUserExistence(Kernel::HLERequestContext& ctx) { |
| 688 | IPC::RequestParser rp{ctx}; | 689 | IPC::RequestParser rp{ctx}; |
| 689 | Common::UUID user_id = rp.PopRaw<Common::UUID>(); | 690 | Common::NewUUID user_id = rp.PopRaw<Common::NewUUID>(); |
| 690 | LOG_DEBUG(Service_ACC, "called user_id=0x{}", user_id.Format()); | 691 | LOG_DEBUG(Service_ACC, "called user_id=0x{}", user_id.RawString()); |
| 691 | 692 | ||
| 692 | IPC::ResponseBuilder rb{ctx, 3}; | 693 | IPC::ResponseBuilder rb{ctx, 3}; |
| 693 | rb.Push(ResultSuccess); | 694 | rb.Push(ResultSuccess); |
| @@ -712,13 +713,13 @@ void Module::Interface::GetLastOpenedUser(Kernel::HLERequestContext& ctx) { | |||
| 712 | LOG_DEBUG(Service_ACC, "called"); | 713 | LOG_DEBUG(Service_ACC, "called"); |
| 713 | IPC::ResponseBuilder rb{ctx, 6}; | 714 | IPC::ResponseBuilder rb{ctx, 6}; |
| 714 | rb.Push(ResultSuccess); | 715 | rb.Push(ResultSuccess); |
| 715 | rb.PushRaw<Common::UUID>(profile_manager->GetLastOpenedUser()); | 716 | rb.PushRaw<Common::NewUUID>(profile_manager->GetLastOpenedUser()); |
| 716 | } | 717 | } |
| 717 | 718 | ||
| 718 | void Module::Interface::GetProfile(Kernel::HLERequestContext& ctx) { | 719 | void Module::Interface::GetProfile(Kernel::HLERequestContext& ctx) { |
| 719 | IPC::RequestParser rp{ctx}; | 720 | IPC::RequestParser rp{ctx}; |
| 720 | Common::UUID user_id = rp.PopRaw<Common::UUID>(); | 721 | Common::NewUUID user_id = rp.PopRaw<Common::NewUUID>(); |
| 721 | LOG_DEBUG(Service_ACC, "called user_id=0x{}", user_id.Format()); | 722 | LOG_DEBUG(Service_ACC, "called user_id=0x{}", user_id.RawString()); |
| 722 | 723 | ||
| 723 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 724 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 724 | rb.Push(ResultSuccess); | 725 | rb.Push(ResultSuccess); |
| @@ -831,9 +832,9 @@ void Module::Interface::InitializeApplicationInfoV2(Kernel::HLERequestContext& c | |||
| 831 | 832 | ||
| 832 | void Module::Interface::GetProfileEditor(Kernel::HLERequestContext& ctx) { | 833 | void Module::Interface::GetProfileEditor(Kernel::HLERequestContext& ctx) { |
| 833 | IPC::RequestParser rp{ctx}; | 834 | IPC::RequestParser rp{ctx}; |
| 834 | Common::UUID user_id = rp.PopRaw<Common::UUID>(); | 835 | Common::NewUUID user_id = rp.PopRaw<Common::NewUUID>(); |
| 835 | 836 | ||
| 836 | LOG_DEBUG(Service_ACC, "called, user_id=0x{}", user_id.Format()); | 837 | LOG_DEBUG(Service_ACC, "called, user_id=0x{}", user_id.RawString()); |
| 837 | 838 | ||
| 838 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 839 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 839 | rb.Push(ResultSuccess); | 840 | rb.Push(ResultSuccess); |
| @@ -873,9 +874,9 @@ void Module::Interface::ListOpenContextStoredUsers(Kernel::HLERequestContext& ct | |||
| 873 | 874 | ||
| 874 | void Module::Interface::StoreSaveDataThumbnailApplication(Kernel::HLERequestContext& ctx) { | 875 | void Module::Interface::StoreSaveDataThumbnailApplication(Kernel::HLERequestContext& ctx) { |
| 875 | IPC::RequestParser rp{ctx}; | 876 | IPC::RequestParser rp{ctx}; |
| 876 | const auto uuid = rp.PopRaw<Common::UUID>(); | 877 | const auto uuid = rp.PopRaw<Common::NewUUID>(); |
| 877 | 878 | ||
| 878 | LOG_WARNING(Service_ACC, "(STUBBED) called, uuid=0x{}", uuid.Format()); | 879 | LOG_WARNING(Service_ACC, "(STUBBED) called, uuid=0x{}", uuid.RawString()); |
| 879 | 880 | ||
| 880 | // TODO(ogniK): Check if application ID is zero on acc initialize. As we don't have a reliable | 881 | // TODO(ogniK): Check if application ID is zero on acc initialize. As we don't have a reliable |
| 881 | // way of confirming things like the TID, we're going to assume a non zero value for the time | 882 | // way of confirming things like the TID, we're going to assume a non zero value for the time |
| @@ -886,15 +887,15 @@ void Module::Interface::StoreSaveDataThumbnailApplication(Kernel::HLERequestCont | |||
| 886 | 887 | ||
| 887 | void Module::Interface::StoreSaveDataThumbnailSystem(Kernel::HLERequestContext& ctx) { | 888 | void Module::Interface::StoreSaveDataThumbnailSystem(Kernel::HLERequestContext& ctx) { |
| 888 | IPC::RequestParser rp{ctx}; | 889 | IPC::RequestParser rp{ctx}; |
| 889 | const auto uuid = rp.PopRaw<Common::UUID>(); | 890 | const auto uuid = rp.PopRaw<Common::NewUUID>(); |
| 890 | const auto tid = rp.Pop<u64_le>(); | 891 | const auto tid = rp.Pop<u64_le>(); |
| 891 | 892 | ||
| 892 | LOG_WARNING(Service_ACC, "(STUBBED) called, uuid=0x{}, tid={:016X}", uuid.Format(), tid); | 893 | LOG_WARNING(Service_ACC, "(STUBBED) called, uuid=0x{}, tid={:016X}", uuid.RawString(), tid); |
| 893 | StoreSaveDataThumbnail(ctx, uuid, tid); | 894 | StoreSaveDataThumbnail(ctx, uuid, tid); |
| 894 | } | 895 | } |
| 895 | 896 | ||
| 896 | void Module::Interface::StoreSaveDataThumbnail(Kernel::HLERequestContext& ctx, | 897 | void Module::Interface::StoreSaveDataThumbnail(Kernel::HLERequestContext& ctx, |
| 897 | const Common::UUID& uuid, const u64 tid) { | 898 | const Common::NewUUID& uuid, const u64 tid) { |
| 898 | IPC::ResponseBuilder rb{ctx, 2}; | 899 | IPC::ResponseBuilder rb{ctx, 2}; |
| 899 | 900 | ||
| 900 | if (tid == 0) { | 901 | if (tid == 0) { |
| @@ -903,7 +904,7 @@ void Module::Interface::StoreSaveDataThumbnail(Kernel::HLERequestContext& ctx, | |||
| 903 | return; | 904 | return; |
| 904 | } | 905 | } |
| 905 | 906 | ||
| 906 | if (!uuid) { | 907 | if (uuid.IsInvalid()) { |
| 907 | LOG_ERROR(Service_ACC, "User ID is not valid!"); | 908 | LOG_ERROR(Service_ACC, "User ID is not valid!"); |
| 908 | rb.Push(ERR_INVALID_USER_ID); | 909 | rb.Push(ERR_INVALID_USER_ID); |
| 909 | return; | 910 | return; |
| @@ -927,20 +928,20 @@ void Module::Interface::TrySelectUserWithoutInteraction(Kernel::HLERequestContex | |||
| 927 | IPC::ResponseBuilder rb{ctx, 6}; | 928 | IPC::ResponseBuilder rb{ctx, 6}; |
| 928 | if (profile_manager->GetUserCount() != 1) { | 929 | if (profile_manager->GetUserCount() != 1) { |
| 929 | rb.Push(ResultSuccess); | 930 | rb.Push(ResultSuccess); |
| 930 | rb.PushRaw<u128>(Common::INVALID_UUID); | 931 | rb.PushRaw(Common::InvalidUUID); |
| 931 | return; | 932 | return; |
| 932 | } | 933 | } |
| 933 | 934 | ||
| 934 | const auto user_list = profile_manager->GetAllUsers(); | 935 | const auto user_list = profile_manager->GetAllUsers(); |
| 935 | if (std::ranges::all_of(user_list, [](const auto& user) { return user.IsInvalid(); })) { | 936 | if (std::ranges::all_of(user_list, [](const auto& user) { return user.IsInvalid(); })) { |
| 936 | rb.Push(ResultUnknown); // TODO(ogniK): Find the correct error code | 937 | rb.Push(ResultUnknown); // TODO(ogniK): Find the correct error code |
| 937 | rb.PushRaw<u128>(Common::INVALID_UUID); | 938 | rb.PushRaw(Common::InvalidUUID); |
| 938 | return; | 939 | return; |
| 939 | } | 940 | } |
| 940 | 941 | ||
| 941 | // Select the first user we have | 942 | // Select the first user we have |
| 942 | rb.Push(ResultSuccess); | 943 | rb.Push(ResultSuccess); |
| 943 | rb.PushRaw<u128>(profile_manager->GetUser(0)->uuid); | 944 | rb.PushRaw(profile_manager->GetUser(0)->uuid); |
| 944 | } | 945 | } |
| 945 | 946 | ||
| 946 | Module::Interface::Interface(std::shared_ptr<Module> module_, | 947 | Module::Interface::Interface(std::shared_ptr<Module> module_, |
diff --git a/src/core/hle/service/acc/acc.h b/src/core/hle/service/acc/acc.h index f7e9bc4f8..b57342701 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/uuid.h" | 7 | #include "common/new_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::UUID& uuid, | 46 | void StoreSaveDataThumbnail(Kernel::HLERequestContext& ctx, const Common::NewUUID& 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 568303ced..366f3fe14 100644 --- a/src/core/hle/service/acc/profile_manager.cpp +++ b/src/core/hle/service/acc/profile_manager.cpp | |||
| @@ -16,11 +16,11 @@ | |||
| 16 | namespace Service::Account { | 16 | namespace Service::Account { |
| 17 | 17 | ||
| 18 | namespace FS = Common::FS; | 18 | namespace FS = Common::FS; |
| 19 | using Common::UUID; | 19 | using Common::NewUUID; |
| 20 | 20 | ||
| 21 | struct UserRaw { | 21 | struct UserRaw { |
| 22 | UUID uuid{Common::INVALID_UUID}; | 22 | NewUUID uuid{}; |
| 23 | UUID uuid2{Common::INVALID_UUID}; | 23 | NewUUID 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(UUID::Generate(), "yuzu"); | 48 | CreateNewUser(NewUUID::MakeRandom(), "yuzu"); |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | auto current = | 51 | auto current = |
| @@ -97,11 +97,11 @@ 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. |
| 100 | ResultCode ProfileManager::CreateNewUser(UUID uuid, const ProfileUsername& username) { | 100 | ResultCode ProfileManager::CreateNewUser(NewUUID 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 | } |
| 104 | if (!uuid) { | 104 | if (uuid.IsInvalid()) { |
| 105 | return ERROR_ARGUMENT_IS_NULL; | 105 | return ERROR_ARGUMENT_IS_NULL; |
| 106 | } | 106 | } |
| 107 | if (username[0] == 0x0) { | 107 | if (username[0] == 0x0) { |
| @@ -124,7 +124,7 @@ ResultCode ProfileManager::CreateNewUser(UUID uuid, const ProfileUsername& usern | |||
| 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 |
| 127 | ResultCode ProfileManager::CreateNewUser(UUID uuid, const std::string& username) { | 127 | ResultCode ProfileManager::CreateNewUser(NewUUID 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(UUID uuid, const std::string& username) | |||
| 135 | return CreateNewUser(uuid, username_output); | 135 | return CreateNewUser(uuid, username_output); |
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | std::optional<UUID> ProfileManager::GetUser(std::size_t index) const { | 138 | std::optional<NewUUID> 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,8 +144,8 @@ std::optional<UUID> 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. |
| 147 | std::optional<std::size_t> ProfileManager::GetUserIndex(const UUID& uuid) const { | 147 | std::optional<std::size_t> ProfileManager::GetUserIndex(const NewUUID& uuid) const { |
| 148 | if (!uuid) { | 148 | if (uuid.IsInvalid()) { |
| 149 | return std::nullopt; | 149 | return std::nullopt; |
| 150 | } | 150 | } |
| 151 | 151 | ||
| @@ -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:* |
| 179 | bool ProfileManager::GetProfileBase(UUID uuid, ProfileBase& profile) const { | 179 | bool ProfileManager::GetProfileBase(NewUUID 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 |
| 206 | bool ProfileManager::UserExists(UUID uuid) const { | 206 | bool ProfileManager::UserExists(NewUUID 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 |
| 218 | void ProfileManager::OpenUser(UUID uuid) { | 218 | void ProfileManager::OpenUser(NewUUID 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(UUID uuid) { | |||
| 226 | } | 226 | } |
| 227 | 227 | ||
| 228 | /// Closes a specific user | 228 | /// Closes a specific user |
| 229 | void ProfileManager::CloseUser(UUID uuid) { | 229 | void ProfileManager::CloseUser(NewUUID uuid) { |
| 230 | const auto idx = GetUserIndex(uuid); | 230 | const auto idx = GetUserIndex(uuid); |
| 231 | if (!idx) { | 231 | if (!idx) { |
| 232 | return; | 232 | return; |
| @@ -250,14 +250,15 @@ UserIDArray ProfileManager::GetOpenUsers() const { | |||
| 250 | std::ranges::transform(profiles, output.begin(), [](const ProfileInfo& p) { | 250 | std::ranges::transform(profiles, output.begin(), [](const ProfileInfo& p) { |
| 251 | if (p.is_open) | 251 | if (p.is_open) |
| 252 | return p.user_uuid; | 252 | return p.user_uuid; |
| 253 | return UUID{Common::INVALID_UUID}; | 253 | return Common::InvalidUUID; |
| 254 | }); | 254 | }); |
| 255 | std::stable_partition(output.begin(), output.end(), [](const UUID& uuid) { return uuid; }); | 255 | std::stable_partition(output.begin(), output.end(), |
| 256 | [](const NewUUID& uuid) { return uuid.IsValid(); }); | ||
| 256 | return output; | 257 | return output; |
| 257 | } | 258 | } |
| 258 | 259 | ||
| 259 | /// Returns the last user which was opened | 260 | /// Returns the last user which was opened |
| 260 | UUID ProfileManager::GetLastOpenedUser() const { | 261 | NewUUID ProfileManager::GetLastOpenedUser() const { |
| 261 | return last_opened_user; | 262 | return last_opened_user; |
| 262 | } | 263 | } |
| 263 | 264 | ||
| @@ -272,7 +273,7 @@ bool ProfileManager::GetProfileBaseAndData(std::optional<std::size_t> index, Pro | |||
| 272 | } | 273 | } |
| 273 | 274 | ||
| 274 | /// Return the users profile base and the unknown arbitary data. | 275 | /// Return the users profile base and the unknown arbitary data. |
| 275 | bool ProfileManager::GetProfileBaseAndData(UUID uuid, ProfileBase& profile, | 276 | bool ProfileManager::GetProfileBaseAndData(NewUUID uuid, ProfileBase& profile, |
| 276 | ProfileData& data) const { | 277 | ProfileData& data) const { |
| 277 | const auto idx = GetUserIndex(uuid); | 278 | const auto idx = GetUserIndex(uuid); |
| 278 | return GetProfileBaseAndData(idx, profile, data); | 279 | return GetProfileBaseAndData(idx, profile, data); |
| @@ -291,7 +292,7 @@ bool ProfileManager::CanSystemRegisterUser() const { | |||
| 291 | // emulate qlaunch. Update this to dynamically change. | 292 | // emulate qlaunch. Update this to dynamically change. |
| 292 | } | 293 | } |
| 293 | 294 | ||
| 294 | bool ProfileManager::RemoveUser(UUID uuid) { | 295 | bool ProfileManager::RemoveUser(NewUUID uuid) { |
| 295 | const auto index = GetUserIndex(uuid); | 296 | const auto index = GetUserIndex(uuid); |
| 296 | if (!index) { | 297 | if (!index) { |
| 297 | return false; | 298 | return false; |
| @@ -299,11 +300,11 @@ bool ProfileManager::RemoveUser(UUID uuid) { | |||
| 299 | 300 | ||
| 300 | profiles[*index] = ProfileInfo{}; | 301 | profiles[*index] = ProfileInfo{}; |
| 301 | std::stable_partition(profiles.begin(), profiles.end(), | 302 | std::stable_partition(profiles.begin(), profiles.end(), |
| 302 | [](const ProfileInfo& profile) { return profile.user_uuid; }); | 303 | [](const ProfileInfo& profile) { return profile.user_uuid.IsValid(); }); |
| 303 | return true; | 304 | return true; |
| 304 | } | 305 | } |
| 305 | 306 | ||
| 306 | bool ProfileManager::SetProfileBase(UUID uuid, const ProfileBase& profile_new) { | 307 | bool ProfileManager::SetProfileBase(NewUUID uuid, const ProfileBase& profile_new) { |
| 307 | const auto index = GetUserIndex(uuid); | 308 | const auto index = GetUserIndex(uuid); |
| 308 | if (!index || profile_new.user_uuid.IsInvalid()) { | 309 | if (!index || profile_new.user_uuid.IsInvalid()) { |
| 309 | return false; | 310 | return false; |
| @@ -317,7 +318,7 @@ bool ProfileManager::SetProfileBase(UUID uuid, const ProfileBase& profile_new) { | |||
| 317 | return true; | 318 | return true; |
| 318 | } | 319 | } |
| 319 | 320 | ||
| 320 | bool ProfileManager::SetProfileBaseAndData(Common::UUID uuid, const ProfileBase& profile_new, | 321 | bool ProfileManager::SetProfileBaseAndData(Common::NewUUID uuid, const ProfileBase& profile_new, |
| 321 | const ProfileData& data_new) { | 322 | const ProfileData& data_new) { |
| 322 | const auto index = GetUserIndex(uuid); | 323 | const auto index = GetUserIndex(uuid); |
| 323 | if (index.has_value() && SetProfileBase(uuid, profile_new)) { | 324 | if (index.has_value() && SetProfileBase(uuid, profile_new)) { |
| @@ -335,14 +336,14 @@ void ProfileManager::ParseUserSaveFile() { | |||
| 335 | 336 | ||
| 336 | if (!save.IsOpen()) { | 337 | if (!save.IsOpen()) { |
| 337 | 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 " |
| 338 | "user 'yuzu' with random UUID."); | 339 | "user 'yuzu' with random NewUUID."); |
| 339 | return; | 340 | return; |
| 340 | } | 341 | } |
| 341 | 342 | ||
| 342 | ProfileDataRaw data; | 343 | ProfileDataRaw data; |
| 343 | if (!save.ReadObject(data)) { | 344 | if (!save.ReadObject(data)) { |
| 344 | 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 " |
| 345 | "'yuzu' with random UUID."); | 346 | "'yuzu' with random NewUUID."); |
| 346 | return; | 347 | return; |
| 347 | } | 348 | } |
| 348 | 349 | ||
| @@ -361,7 +362,7 @@ void ProfileManager::ParseUserSaveFile() { | |||
| 361 | } | 362 | } |
| 362 | 363 | ||
| 363 | std::stable_partition(profiles.begin(), profiles.end(), | 364 | std::stable_partition(profiles.begin(), profiles.end(), |
| 364 | [](const ProfileInfo& profile) { return profile.user_uuid; }); | 365 | [](const ProfileInfo& profile) { return profile.user_uuid.IsValid(); }); |
| 365 | } | 366 | } |
| 366 | 367 | ||
| 367 | void ProfileManager::WriteUserSaveFile() { | 368 | void ProfileManager::WriteUserSaveFile() { |
diff --git a/src/core/hle/service/acc/profile_manager.h b/src/core/hle/service/acc/profile_manager.h index 71b9d5518..e9c58a826 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" | ||
| 11 | #include "common/swap.h" | 12 | #include "common/swap.h" |
| 12 | #include "common/uuid.h" | ||
| 13 | #include "core/hle/result.h" | 13 | #include "core/hle/result.h" |
| 14 | 14 | ||
| 15 | namespace Service::Account { | 15 | namespace Service::Account { |
| @@ -18,7 +18,7 @@ constexpr std::size_t MAX_USERS{8}; | |||
| 18 | constexpr std::size_t profile_username_size{32}; | 18 | constexpr std::size_t profile_username_size{32}; |
| 19 | 19 | ||
| 20 | using ProfileUsername = std::array<u8, profile_username_size>; | 20 | using ProfileUsername = std::array<u8, profile_username_size>; |
| 21 | using UserIDArray = std::array<Common::UUID, MAX_USERS>; | 21 | using UserIDArray = std::array<Common::NewUUID, 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 |
| 37 | struct ProfileInfo { | 37 | struct ProfileInfo { |
| 38 | Common::UUID user_uuid{Common::INVALID_UUID}; | 38 | Common::NewUUID 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,13 +43,13 @@ struct ProfileInfo { | |||
| 43 | }; | 43 | }; |
| 44 | 44 | ||
| 45 | struct ProfileBase { | 45 | struct ProfileBase { |
| 46 | Common::UUID user_uuid; | 46 | Common::NewUUID user_uuid; |
| 47 | u64_le timestamp; | 47 | u64_le timestamp; |
| 48 | ProfileUsername username; | 48 | ProfileUsername username; |
| 49 | 49 | ||
| 50 | // Zero out all the fields to make the profile slot considered "Empty" | 50 | // Zero out all the fields to make the profile slot considered "Empty" |
| 51 | void Invalidate() { | 51 | void Invalidate() { |
| 52 | user_uuid.Invalidate(); | 52 | user_uuid = {}; |
| 53 | timestamp = 0; | 53 | timestamp = 0; |
| 54 | username.fill(0); | 54 | username.fill(0); |
| 55 | } | 55 | } |
| @@ -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::UUID uuid, const ProfileUsername& username); | 68 | ResultCode CreateNewUser(Common::NewUUID uuid, const ProfileUsername& username); |
| 69 | ResultCode CreateNewUser(Common::UUID uuid, const std::string& username); | 69 | ResultCode CreateNewUser(Common::NewUUID uuid, const std::string& username); |
| 70 | std::optional<Common::UUID> GetUser(std::size_t index) const; | 70 | std::optional<Common::NewUUID> GetUser(std::size_t index) const; |
| 71 | std::optional<std::size_t> GetUserIndex(const Common::UUID& uuid) const; | 71 | std::optional<std::size_t> GetUserIndex(const Common::NewUUID& 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::UUID uuid, ProfileBase& profile) const; | 74 | bool GetProfileBase(Common::NewUUID 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::UUID uuid, ProfileBase& profile, ProfileData& data) const; | 78 | bool GetProfileBaseAndData(Common::NewUUID 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::UUID uuid) const; | 83 | bool UserExists(Common::NewUUID uuid) const; |
| 84 | bool UserExistsIndex(std::size_t index) const; | 84 | bool UserExistsIndex(std::size_t index) const; |
| 85 | void OpenUser(Common::UUID uuid); | 85 | void OpenUser(Common::NewUUID uuid); |
| 86 | void CloseUser(Common::UUID uuid); | 86 | void CloseUser(Common::NewUUID uuid); |
| 87 | UserIDArray GetOpenUsers() const; | 87 | UserIDArray GetOpenUsers() const; |
| 88 | UserIDArray GetAllUsers() const; | 88 | UserIDArray GetAllUsers() const; |
| 89 | Common::UUID GetLastOpenedUser() const; | 89 | Common::NewUUID GetLastOpenedUser() const; |
| 90 | 90 | ||
| 91 | bool CanSystemRegisterUser() const; | 91 | bool CanSystemRegisterUser() const; |
| 92 | 92 | ||
| 93 | bool RemoveUser(Common::UUID uuid); | 93 | bool RemoveUser(Common::NewUUID uuid); |
| 94 | bool SetProfileBase(Common::UUID uuid, const ProfileBase& profile_new); | 94 | bool SetProfileBase(Common::NewUUID uuid, const ProfileBase& profile_new); |
| 95 | bool SetProfileBaseAndData(Common::UUID uuid, const ProfileBase& profile_new, | 95 | bool SetProfileBaseAndData(Common::NewUUID uuid, const ProfileBase& profile_new, |
| 96 | const ProfileData& data_new); | 96 | const ProfileData& data_new); |
| 97 | 97 | ||
| 98 | private: | 98 | private: |
| @@ -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::UUID last_opened_user{Common::INVALID_UUID}; | 106 | Common::NewUUID last_opened_user{}; |
| 107 | }; | 107 | }; |
| 108 | 108 | ||
| 109 | }; // namespace Service::Account | 109 | }; // namespace Service::Account |
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; |
diff --git a/src/yuzu/applets/qt_profile_select.cpp b/src/yuzu/applets/qt_profile_select.cpp index 5b32da923..c10185e50 100644 --- a/src/yuzu/applets/qt_profile_select.cpp +++ b/src/yuzu/applets/qt_profile_select.cpp | |||
| @@ -19,21 +19,21 @@ | |||
| 19 | #include "yuzu/util/controller_navigation.h" | 19 | #include "yuzu/util/controller_navigation.h" |
| 20 | 20 | ||
| 21 | namespace { | 21 | namespace { |
| 22 | QString FormatUserEntryText(const QString& username, Common::UUID uuid) { | 22 | QString FormatUserEntryText(const QString& username, Common::NewUUID uuid) { |
| 23 | return QtProfileSelectionDialog::tr( | 23 | return QtProfileSelectionDialog::tr( |
| 24 | "%1\n%2", "%1 is the profile username, %2 is the formatted UUID (e.g. " | 24 | "%1\n%2", "%1 is the profile username, %2 is the formatted UUID (e.g. " |
| 25 | "00112233-4455-6677-8899-AABBCCDDEEFF))") | 25 | "00112233-4455-6677-8899-AABBCCDDEEFF))") |
| 26 | .arg(username, QString::fromStdString(uuid.FormatSwitch())); | 26 | .arg(username, QString::fromStdString(uuid.FormattedString())); |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | QString GetImagePath(Common::UUID uuid) { | 29 | QString GetImagePath(Common::NewUUID uuid) { |
| 30 | const auto path = | 30 | const auto path = |
| 31 | Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / | 31 | Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / |
| 32 | fmt::format("system/save/8000000000000010/su/avators/{}.jpg", uuid.FormatSwitch()); | 32 | fmt::format("system/save/8000000000000010/su/avators/{}.jpg", uuid.FormattedString()); |
| 33 | return QString::fromStdString(Common::FS::PathToUTF8String(path)); | 33 | return QString::fromStdString(Common::FS::PathToUTF8String(path)); |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | QPixmap GetIcon(Common::UUID uuid) { | 36 | QPixmap GetIcon(Common::NewUUID uuid) { |
| 37 | QPixmap icon{GetImagePath(uuid)}; | 37 | QPixmap icon{GetImagePath(uuid)}; |
| 38 | 38 | ||
| 39 | if (!icon) { | 39 | if (!icon) { |
| @@ -163,11 +163,11 @@ QtProfileSelector::QtProfileSelector(GMainWindow& parent) { | |||
| 163 | QtProfileSelector::~QtProfileSelector() = default; | 163 | QtProfileSelector::~QtProfileSelector() = default; |
| 164 | 164 | ||
| 165 | void QtProfileSelector::SelectProfile( | 165 | void QtProfileSelector::SelectProfile( |
| 166 | std::function<void(std::optional<Common::UUID>)> callback_) const { | 166 | std::function<void(std::optional<Common::NewUUID>)> callback_) const { |
| 167 | callback = std::move(callback_); | 167 | callback = std::move(callback_); |
| 168 | emit MainWindowSelectProfile(); | 168 | emit MainWindowSelectProfile(); |
| 169 | } | 169 | } |
| 170 | 170 | ||
| 171 | void QtProfileSelector::MainWindowFinishedSelection(std::optional<Common::UUID> uuid) { | 171 | void QtProfileSelector::MainWindowFinishedSelection(std::optional<Common::NewUUID> uuid) { |
| 172 | callback(uuid); | 172 | callback(uuid); |
| 173 | } | 173 | } |
diff --git a/src/yuzu/applets/qt_profile_select.h b/src/yuzu/applets/qt_profile_select.h index 56496ed31..2522b6450 100644 --- a/src/yuzu/applets/qt_profile_select.h +++ b/src/yuzu/applets/qt_profile_select.h | |||
| @@ -66,13 +66,14 @@ public: | |||
| 66 | explicit QtProfileSelector(GMainWindow& parent); | 66 | explicit QtProfileSelector(GMainWindow& parent); |
| 67 | ~QtProfileSelector() override; | 67 | ~QtProfileSelector() override; |
| 68 | 68 | ||
| 69 | void SelectProfile(std::function<void(std::optional<Common::UUID>)> callback_) const override; | 69 | void SelectProfile( |
| 70 | std::function<void(std::optional<Common::NewUUID>)> callback_) const override; | ||
| 70 | 71 | ||
| 71 | signals: | 72 | signals: |
| 72 | void MainWindowSelectProfile() const; | 73 | void MainWindowSelectProfile() const; |
| 73 | 74 | ||
| 74 | private: | 75 | private: |
| 75 | void MainWindowFinishedSelection(std::optional<Common::UUID> uuid); | 76 | void MainWindowFinishedSelection(std::optional<Common::NewUUID> uuid); |
| 76 | 77 | ||
| 77 | mutable std::function<void(std::optional<Common::UUID>)> callback; | 78 | mutable std::function<void(std::optional<Common::NewUUID>)> callback; |
| 78 | }; | 79 | }; |
diff --git a/src/yuzu/configuration/configure_profile_manager.cpp b/src/yuzu/configuration/configure_profile_manager.cpp index 78b6374c0..9e2832543 100644 --- a/src/yuzu/configuration/configure_profile_manager.cpp +++ b/src/yuzu/configuration/configure_profile_manager.cpp | |||
| @@ -33,14 +33,14 @@ constexpr std::array<u8, 107> backup_jpeg{ | |||
| 33 | 0x01, 0x01, 0x00, 0x00, 0x3f, 0x00, 0xd2, 0xcf, 0x20, 0xff, 0xd9, | 33 | 0x01, 0x01, 0x00, 0x00, 0x3f, 0x00, 0xd2, 0xcf, 0x20, 0xff, 0xd9, |
| 34 | }; | 34 | }; |
| 35 | 35 | ||
| 36 | QString GetImagePath(Common::UUID uuid) { | 36 | QString GetImagePath(const Common::NewUUID& uuid) { |
| 37 | const auto path = | 37 | const auto path = |
| 38 | Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / | 38 | Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / |
| 39 | fmt::format("system/save/8000000000000010/su/avators/{}.jpg", uuid.FormatSwitch()); | 39 | fmt::format("system/save/8000000000000010/su/avators/{}.jpg", uuid.FormattedString()); |
| 40 | return QString::fromStdString(Common::FS::PathToUTF8String(path)); | 40 | return QString::fromStdString(Common::FS::PathToUTF8String(path)); |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | QString GetAccountUsername(const Service::Account::ProfileManager& manager, Common::UUID uuid) { | 43 | QString GetAccountUsername(const Service::Account::ProfileManager& manager, Common::NewUUID uuid) { |
| 44 | Service::Account::ProfileBase profile{}; | 44 | Service::Account::ProfileBase profile{}; |
| 45 | if (!manager.GetProfileBase(uuid, profile)) { | 45 | if (!manager.GetProfileBase(uuid, profile)) { |
| 46 | return {}; | 46 | return {}; |
| @@ -51,14 +51,14 @@ QString GetAccountUsername(const Service::Account::ProfileManager& manager, Comm | |||
| 51 | return QString::fromStdString(text); | 51 | return QString::fromStdString(text); |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | QString FormatUserEntryText(const QString& username, Common::UUID uuid) { | 54 | QString FormatUserEntryText(const QString& username, Common::NewUUID uuid) { |
| 55 | return ConfigureProfileManager::tr("%1\n%2", | 55 | return ConfigureProfileManager::tr("%1\n%2", |
| 56 | "%1 is the profile username, %2 is the formatted UUID (e.g. " | 56 | "%1 is the profile username, %2 is the formatted UUID (e.g. " |
| 57 | "00112233-4455-6677-8899-AABBCCDDEEFF))") | 57 | "00112233-4455-6677-8899-AABBCCDDEEFF))") |
| 58 | .arg(username, QString::fromStdString(uuid.FormatSwitch())); | 58 | .arg(username, QString::fromStdString(uuid.FormattedString())); |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | QPixmap GetIcon(Common::UUID uuid) { | 61 | QPixmap GetIcon(const Common::NewUUID& uuid) { |
| 62 | QPixmap icon{GetImagePath(uuid)}; | 62 | QPixmap icon{GetImagePath(uuid)}; |
| 63 | 63 | ||
| 64 | if (!icon) { | 64 | if (!icon) { |
| @@ -200,7 +200,7 @@ void ConfigureProfileManager::AddUser() { | |||
| 200 | return; | 200 | return; |
| 201 | } | 201 | } |
| 202 | 202 | ||
| 203 | const auto uuid = Common::UUID::Generate(); | 203 | const auto uuid = Common::NewUUID::MakeRandom(); |
| 204 | profile_manager->CreateNewUser(uuid, username.toStdString()); | 204 | profile_manager->CreateNewUser(uuid, username.toStdString()); |
| 205 | 205 | ||
| 206 | item_model->appendRow(new QStandardItem{GetIcon(uuid), FormatUserEntryText(username, uuid)}); | 206 | item_model->appendRow(new QStandardItem{GetIcon(uuid), FormatUserEntryText(username, uuid)}); |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 556d2cdb3..c89909737 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -1688,7 +1688,7 @@ void GMainWindow::OnGameListOpenFolder(u64 program_id, GameListOpenTarget target | |||
| 1688 | 1688 | ||
| 1689 | const auto user_save_data_path = FileSys::SaveDataFactory::GetFullPath( | 1689 | const auto user_save_data_path = FileSys::SaveDataFactory::GetFullPath( |
| 1690 | *system, FileSys::SaveDataSpaceId::NandUser, FileSys::SaveDataType::SaveData, | 1690 | *system, FileSys::SaveDataSpaceId::NandUser, FileSys::SaveDataType::SaveData, |
| 1691 | program_id, user_id->uuid, 0); | 1691 | program_id, user_id->AsU128(), 0); |
| 1692 | 1692 | ||
| 1693 | path = Common::FS::ConcatPathSafe(nand_dir, user_save_data_path); | 1693 | path = Common::FS::ConcatPathSafe(nand_dir, user_save_data_path); |
| 1694 | } else { | 1694 | } else { |
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index ca4ab9af5..529d101ae 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -153,7 +153,7 @@ signals: | |||
| 153 | 153 | ||
| 154 | void ErrorDisplayFinished(); | 154 | void ErrorDisplayFinished(); |
| 155 | 155 | ||
| 156 | void ProfileSelectorFinishedSelection(std::optional<Common::UUID> uuid); | 156 | void ProfileSelectorFinishedSelection(std::optional<Common::NewUUID> uuid); |
| 157 | 157 | ||
| 158 | void SoftwareKeyboardSubmitNormalText(Service::AM::Applets::SwkbdResult result, | 158 | void SoftwareKeyboardSubmitNormalText(Service::AM::Applets::SwkbdResult result, |
| 159 | std::u16string submitted_text, bool confirmed); | 159 | std::u16string submitted_text, bool confirmed); |