From 0ef661392f1006ec614a096cb2af8b32064d8849 Mon Sep 17 00:00:00 2001 From: str1k3r <115313679+S1l3ntStr1ke87@users.noreply.github.com> Date: Sat, 12 Sep 2026 17:31:48 -0400 Subject: [PATCH] feat: Durango Lib parity + remove stubs --- 4J_Profile/Windows64/4J_Profile.cpp | 10 ++++++++++ 4J_Profile/Windows64/PRO_Main.cpp | 12 ++++++++++-- 4J_Profile/Windows64/PRO_Main.h | 5 +++++ 4J_Profile/Windows64/PRO_Sys.cpp | 30 +++++++++++++++++++++++++---- 4J_Profile/Windows64/PRO_Sys.h | 8 ++++++++ 5 files changed, 59 insertions(+), 6 deletions(-) diff --git a/4J_Profile/Windows64/4J_Profile.cpp b/4J_Profile/Windows64/4J_Profile.cpp index 1949a61..949fb82 100644 --- a/4J_Profile/Windows64/4J_Profile.cpp +++ b/4J_Profile/Windows64/4J_Profile.cpp @@ -90,3 +90,13 @@ void C_4JProfile::SetDebugFullOverride(bool bVal) { InternalProfileManager.m_Sys.SetDebugFullOverride(bVal); } + +bool C_4JProfile::LocaleIsUSorCanada() +{ + return InternalProfileManager.m_Sys.LocaleIsUSorCanada(); +} + +bool C_4JProfile::LocaleIsChina() +{ + return InternalProfileManager.m_Sys.LocaleIsChina(); +} diff --git a/4J_Profile/Windows64/PRO_Main.cpp b/4J_Profile/Windows64/PRO_Main.cpp index b798091..7b0435d 100644 --- a/4J_Profile/Windows64/PRO_Main.cpp +++ b/4J_Profile/Windows64/PRO_Main.cpp @@ -2,12 +2,20 @@ CProfile InternalProfileManager; +CProfile::CProfile() +{ + m_LockedProfile = 0; +} + int CProfile::GetLockedProfile() { - return 0; + return m_LockedProfile; } void CProfile::SetLockedProfile(int iProf) { - ; + if(m_LockedProfile != iProf) + { + m_LockedProfile = iProf; + } } \ No newline at end of file diff --git a/4J_Profile/Windows64/PRO_Main.h b/4J_Profile/Windows64/PRO_Main.h index 8d007ed..dad74e9 100644 --- a/4J_Profile/Windows64/PRO_Main.h +++ b/4J_Profile/Windows64/PRO_Main.h @@ -6,11 +6,16 @@ class CProfile { public: + CProfile(); + int GetLockedProfile(); void SetLockedProfile(int iProf); CSys m_Sys; CProfileData m_ProfileData; + +private: + int m_LockedProfile; }; // Singleton diff --git a/4J_Profile/Windows64/PRO_Sys.cpp b/4J_Profile/Windows64/PRO_Sys.cpp index 1be86c8..737124b 100644 --- a/4J_Profile/Windows64/PRO_Sys.cpp +++ b/4J_Profile/Windows64/PRO_Sys.cpp @@ -5,6 +5,11 @@ bool s_bProfileIsFullVersion = true; char fakeGamerTag[16] = "PlayerName"; wchar_t fakeGamerTagW[16] = L"PlayerName"; +CSys::CSys() +{ + m_iPrimaryPad = 0; +} + bool CSys::IsSignedIn(int iQuadrant) { return InputManager.IsPadConnected(iQuadrant); //str1k3r - since we dont sign in like consoles just check if the pad is connected @@ -101,12 +106,17 @@ bool CSys::AllowedToPlayMultiplayer(int iProf) int CSys::GetPrimaryPad() { - return 0; + return m_iPrimaryPad; } void CSys::SetPrimaryPad(int iPad) { - ; //str1k3r - stubbed out + m_iPrimaryPad = iPad; +} + +void CSys::SetDebugFullOverride(bool bVal) +{ + s_bProfileIsFullVersion = bVal; } bool CSys::IsFullVersion() @@ -114,7 +124,19 @@ bool CSys::IsFullVersion() return s_bProfileIsFullVersion; } -void CSys::SetDebugFullOverride(bool bVal) +//str1k3r - fun fact this is 1:1 to the Durango lib +bool CSys::LocaleIsUSorCanada() { - s_bProfileIsFullVersion = bVal; + GEOID UserGeoID; + + UserGeoID = GetUserGeoID(GEOCLASS_NATION); + return UserGeoID == 39 || UserGeoID == 244; +} + +bool CSys::LocaleIsChina() +{ + GEOID UserGeoID; + + UserGeoID = GetUserGeoID(GEOCLASS_NATION); + return UserGeoID == 45; } \ No newline at end of file diff --git a/4J_Profile/Windows64/PRO_Sys.h b/4J_Profile/Windows64/PRO_Sys.h index f933baf..4016be3 100644 --- a/4J_Profile/Windows64/PRO_Sys.h +++ b/4J_Profile/Windows64/PRO_Sys.h @@ -5,6 +5,8 @@ class CSys { public: + CSys(); + // SIGNED IN bool IsSignedIn(int iQuadrant); bool IsSignedInLive(int iProf); @@ -27,4 +29,10 @@ public: bool IsFullVersion(); void SetDebugFullOverride(bool bVal); + + // LOCALE + bool LocaleIsUSorCanada(); + bool LocaleIsChina(); + + int m_iPrimaryPad; }; \ No newline at end of file