public AccountManager(HorizonClient horizonClient, string initialProfileName = null) { _horizonClient = horizonClient; _profiles = new ConcurrentDictionary <string, UserProfile>(); _accountSaveDataManager = new AccountSaveDataManager(_profiles); if (!_profiles.TryGetValue(DefaultUserId.ToString(), out _)) { byte[] defaultUserImage = EmbeddedResources.Read("Ryujinx.HLE/HOS/Services/Account/Acc/DefaultUserImage.jpg"); AddUser("RyuPlayer", defaultUserImage, DefaultUserId); OpenUser(DefaultUserId); } else { 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); } }
public AccountManager(VirtualFileSystem virtualFileSystem) { _virtualFileSystem = virtualFileSystem; _profiles = new ConcurrentDictionary <string, UserProfile>(); _accountSaveDataManager = new AccountSaveDataManager(_profiles); if (!_profiles.TryGetValue(DefaultUserId.ToString(), out _)) { byte[] defaultUserImage = EmbeddedResources.Read("Ryujinx.HLE/HOS/Services/Account/Acc/DefaultUserImage.jpg"); AddUser("RyuPlayer", defaultUserImage, DefaultUserId); OpenUser(DefaultUserId); } else { OpenUser(_accountSaveDataManager.LastOpened); } }