diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2022-09-27 21:24:52 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-27 21:24:52 -0300 |
| commit | 1fd5cf2b4a6f592cc8df945e540ea523a799bb97 (patch) | |
| tree | 6962acb9dc2461cbe0eebc45a7e5ce84d5c10693 /Ryujinx.HLE/HOS/Services/Account/Acc/AccountManager.cs | |
| parent | 814f75142e8e4e81741a859db8189ca60535f3e6 (diff) | |
Fix ListOpenContextStoredUsers and stub LoadOpenContext (#3718)
* Fix ListOpenContextStoredUsers and stub LoadOpenContext
* Remove nonsensical comment
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Account/Acc/AccountManager.cs')
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/Account/Acc/AccountManager.cs | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Account/Acc/AccountManager.cs b/Ryujinx.HLE/HOS/Services/Account/Acc/AccountManager.cs index 9d9cb6ff..41d5028f 100644 --- a/Ryujinx.HLE/HOS/Services/Account/Acc/AccountManager.cs +++ b/Ryujinx.HLE/HOS/Services/Account/Acc/AccountManager.cs @@ -22,7 +22,8 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc // outside of the AccountManager. private readonly HorizonClient _horizonClient; - private ConcurrentDictionary<string, UserProfile> _profiles; + private readonly ConcurrentDictionary<string, UserProfile> _profiles; + private UserProfile[] _storedOpenedUsers; public UserProfile LastOpenedUser { get; private set; } @@ -31,6 +32,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc _horizonClient = horizonClient; _profiles = new ConcurrentDictionary<string, UserProfile>(); + _storedOpenedUsers = Array.Empty<UserProfile>(); _accountSaveDataManager = new AccountSaveDataManager(_profiles); @@ -44,9 +46,9 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc } else { - UserId commandLineUserProfileOverride = default; + UserId commandLineUserProfileOverride = default; if (!string.IsNullOrEmpty(initialProfileName)) - { + { commandLineUserProfileOverride = _profiles.Values.FirstOrDefault(x => x.Name == initialProfileName)?.UserId ?? default; if (commandLineUserProfileOverride.IsNull) Logger.Warning?.Print(LogClass.Application, $"The command line specified profile named '{initialProfileName}' was not found"); @@ -221,6 +223,16 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc return _profiles.Values.Where(x => x.AccountState == AccountState.Open); } + internal IEnumerable<UserProfile> GetStoredOpenedUsers() + { + return _storedOpenedUsers; + } + + internal void StoreOpenedUsers() + { + _storedOpenedUsers = _profiles.Values.Where(x => x.AccountState == AccountState.Open).ToArray(); + } + internal UserProfile GetFirst() { return _profiles.First().Value; |
