diff options
| author | JavidPack <javidpack@gmail.com> | 2022-03-02 01:51:37 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-02 09:51:37 +0100 |
| commit | a3dd04deef7d2555726378293df891f3877f4489 (patch) | |
| tree | 05a1fa8909951e167f9512b158af5d7dc5c84c3f /Ryujinx.HLE/HOS | |
| parent | 3705c206688c69d3348f5cec84dc480d8d7c578e (diff) | |
Implement -p or --profile command line argument (#2947)
* Implement -p or --profile command line argument
* Put command line logic all in Program and reference it elsewhere
* Address feedback
Diffstat (limited to 'Ryujinx.HLE/HOS')
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/Account/Acc/AccountManager.cs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Account/Acc/AccountManager.cs b/Ryujinx.HLE/HOS/Services/Account/Acc/AccountManager.cs index e28fe106..9d9cb6ff 100644 --- a/Ryujinx.HLE/HOS/Services/Account/Acc/AccountManager.cs +++ b/Ryujinx.HLE/HOS/Services/Account/Acc/AccountManager.cs @@ -3,6 +3,7 @@ using LibHac.Common; using LibHac.Fs; using LibHac.Fs.Shim; using Ryujinx.Common; +using Ryujinx.Common.Logging; using System; using System.Collections.Concurrent; using System.Collections.Generic; @@ -25,7 +26,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc public UserProfile LastOpenedUser { get; private set; } - public AccountManager(HorizonClient horizonClient) + public AccountManager(HorizonClient horizonClient, string initialProfileName = null) { _horizonClient = horizonClient; @@ -43,7 +44,14 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc } else { - OpenUser(_accountSaveDataManager.LastOpened); + 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"); + } + OpenUser(commandLineUserProfileOverride.IsNull ? _accountSaveDataManager.LastOpened : commandLineUserProfileOverride); } } |
