general: Rename NewUUID to UUID, and remove the previous UUID impl
This completes the removal of the old UUID implementation.
This commit is contained in:
parent
dfe11d72e3
commit
25db62ce15
41 changed files with 415 additions and 598 deletions
|
@ -39,7 +39,7 @@ constexpr ResultCode ERR_FAILED_SAVE_DATA{ErrorModule::Account, 100};
|
|||
// Thumbnails are hard coded to be at least this size
|
||||
constexpr std::size_t THUMBNAIL_SIZE = 0x24000;
|
||||
|
||||
static std::filesystem::path GetImagePath(const Common::NewUUID& uuid) {
|
||||
static std::filesystem::path GetImagePath(const Common::UUID& uuid) {
|
||||
return Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) /
|
||||
fmt::format("system/save/8000000000000010/su/avators/{}.jpg", uuid.FormattedString());
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ static constexpr u32 SanitizeJPEGSize(std::size_t size) {
|
|||
|
||||
class IManagerForSystemService final : public ServiceFramework<IManagerForSystemService> {
|
||||
public:
|
||||
explicit IManagerForSystemService(Core::System& system_, Common::NewUUID)
|
||||
explicit IManagerForSystemService(Core::System& system_, Common::UUID)
|
||||
: ServiceFramework{system_, "IManagerForSystemService"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
|
@ -87,7 +87,7 @@ public:
|
|||
// 3.0.0+
|
||||
class IFloatingRegistrationRequest final : public ServiceFramework<IFloatingRegistrationRequest> {
|
||||
public:
|
||||
explicit IFloatingRegistrationRequest(Core::System& system_, Common::NewUUID)
|
||||
explicit IFloatingRegistrationRequest(Core::System& system_, Common::UUID)
|
||||
: ServiceFramework{system_, "IFloatingRegistrationRequest"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
|
@ -112,7 +112,7 @@ public:
|
|||
|
||||
class IAdministrator final : public ServiceFramework<IAdministrator> {
|
||||
public:
|
||||
explicit IAdministrator(Core::System& system_, Common::NewUUID)
|
||||
explicit IAdministrator(Core::System& system_, Common::UUID)
|
||||
: ServiceFramework{system_, "IAdministrator"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
|
@ -170,7 +170,7 @@ public:
|
|||
|
||||
class IAuthorizationRequest final : public ServiceFramework<IAuthorizationRequest> {
|
||||
public:
|
||||
explicit IAuthorizationRequest(Core::System& system_, Common::NewUUID)
|
||||
explicit IAuthorizationRequest(Core::System& system_, Common::UUID)
|
||||
: ServiceFramework{system_, "IAuthorizationRequest"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
|
@ -189,7 +189,7 @@ public:
|
|||
|
||||
class IOAuthProcedure final : public ServiceFramework<IOAuthProcedure> {
|
||||
public:
|
||||
explicit IOAuthProcedure(Core::System& system_, Common::NewUUID)
|
||||
explicit IOAuthProcedure(Core::System& system_, Common::UUID)
|
||||
: ServiceFramework{system_, "IOAuthProcedure"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
|
@ -208,7 +208,7 @@ public:
|
|||
// 3.0.0+
|
||||
class IOAuthProcedureForExternalNsa final : public ServiceFramework<IOAuthProcedureForExternalNsa> {
|
||||
public:
|
||||
explicit IOAuthProcedureForExternalNsa(Core::System& system_, Common::NewUUID)
|
||||
explicit IOAuthProcedureForExternalNsa(Core::System& system_, Common::UUID)
|
||||
: ServiceFramework{system_, "IOAuthProcedureForExternalNsa"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
|
@ -231,7 +231,7 @@ public:
|
|||
class IOAuthProcedureForNintendoAccountLinkage final
|
||||
: public ServiceFramework<IOAuthProcedureForNintendoAccountLinkage> {
|
||||
public:
|
||||
explicit IOAuthProcedureForNintendoAccountLinkage(Core::System& system_, Common::NewUUID)
|
||||
explicit IOAuthProcedureForNintendoAccountLinkage(Core::System& system_, Common::UUID)
|
||||
: ServiceFramework{system_, "IOAuthProcedureForNintendoAccountLinkage"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
|
@ -252,7 +252,7 @@ public:
|
|||
|
||||
class INotifier final : public ServiceFramework<INotifier> {
|
||||
public:
|
||||
explicit INotifier(Core::System& system_, Common::NewUUID)
|
||||
explicit INotifier(Core::System& system_, Common::UUID)
|
||||
: ServiceFramework{system_, "INotifier"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
|
@ -267,7 +267,7 @@ public:
|
|||
class IProfileCommon : public ServiceFramework<IProfileCommon> {
|
||||
public:
|
||||
explicit IProfileCommon(Core::System& system_, const char* name, bool editor_commands,
|
||||
Common::NewUUID user_id_, ProfileManager& profile_manager_)
|
||||
Common::UUID user_id_, ProfileManager& profile_manager_)
|
||||
: ServiceFramework{system_, name}, profile_manager{profile_manager_}, user_id{user_id_} {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &IProfileCommon::Get, "Get"},
|
||||
|
@ -435,26 +435,26 @@ protected:
|
|||
}
|
||||
|
||||
ProfileManager& profile_manager;
|
||||
Common::NewUUID user_id{}; ///< The user id this profile refers to.
|
||||
Common::UUID user_id{}; ///< The user id this profile refers to.
|
||||
};
|
||||
|
||||
class IProfile final : public IProfileCommon {
|
||||
public:
|
||||
explicit IProfile(Core::System& system_, Common::NewUUID user_id_,
|
||||
explicit IProfile(Core::System& system_, Common::UUID user_id_,
|
||||
ProfileManager& profile_manager_)
|
||||
: IProfileCommon{system_, "IProfile", false, user_id_, profile_manager_} {}
|
||||
};
|
||||
|
||||
class IProfileEditor final : public IProfileCommon {
|
||||
public:
|
||||
explicit IProfileEditor(Core::System& system_, Common::NewUUID user_id_,
|
||||
explicit IProfileEditor(Core::System& system_, Common::UUID user_id_,
|
||||
ProfileManager& profile_manager_)
|
||||
: IProfileCommon{system_, "IProfileEditor", true, user_id_, profile_manager_} {}
|
||||
};
|
||||
|
||||
class ISessionObject final : public ServiceFramework<ISessionObject> {
|
||||
public:
|
||||
explicit ISessionObject(Core::System& system_, Common::NewUUID)
|
||||
explicit ISessionObject(Core::System& system_, Common::UUID)
|
||||
: ServiceFramework{system_, "ISessionObject"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
|
@ -468,7 +468,7 @@ public:
|
|||
|
||||
class IGuestLoginRequest final : public ServiceFramework<IGuestLoginRequest> {
|
||||
public:
|
||||
explicit IGuestLoginRequest(Core::System& system_, Common::NewUUID)
|
||||
explicit IGuestLoginRequest(Core::System& system_, Common::UUID)
|
||||
: ServiceFramework{system_, "IGuestLoginRequest"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
|
@ -514,7 +514,7 @@ protected:
|
|||
|
||||
class IManagerForApplication final : public ServiceFramework<IManagerForApplication> {
|
||||
public:
|
||||
explicit IManagerForApplication(Core::System& system_, Common::NewUUID user_id_)
|
||||
explicit IManagerForApplication(Core::System& system_, Common::UUID user_id_)
|
||||
: ServiceFramework{system_, "IManagerForApplication"},
|
||||
ensure_token_id{std::make_shared<EnsureTokenIdCacheAsyncInterface>(system)},
|
||||
user_id{user_id_} {
|
||||
|
@ -587,14 +587,14 @@ private:
|
|||
}
|
||||
|
||||
std::shared_ptr<EnsureTokenIdCacheAsyncInterface> ensure_token_id{};
|
||||
Common::NewUUID user_id{};
|
||||
Common::UUID user_id{};
|
||||
};
|
||||
|
||||
// 6.0.0+
|
||||
class IAsyncNetworkServiceLicenseKindContext final
|
||||
: public ServiceFramework<IAsyncNetworkServiceLicenseKindContext> {
|
||||
public:
|
||||
explicit IAsyncNetworkServiceLicenseKindContext(Core::System& system_, Common::NewUUID)
|
||||
explicit IAsyncNetworkServiceLicenseKindContext(Core::System& system_, Common::UUID)
|
||||
: ServiceFramework{system_, "IAsyncNetworkServiceLicenseKindContext"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
|
@ -614,7 +614,7 @@ public:
|
|||
class IOAuthProcedureForUserRegistration final
|
||||
: public ServiceFramework<IOAuthProcedureForUserRegistration> {
|
||||
public:
|
||||
explicit IOAuthProcedureForUserRegistration(Core::System& system_, Common::NewUUID)
|
||||
explicit IOAuthProcedureForUserRegistration(Core::System& system_, Common::UUID)
|
||||
: ServiceFramework{system_, "IOAuthProcedureForUserRegistration"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
|
@ -638,8 +638,7 @@ public:
|
|||
|
||||
class DAUTH_O final : public ServiceFramework<DAUTH_O> {
|
||||
public:
|
||||
explicit DAUTH_O(Core::System& system_, Common::NewUUID)
|
||||
: ServiceFramework{system_, "dauth:o"} {
|
||||
explicit DAUTH_O(Core::System& system_, Common::UUID) : ServiceFramework{system_, "dauth:o"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "EnsureAuthenticationTokenCacheAsync"},
|
||||
|
@ -663,7 +662,7 @@ public:
|
|||
// 6.0.0+
|
||||
class IAsyncResult final : public ServiceFramework<IAsyncResult> {
|
||||
public:
|
||||
explicit IAsyncResult(Core::System& system_, Common::NewUUID)
|
||||
explicit IAsyncResult(Core::System& system_, Common::UUID)
|
||||
: ServiceFramework{system_, "IAsyncResult"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
|
@ -687,7 +686,7 @@ void Module::Interface::GetUserCount(Kernel::HLERequestContext& ctx) {
|
|||
|
||||
void Module::Interface::GetUserExistence(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
Common::NewUUID user_id = rp.PopRaw<Common::NewUUID>();
|
||||
Common::UUID user_id = rp.PopRaw<Common::UUID>();
|
||||
LOG_DEBUG(Service_ACC, "called user_id=0x{}", user_id.RawString());
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
|
@ -713,12 +712,12 @@ void Module::Interface::GetLastOpenedUser(Kernel::HLERequestContext& ctx) {
|
|||
LOG_DEBUG(Service_ACC, "called");
|
||||
IPC::ResponseBuilder rb{ctx, 6};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushRaw<Common::NewUUID>(profile_manager->GetLastOpenedUser());
|
||||
rb.PushRaw<Common::UUID>(profile_manager->GetLastOpenedUser());
|
||||
}
|
||||
|
||||
void Module::Interface::GetProfile(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
Common::NewUUID user_id = rp.PopRaw<Common::NewUUID>();
|
||||
Common::UUID user_id = rp.PopRaw<Common::UUID>();
|
||||
LOG_DEBUG(Service_ACC, "called user_id=0x{}", user_id.RawString());
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
|
@ -832,7 +831,7 @@ void Module::Interface::InitializeApplicationInfoV2(Kernel::HLERequestContext& c
|
|||
|
||||
void Module::Interface::GetProfileEditor(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
Common::NewUUID user_id = rp.PopRaw<Common::NewUUID>();
|
||||
Common::UUID user_id = rp.PopRaw<Common::UUID>();
|
||||
|
||||
LOG_DEBUG(Service_ACC, "called, user_id=0x{}", user_id.RawString());
|
||||
|
||||
|
@ -874,7 +873,7 @@ void Module::Interface::ListOpenContextStoredUsers(Kernel::HLERequestContext& ct
|
|||
|
||||
void Module::Interface::StoreSaveDataThumbnailApplication(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto uuid = rp.PopRaw<Common::NewUUID>();
|
||||
const auto uuid = rp.PopRaw<Common::UUID>();
|
||||
|
||||
LOG_WARNING(Service_ACC, "(STUBBED) called, uuid=0x{}", uuid.RawString());
|
||||
|
||||
|
@ -887,7 +886,7 @@ void Module::Interface::StoreSaveDataThumbnailApplication(Kernel::HLERequestCont
|
|||
|
||||
void Module::Interface::StoreSaveDataThumbnailSystem(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto uuid = rp.PopRaw<Common::NewUUID>();
|
||||
const auto uuid = rp.PopRaw<Common::UUID>();
|
||||
const auto tid = rp.Pop<u64_le>();
|
||||
|
||||
LOG_WARNING(Service_ACC, "(STUBBED) called, uuid=0x{}, tid={:016X}", uuid.RawString(), tid);
|
||||
|
@ -895,7 +894,7 @@ void Module::Interface::StoreSaveDataThumbnailSystem(Kernel::HLERequestContext&
|
|||
}
|
||||
|
||||
void Module::Interface::StoreSaveDataThumbnail(Kernel::HLERequestContext& ctx,
|
||||
const Common::NewUUID& uuid, const u64 tid) {
|
||||
const Common::UUID& uuid, const u64 tid) {
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
|
||||
if (tid == 0) {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "common/new_uuid.h"
|
||||
#include "common/uuid.h"
|
||||
#include "core/hle/service/glue/glue_manager.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
|
@ -43,7 +43,7 @@ public:
|
|||
|
||||
private:
|
||||
ResultCode InitializeApplicationInfoBase();
|
||||
void StoreSaveDataThumbnail(Kernel::HLERequestContext& ctx, const Common::NewUUID& uuid,
|
||||
void StoreSaveDataThumbnail(Kernel::HLERequestContext& ctx, const Common::UUID& uuid,
|
||||
const u64 tid);
|
||||
|
||||
enum class ApplicationType : u32_le {
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
namespace Service::Account {
|
||||
|
||||
namespace FS = Common::FS;
|
||||
using Common::NewUUID;
|
||||
using Common::UUID;
|
||||
|
||||
struct UserRaw {
|
||||
NewUUID uuid{};
|
||||
NewUUID uuid2{};
|
||||
UUID uuid{};
|
||||
UUID uuid2{};
|
||||
u64 timestamp{};
|
||||
ProfileUsername username{};
|
||||
ProfileData extra_data{};
|
||||
|
@ -45,7 +45,7 @@ ProfileManager::ProfileManager() {
|
|||
|
||||
// Create an user if none are present
|
||||
if (user_count == 0) {
|
||||
CreateNewUser(NewUUID::MakeRandom(), "yuzu");
|
||||
CreateNewUser(UUID::MakeRandom(), "yuzu");
|
||||
}
|
||||
|
||||
auto current =
|
||||
|
@ -97,7 +97,7 @@ ResultCode ProfileManager::AddUser(const ProfileInfo& user) {
|
|||
|
||||
/// Create a new user on the system. If the uuid of the user already exists, the user is not
|
||||
/// created.
|
||||
ResultCode ProfileManager::CreateNewUser(NewUUID uuid, const ProfileUsername& username) {
|
||||
ResultCode ProfileManager::CreateNewUser(UUID uuid, const ProfileUsername& username) {
|
||||
if (user_count == MAX_USERS) {
|
||||
return ERROR_TOO_MANY_USERS;
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ ResultCode ProfileManager::CreateNewUser(NewUUID uuid, const ProfileUsername& us
|
|||
/// Creates a new user on the system. This function allows a much simpler method of registration
|
||||
/// specifically by allowing an std::string for the username. This is required specifically since
|
||||
/// we're loading a string straight from the config
|
||||
ResultCode ProfileManager::CreateNewUser(NewUUID uuid, const std::string& username) {
|
||||
ResultCode ProfileManager::CreateNewUser(UUID uuid, const std::string& username) {
|
||||
ProfileUsername username_output{};
|
||||
|
||||
if (username.size() > username_output.size()) {
|
||||
|
@ -135,7 +135,7 @@ ResultCode ProfileManager::CreateNewUser(NewUUID uuid, const std::string& userna
|
|||
return CreateNewUser(uuid, username_output);
|
||||
}
|
||||
|
||||
std::optional<NewUUID> ProfileManager::GetUser(std::size_t index) const {
|
||||
std::optional<UUID> ProfileManager::GetUser(std::size_t index) const {
|
||||
if (index >= MAX_USERS) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ std::optional<NewUUID> ProfileManager::GetUser(std::size_t index) const {
|
|||
}
|
||||
|
||||
/// Returns a users profile index based on their user id.
|
||||
std::optional<std::size_t> ProfileManager::GetUserIndex(const NewUUID& uuid) const {
|
||||
std::optional<std::size_t> ProfileManager::GetUserIndex(const UUID& uuid) const {
|
||||
if (uuid.IsInvalid()) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ bool ProfileManager::GetProfileBase(std::optional<std::size_t> index, ProfileBas
|
|||
}
|
||||
|
||||
/// Returns the data structure used by the switch when GetProfileBase is called on acc:*
|
||||
bool ProfileManager::GetProfileBase(NewUUID uuid, ProfileBase& profile) const {
|
||||
bool ProfileManager::GetProfileBase(UUID uuid, ProfileBase& profile) const {
|
||||
const auto idx = GetUserIndex(uuid);
|
||||
return GetProfileBase(idx, profile);
|
||||
}
|
||||
|
@ -203,7 +203,7 @@ std::size_t ProfileManager::GetOpenUserCount() const {
|
|||
}
|
||||
|
||||
/// Checks if a user id exists in our profile manager
|
||||
bool ProfileManager::UserExists(NewUUID uuid) const {
|
||||
bool ProfileManager::UserExists(UUID uuid) const {
|
||||
return GetUserIndex(uuid).has_value();
|
||||
}
|
||||
|
||||
|
@ -215,7 +215,7 @@ bool ProfileManager::UserExistsIndex(std::size_t index) const {
|
|||
}
|
||||
|
||||
/// Opens a specific user
|
||||
void ProfileManager::OpenUser(NewUUID uuid) {
|
||||
void ProfileManager::OpenUser(UUID uuid) {
|
||||
const auto idx = GetUserIndex(uuid);
|
||||
if (!idx) {
|
||||
return;
|
||||
|
@ -226,7 +226,7 @@ void ProfileManager::OpenUser(NewUUID uuid) {
|
|||
}
|
||||
|
||||
/// Closes a specific user
|
||||
void ProfileManager::CloseUser(NewUUID uuid) {
|
||||
void ProfileManager::CloseUser(UUID uuid) {
|
||||
const auto idx = GetUserIndex(uuid);
|
||||
if (!idx) {
|
||||
return;
|
||||
|
@ -253,12 +253,12 @@ UserIDArray ProfileManager::GetOpenUsers() const {
|
|||
return Common::InvalidUUID;
|
||||
});
|
||||
std::stable_partition(output.begin(), output.end(),
|
||||
[](const NewUUID& uuid) { return uuid.IsValid(); });
|
||||
[](const UUID& uuid) { return uuid.IsValid(); });
|
||||
return output;
|
||||
}
|
||||
|
||||
/// Returns the last user which was opened
|
||||
NewUUID ProfileManager::GetLastOpenedUser() const {
|
||||
UUID ProfileManager::GetLastOpenedUser() const {
|
||||
return last_opened_user;
|
||||
}
|
||||
|
||||
|
@ -273,7 +273,7 @@ bool ProfileManager::GetProfileBaseAndData(std::optional<std::size_t> index, Pro
|
|||
}
|
||||
|
||||
/// Return the users profile base and the unknown arbitary data.
|
||||
bool ProfileManager::GetProfileBaseAndData(NewUUID uuid, ProfileBase& profile,
|
||||
bool ProfileManager::GetProfileBaseAndData(UUID uuid, ProfileBase& profile,
|
||||
ProfileData& data) const {
|
||||
const auto idx = GetUserIndex(uuid);
|
||||
return GetProfileBaseAndData(idx, profile, data);
|
||||
|
@ -292,7 +292,7 @@ bool ProfileManager::CanSystemRegisterUser() const {
|
|||
// emulate qlaunch. Update this to dynamically change.
|
||||
}
|
||||
|
||||
bool ProfileManager::RemoveUser(NewUUID uuid) {
|
||||
bool ProfileManager::RemoveUser(UUID uuid) {
|
||||
const auto index = GetUserIndex(uuid);
|
||||
if (!index) {
|
||||
return false;
|
||||
|
@ -304,7 +304,7 @@ bool ProfileManager::RemoveUser(NewUUID uuid) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ProfileManager::SetProfileBase(NewUUID uuid, const ProfileBase& profile_new) {
|
||||
bool ProfileManager::SetProfileBase(UUID uuid, const ProfileBase& profile_new) {
|
||||
const auto index = GetUserIndex(uuid);
|
||||
if (!index || profile_new.user_uuid.IsInvalid()) {
|
||||
return false;
|
||||
|
@ -318,7 +318,7 @@ bool ProfileManager::SetProfileBase(NewUUID uuid, const ProfileBase& profile_new
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ProfileManager::SetProfileBaseAndData(Common::NewUUID uuid, const ProfileBase& profile_new,
|
||||
bool ProfileManager::SetProfileBaseAndData(Common::UUID uuid, const ProfileBase& profile_new,
|
||||
const ProfileData& data_new) {
|
||||
const auto index = GetUserIndex(uuid);
|
||||
if (index.has_value() && SetProfileBase(uuid, profile_new)) {
|
||||
|
@ -336,14 +336,14 @@ void ProfileManager::ParseUserSaveFile() {
|
|||
|
||||
if (!save.IsOpen()) {
|
||||
LOG_WARNING(Service_ACC, "Failed to load profile data from save data... Generating new "
|
||||
"user 'yuzu' with random NewUUID.");
|
||||
"user 'yuzu' with random UUID.");
|
||||
return;
|
||||
}
|
||||
|
||||
ProfileDataRaw data;
|
||||
if (!save.ReadObject(data)) {
|
||||
LOG_WARNING(Service_ACC, "profiles.dat is smaller than expected... Generating new user "
|
||||
"'yuzu' with random NewUUID.");
|
||||
"'yuzu' with random UUID.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
#include <optional>
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "common/new_uuid.h"
|
||||
#include "common/swap.h"
|
||||
#include "common/uuid.h"
|
||||
#include "core/hle/result.h"
|
||||
|
||||
namespace Service::Account {
|
||||
|
@ -18,7 +18,7 @@ constexpr std::size_t MAX_USERS{8};
|
|||
constexpr std::size_t profile_username_size{32};
|
||||
|
||||
using ProfileUsername = std::array<u8, profile_username_size>;
|
||||
using UserIDArray = std::array<Common::NewUUID, MAX_USERS>;
|
||||
using UserIDArray = std::array<Common::UUID, MAX_USERS>;
|
||||
|
||||
/// Contains extra data related to a user.
|
||||
/// TODO: RE this structure
|
||||
|
@ -35,7 +35,7 @@ static_assert(sizeof(ProfileData) == 0x80, "ProfileData structure has incorrect
|
|||
/// This holds general information about a users profile. This is where we store all the information
|
||||
/// based on a specific user
|
||||
struct ProfileInfo {
|
||||
Common::NewUUID user_uuid{};
|
||||
Common::UUID user_uuid{};
|
||||
ProfileUsername username{};
|
||||
u64 creation_time{};
|
||||
ProfileData data{}; // TODO(ognik): Work out what this is
|
||||
|
@ -43,7 +43,7 @@ struct ProfileInfo {
|
|||
};
|
||||
|
||||
struct ProfileBase {
|
||||
Common::NewUUID user_uuid;
|
||||
Common::UUID user_uuid;
|
||||
u64_le timestamp;
|
||||
ProfileUsername username;
|
||||
|
||||
|
@ -65,34 +65,34 @@ public:
|
|||
~ProfileManager();
|
||||
|
||||
ResultCode AddUser(const ProfileInfo& user);
|
||||
ResultCode CreateNewUser(Common::NewUUID uuid, const ProfileUsername& username);
|
||||
ResultCode CreateNewUser(Common::NewUUID uuid, const std::string& username);
|
||||
std::optional<Common::NewUUID> GetUser(std::size_t index) const;
|
||||
std::optional<std::size_t> GetUserIndex(const Common::NewUUID& uuid) const;
|
||||
ResultCode CreateNewUser(Common::UUID uuid, const ProfileUsername& username);
|
||||
ResultCode CreateNewUser(Common::UUID uuid, const std::string& username);
|
||||
std::optional<Common::UUID> GetUser(std::size_t index) const;
|
||||
std::optional<std::size_t> GetUserIndex(const Common::UUID& uuid) const;
|
||||
std::optional<std::size_t> GetUserIndex(const ProfileInfo& user) const;
|
||||
bool GetProfileBase(std::optional<std::size_t> index, ProfileBase& profile) const;
|
||||
bool GetProfileBase(Common::NewUUID uuid, ProfileBase& profile) const;
|
||||
bool GetProfileBase(Common::UUID uuid, ProfileBase& profile) const;
|
||||
bool GetProfileBase(const ProfileInfo& user, ProfileBase& profile) const;
|
||||
bool GetProfileBaseAndData(std::optional<std::size_t> index, ProfileBase& profile,
|
||||
ProfileData& data) const;
|
||||
bool GetProfileBaseAndData(Common::NewUUID uuid, ProfileBase& profile, ProfileData& data) const;
|
||||
bool GetProfileBaseAndData(Common::UUID uuid, ProfileBase& profile, ProfileData& data) const;
|
||||
bool GetProfileBaseAndData(const ProfileInfo& user, ProfileBase& profile,
|
||||
ProfileData& data) const;
|
||||
std::size_t GetUserCount() const;
|
||||
std::size_t GetOpenUserCount() const;
|
||||
bool UserExists(Common::NewUUID uuid) const;
|
||||
bool UserExists(Common::UUID uuid) const;
|
||||
bool UserExistsIndex(std::size_t index) const;
|
||||
void OpenUser(Common::NewUUID uuid);
|
||||
void CloseUser(Common::NewUUID uuid);
|
||||
void OpenUser(Common::UUID uuid);
|
||||
void CloseUser(Common::UUID uuid);
|
||||
UserIDArray GetOpenUsers() const;
|
||||
UserIDArray GetAllUsers() const;
|
||||
Common::NewUUID GetLastOpenedUser() const;
|
||||
Common::UUID GetLastOpenedUser() const;
|
||||
|
||||
bool CanSystemRegisterUser() const;
|
||||
|
||||
bool RemoveUser(Common::NewUUID uuid);
|
||||
bool SetProfileBase(Common::NewUUID uuid, const ProfileBase& profile_new);
|
||||
bool SetProfileBaseAndData(Common::NewUUID uuid, const ProfileBase& profile_new,
|
||||
bool RemoveUser(Common::UUID uuid);
|
||||
bool SetProfileBase(Common::UUID uuid, const ProfileBase& profile_new);
|
||||
bool SetProfileBaseAndData(Common::UUID uuid, const ProfileBase& profile_new,
|
||||
const ProfileData& data_new);
|
||||
|
||||
private:
|
||||
|
@ -103,7 +103,7 @@ private:
|
|||
|
||||
std::array<ProfileInfo, MAX_USERS> profiles{};
|
||||
std::size_t user_count{};
|
||||
Common::NewUUID last_opened_user{};
|
||||
Common::UUID last_opened_user{};
|
||||
};
|
||||
|
||||
}; // namespace Service::Account
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue