From 203dcb28be054bea23d2eaca23e91485dfb7d4f8 Mon Sep 17 00:00:00 2001 From: emoose Date: Fri, 3 Jan 2020 11:46:08 +0000 Subject: [PATCH] [XAM/User] Try logging in to any available profile when XUID isn't set Now the XUID doesn't need to be set at all for Xenia to try logging into an available profile (as long as signin_state != 0, previously this needed XUID to be set to '1') So from a default install, you should be able to just drop an X360 profile into the right profiles dir, and when you run Xenia it'll login to it automatically for you, no config changes needed! This applies to all 4 user slots, just set their signin states, drop 4 profiles in and it should log them all into each one seperately, then you can edit the config with specific profile XUIDs for each user. Xenia should now only generate a default XeniaUser profile when no profiles are available for a user. --- src/xenia/kernel/xam/user_profile.cc | 6 +++--- src/xenia/kernel/xam/user_profile.h | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/xenia/kernel/xam/user_profile.cc b/src/xenia/kernel/xam/user_profile.cc index da0f6f43f..27ce77d89 100644 --- a/src/xenia/kernel/xam/user_profile.cc +++ b/src/xenia/kernel/xam/user_profile.cc @@ -290,8 +290,8 @@ bool UserProfile::Login(uint64_t offline_xuid) { xuid_offline_ = offline_xuid; auto profile_path = path(xuid_offline_); - if (xuid_offline_ == 1) { - // XUID = 1, login as the first non-signed-in profile + if (!xuid_offline_) { + // Try logging in as any non-signed-in profile... profile_path.clear(); auto profiles = Enumerate(kernel_state_, true); @@ -302,7 +302,7 @@ bool UserProfile::Login(uint64_t offline_xuid) { } } - if (!xuid_offline_ || profile_path.empty()) { + if (profile_path.empty()) { XELOGW( "UserProfile::Login: Couldn't find available profile to login to, " "using temp. profile"); diff --git a/src/xenia/kernel/xam/user_profile.h b/src/xenia/kernel/xam/user_profile.h index c37d88023..798988109 100644 --- a/src/xenia/kernel/xam/user_profile.h +++ b/src/xenia/kernel/xam/user_profile.h @@ -210,9 +210,10 @@ class UserProfile { bool UpdateAllGpds(); // Tries logging this user into a profile - // If XUID == 0, will use Xenia generated profile - // If XUID == 1, will try loading from any available profile - // If XUID is any other ID, will try loading from the profile it belongs to + // If XUID is set, will try signing into the profile it belongs to + // Otherwise will try signing into any available (not already signed in) + // profile + // If no profiles are available, will use a Xenia-generated one bool Login(uint64_t offline_xuid = 0); void Logout();