Use persistent XUID for all pads in GetXUID

All pads now get unique XUIDs derived from the persistent uid.dat value
(base + iPad offset). This gives each split-screen player a globally
unique identity that works for both local play and online multiplayer.

The host legacy XUID override for save compatibility still happens in
Minecraft.cpp after GetXUID is called, so old worlds are unaffected.
This commit is contained in:
MrTheShy 2026-03-07 02:25:51 +01:00
parent 1b131ef7c1
commit 21f70fc930

View file

@ -606,15 +606,11 @@ bool C_4JProfile::QuerySigninStatus(void) { return true; }
void C_4JProfile::GetXUID(int iPad, PlayerUID * pXuid, bool bOnlineXuid) void C_4JProfile::GetXUID(int iPad, PlayerUID * pXuid, bool bOnlineXuid)
{ {
#ifdef _WINDOWS64 #ifdef _WINDOWS64
// Split-screen local players (pad 1-3) need unique XUIDs derived from the // Each pad gets a unique XUID based on the persistent uid.dat value.
// legacy base so the save system and per-player data can tell them apart. // Pad 0 uses the base persistent XUID, pads 1-3 offset from it.
// Only pad 0 participates in networking with a "real" identity. // Minecraft.cpp overrides pad 0 with legacy XUID when hosting for
if (IQNet::s_isHosting) // save compatibility, but that's handled there, not here.
*pXuid = Win64Xuid::GetLegacyEmbeddedHostXuid() + iPad; *pXuid = Win64Xuid::ResolvePersistentXuid() + iPad;
else if (iPad == 0)
*pXuid = Win64Xuid::ResolvePersistentXuid();
else
*pXuid = Win64Xuid::GetLegacyEmbeddedBaseXuid() + iPad;
#else #else
* pXuid = 0xe000d45248242f2e + iPad; * pXuid = 0xe000d45248242f2e + iPad;
#endif #endif