[RE] --create_profile_if_none: bootstrap a profile for scripted runs
The title screen's (A) opens the Sign In dialog when no profile exists, and the game goes no further. That dialog cannot be completed from a scripted container: "Create Profile" asks for a gamertag in an ImGui text field, and synthetic X key events do not reach it — tried with the window focused, via XTEST and via --window, char by char, after clicking the field. Mouse clicks work; text entry does not. So: when no profile exists on disk and this cvar is set, create one at startup and sign it in. It uses ProfileManager's fixed `default_xuid` (B13EBABEBABEBABE), which is what makes it usable from a script — a later run passes --logged_profile_slot_0_xuid=B13EBABEBABEBABE and is deterministic. Ignored when a profile already exists, so it is safe to leave in a launcher. Verified: "RE bootstrap profile 'SylphRE' -> created", then on the next boot "Found 1 Profiles" / "Loaded SylphRE (GUID: B13EBABEBABEBABE) to slot 0". This does NOT get the game past the title — see the Reborn repo's docs/re/canary-scripted-input-traps.md for what does and does not, and for the content-path crash that is the actual blocker.
This commit is contained in:
@@ -27,6 +27,16 @@ DEFINE_string(logged_profile_slot_2_xuid, "",
|
||||
DEFINE_string(logged_profile_slot_3_xuid, "",
|
||||
"XUID of the profile to load on boot in slot 3", "Profiles");
|
||||
|
||||
DEFINE_string(
|
||||
create_profile_if_none, "",
|
||||
"Reverse-engineering aid: if no profile exists on disk, create one with "
|
||||
"this gamertag at startup and sign it in. Without a signed-in profile the "
|
||||
"title screen's (A) opens the Sign In dialog and the game goes no further, "
|
||||
"and this container has no way to type a gamertag into it: the dialog is "
|
||||
"an ImGui text field and synthetic X key events never reach it. Ignored "
|
||||
"when a profile already exists.",
|
||||
"Profiles");
|
||||
|
||||
namespace xe {
|
||||
namespace kernel {
|
||||
namespace xam {
|
||||
@@ -105,6 +115,17 @@ ProfileManager::ProfileManager(KernelState* kernel_state,
|
||||
LoadAccount(account_xuid);
|
||||
}
|
||||
|
||||
// RE aid: bootstrap a profile for scripted runs (see the cvar's help). The
|
||||
// fixed XUID is what makes it usable from a script — `default_xuid` gives
|
||||
// 0xB13EBABEBABEBABE every time, so a run can pass
|
||||
// --logged_profile_slot_0_xuid=B13EBABEBABEBABE and be deterministic.
|
||||
if (accounts_.empty() && !cvars::create_profile_if_none.empty()) {
|
||||
const bool ok =
|
||||
CreateProfile(cvars::create_profile_if_none, true, true);
|
||||
XELOGI("ProfileManager: RE bootstrap profile '{}' -> {}",
|
||||
cvars::create_profile_if_none, ok ? "created" : "FAILED");
|
||||
}
|
||||
|
||||
if (!cvars::logged_profile_slot_0_xuid.empty()) {
|
||||
Login(xe::string_util::from_string<uint64_t>(
|
||||
cvars::logged_profile_slot_0_xuid, true),
|
||||
|
||||
Reference in New Issue
Block a user