Allow XamUserReadProfileSettings to use xuid to define profile
This commit is contained in:
@@ -108,14 +108,31 @@ class KernelState {
|
||||
uint8_t GetConnectedUsers() const;
|
||||
void UpdateUsedUserProfiles();
|
||||
|
||||
bool IsUserSignedIn(uint8_t index) const {
|
||||
bool IsUserSignedIn(uint32_t index) const {
|
||||
return user_profiles_.find(index) != user_profiles_.cend();
|
||||
}
|
||||
|
||||
xam::UserProfile* user_profile(uint8_t index) const {
|
||||
bool IsUserSignedIn(uint64_t xuid) const {
|
||||
return user_profile(xuid) != nullptr;
|
||||
}
|
||||
|
||||
xam::UserProfile* user_profile(uint32_t index) const {
|
||||
if (!IsUserSignedIn(index)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return user_profiles_.at(index).get();
|
||||
}
|
||||
|
||||
xam::UserProfile* user_profile(uint64_t xuid) const {
|
||||
for (const auto& [key, value] : user_profiles_) {
|
||||
if (value->xuid() == xuid) {
|
||||
return user_profiles_.at(key).get();
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Access must be guarded by the global critical region.
|
||||
util::ObjectTable* object_table() { return &object_table_; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user