diff options
author | Lioncash <mathew1800@gmail.com> | 2018-08-21 00:02:16 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-08-21 01:48:57 +0200 |
commit | 38cd4e9c6100cb21c5b8a621d1ee204d61b031ca (patch) | |
tree | 71a12b1c75b455f83fa183201146b1081fe58ce1 /src/core/hle/service/acc/profile_manager.h | |
parent | profile_manager: Take ProfileInfo by const reference where applicable (diff) | |
download | yuzu-38cd4e9c6100cb21c5b8a621d1ee204d61b031ca.tar yuzu-38cd4e9c6100cb21c5b8a621d1ee204d61b031ca.tar.gz yuzu-38cd4e9c6100cb21c5b8a621d1ee204d61b031ca.tar.bz2 yuzu-38cd4e9c6100cb21c5b8a621d1ee204d61b031ca.tar.lz yuzu-38cd4e9c6100cb21c5b8a621d1ee204d61b031ca.tar.xz yuzu-38cd4e9c6100cb21c5b8a621d1ee204d61b031ca.tar.zst yuzu-38cd4e9c6100cb21c5b8a621d1ee204d61b031ca.zip |
Diffstat (limited to 'src/core/hle/service/acc/profile_manager.h')
-rw-r--r-- | src/core/hle/service/acc/profile_manager.h | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/core/hle/service/acc/profile_manager.h b/src/core/hle/service/acc/profile_manager.h index d38f67188..cb06e6fa6 100644 --- a/src/core/hle/service/acc/profile_manager.h +++ b/src/core/hle/service/acc/profile_manager.h @@ -48,20 +48,24 @@ struct UUID { }; static_assert(sizeof(UUID) == 16, "UUID is an invalid size!"); +using ProfileUsername = std::array<u8, 0x20>; +using ProfileData = std::array<u8, MAX_DATA>; +using UserIDArray = std::array<UUID, MAX_USERS>; + /// This holds general information about a users profile. This is where we store all the information /// based on a specific user struct ProfileInfo { UUID user_uuid; - std::array<u8, 0x20> username; + ProfileUsername username; u64 creation_time; - std::array<u8, MAX_DATA> data; // TODO(ognik): Work out what this is + ProfileData data; // TODO(ognik): Work out what this is bool is_open; }; struct ProfileBase { UUID user_uuid; u64_le timestamp; - std::array<u8, 0x20> username; + ProfileUsername username; // Zero out all the fields to make the profile slot considered "Empty" void Invalidate() { @@ -79,7 +83,7 @@ class ProfileManager { public: ProfileManager(); // TODO(ogniK): Load from system save ResultCode AddUser(const ProfileInfo& user); - ResultCode CreateNewUser(UUID uuid, const std::array<u8, 0x20>& username); + ResultCode CreateNewUser(UUID uuid, const ProfileUsername& username); ResultCode CreateNewUser(UUID uuid, const std::string& username); boost::optional<size_t> GetUserIndex(const UUID& uuid) const; boost::optional<size_t> GetUserIndex(const ProfileInfo& user) const; @@ -87,18 +91,17 @@ public: bool GetProfileBase(UUID uuid, ProfileBase& profile) const; bool GetProfileBase(const ProfileInfo& user, ProfileBase& profile) const; bool GetProfileBaseAndData(boost::optional<size_t> index, ProfileBase& profile, - std::array<u8, MAX_DATA>& data) const; - bool GetProfileBaseAndData(UUID uuid, ProfileBase& profile, - std::array<u8, MAX_DATA>& data) const; + ProfileData& data) const; + bool GetProfileBaseAndData(UUID uuid, ProfileBase& profile, ProfileData& data) const; bool GetProfileBaseAndData(const ProfileInfo& user, ProfileBase& profile, - std::array<u8, MAX_DATA>& data) const; + ProfileData& data) const; size_t GetUserCount() const; size_t GetOpenUserCount() const; bool UserExists(UUID uuid) const; void OpenUser(UUID uuid); void CloseUser(UUID uuid); - std::array<UUID, MAX_USERS> GetOpenUsers() const; - std::array<UUID, MAX_USERS> GetAllUsers() const; + UserIDArray GetOpenUsers() const; + UserIDArray GetAllUsers() const; UUID GetLastOpenedUser() const; bool CanSystemRegisterUser() const; |