From 7b9d706f791b488ef68ae639b78703d3688d0942 Mon Sep 17 00:00:00 2001 From: MiTHRAL Date: Fri, 28 Aug 2026 21:37:37 -0400 Subject: [PATCH] netcode-revival: expose gate-status diagnostics for the Party Play frontend gate --- include/rex/system/xnet_transport.h | 12 ++++++++++++ src/system/xnet_transport.cpp | 16 ++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/include/rex/system/xnet_transport.h b/include/rex/system/xnet_transport.h index 982c20d..8ad587c 100644 --- a/include/rex/system/xnet_transport.h +++ b/include/rex/system/xnet_transport.h @@ -122,6 +122,18 @@ class XNetTransport { // client. Fragile: the address is tied to this title's build. void ForceLiveFlag(); + // netcode-revival: diagnostics for the frontend "Xbox Live features" gate + // (the game checks these before enabling the Party Play / online menu). + struct GateStatus { + bool live_flag_mapped = false; + uint8_t live_flag_value = 0; // the game's "live user index" + uint32_t signin_state[4] = {}; // XamUserGetSigninState per slot + bool signin_info_ok[4] = {}; // XamUserGetSigninInfo per slot succeeds + bool link_active = false; // XNetGetEthernetLinkStatus != 0 + bool title_online = false; // XNetGetTitleXnAddr status & 0x60 + }; + GateStatus GetGateStatus() const; + // --- discovery (used by XNetQosLookup) ------------------------------------ // Send a session query for our room; the reply lands asynchronously and is // surfaced by Sessions() once WaitForReply returns. diff --git a/src/system/xnet_transport.cpp b/src/system/xnet_transport.cpp index 42f01c8..b174166 100644 --- a/src/system/xnet_transport.cpp +++ b/src/system/xnet_transport.cpp @@ -184,6 +184,22 @@ void XNetTransport::ForceLiveFlag() { } } +XNetTransport::GateStatus XNetTransport::GetGateStatus() const { + GateStatus gs; + uint8_t* flag = REX_KERNEL_MEMORY()->TranslateVirtual(0x83028851); + gs.live_flag_mapped = flag != nullptr; + gs.live_flag_value = flag != nullptr ? *flag : 0; + const uint32_t state = REX_KERNEL_STATE()->user_profile()->signin_state(); + const bool signed_in = REX_KERNEL_STATE()->user_profile()->is_signed_in(); + for (int slot = 0; slot < 4; ++slot) { + gs.signin_state[slot] = state; + gs.signin_info_ok[slot] = signed_in; + } + gs.link_active = true; // XNetGetEthernetLinkStatus now reports active + gs.title_online = true; // XNetGetTitleXnAddr now reports 0x60 + return gs; +} + void XNetTransport::SetRelay(const char* host, uint16_t port, const char* room) { { std::lock_guard lock(mu_);