diff --git a/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountManager.cs b/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountManager.cs index c724660ea..a815cf9d9 100644 --- a/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountManager.cs +++ b/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountManager.cs @@ -37,13 +37,16 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc _accountSaveDataManager = new AccountSaveDataManager(_profiles); - if (!_profiles.TryGetValue(DefaultUserId.ToString(), out _)) + if (_profiles.IsEmpty) { byte[] defaultUserImage = EmbeddedResources.Read("Ryujinx.HLE/HOS/Services/Account/Acc/DefaultUserImage.jpg"); - AddUser("RyuPlayer", defaultUserImage, DefaultUserId); + // Use a random UserId as default to avoid issues in multiplayer per #3396. + UserId userId = new UserId(Guid.NewGuid().ToString().Replace("-", "")); + + AddUser("RyuPlayer", defaultUserImage, userId); - OpenUser(DefaultUserId); + OpenUser(userId); } else { diff --git a/src/Ryujinx/UI/Views/User/UserEditorView.axaml.cs b/src/Ryujinx/UI/Views/User/UserEditorView.axaml.cs index 588fa471e..3e1dfa811 100644 --- a/src/Ryujinx/UI/Views/User/UserEditorView.axaml.cs +++ b/src/Ryujinx/UI/Views/User/UserEditorView.axaml.cs @@ -1,13 +1,13 @@ using Avalonia.Controls; using Avalonia.Data; using Avalonia.Interactivity; +using FluentAvalonia.Core; using FluentAvalonia.UI.Controls; using FluentAvalonia.UI.Navigation; using Ryujinx.Ava.Common.Locale; using Ryujinx.Ava.UI.Controls; using Ryujinx.Ava.UI.Helpers; using Ryujinx.Ava.UI.Models; -using Ryujinx.HLE.HOS.Services.Account.Acc; using System; using UserProfile = Ryujinx.Ava.UI.Models.UserProfile; @@ -21,7 +21,9 @@ namespace Ryujinx.Ava.UI.Views.User public TempProfile TempProfile { get; set; } public static uint MaxProfileNameLength => 0x20; - public bool IsDeletable => _profile.UserId != AccountManager.DefaultUserId; + + // Don't allow deletion if there is only one user + public bool IsDeletable => _parent.AccountManager.GetAllUsers().Count() != 1; public UserEditorView() {