aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Durango/Leaderboards
diff options
context:
space:
mode:
authorLoki Rautio <lokirautio@gmail.com>2026-03-07 21:12:22 -0600
committerLoki Rautio <lokirautio@gmail.com>2026-03-07 21:12:22 -0600
commit087b7e7abfe81dd7f0fdcdea36ac9f245950df1a (patch)
tree69454763e73ca764af4e682d3573080b13138a0e /Minecraft.Client/Durango/Leaderboards
parenta9be52c41a02d207233199e98898fe7483d7e817 (diff)
Revert "Project modernization (#630)"
This code was not tested and breaks in Release builds, reverting to restore functionality of the nightly. All in-game menus do not work and generating a world crashes. This reverts commit a9be52c41a02d207233199e98898fe7483d7e817.
Diffstat (limited to 'Minecraft.Client/Durango/Leaderboards')
-rw-r--r--Minecraft.Client/Durango/Leaderboards/DurangoLeaderboardManager.cpp26
-rw-r--r--Minecraft.Client/Durango/Leaderboards/DurangoStatsDebugger.cpp4
-rw-r--r--Minecraft.Client/Durango/Leaderboards/GameProgress.cpp8
3 files changed, 19 insertions, 19 deletions
diff --git a/Minecraft.Client/Durango/Leaderboards/DurangoLeaderboardManager.cpp b/Minecraft.Client/Durango/Leaderboards/DurangoLeaderboardManager.cpp
index cc19b738..46b04606 100644
--- a/Minecraft.Client/Durango/Leaderboards/DurangoLeaderboardManager.cpp
+++ b/Minecraft.Client/Durango/Leaderboards/DurangoLeaderboardManager.cpp
@@ -14,7 +14,7 @@ DurangoLeaderboardManager::DurangoLeaderboardManager()
m_openSessions = 0;
m_xboxLiveContext = nullptr;
- m_scores = nullptr;
+ m_scores = NULL;
m_readCount = 0;
m_maxRank = 0;
m_waitingForProfiles = false;
@@ -160,7 +160,7 @@ void DurangoLeaderboardManager::Tick()
m_displayNames.clear();
}
- //assert(m_scores != nullptr || m_readCount == 0);
+ //assert(m_scores != NULL || m_readCount == 0);
view.m_numQueries = m_readCount;
view.m_queries = m_scores;
@@ -170,7 +170,7 @@ void DurangoLeaderboardManager::Tick()
eStatsReturn ret = view.m_numQueries > 0 ? eStatsReturn_Success : eStatsReturn_NoResults;
- if (m_readListener != nullptr)
+ if (m_readListener != NULL)
{
app.DebugPrintf("[LeaderboardManager] OnStatsReadComplete(%i, %i, _)\n", ret, m_readCount);
m_readListener->OnStatsReadComplete(ret, m_maxRank, view);
@@ -178,7 +178,7 @@ void DurangoLeaderboardManager::Tick()
app.DebugPrintf("[LeaderboardManager] Deleting scores\n");
delete [] m_scores;
- m_scores = nullptr;
+ m_scores = NULL;
setState(eStatsState_Idle);
}
@@ -186,9 +186,9 @@ void DurangoLeaderboardManager::Tick()
case eStatsState_Failed:
view.m_numQueries = 0;
- view.m_queries = nullptr;
+ view.m_queries = NULL;
- if ( m_readListener != nullptr )
+ if ( m_readListener != NULL )
{
m_readListener->OnStatsReadComplete(eStatsReturn_NetworkError, 0, view);
}
@@ -371,7 +371,7 @@ void DurangoLeaderboardManager::FlushStats()
//Cancel the current operation
void DurangoLeaderboardManager::CancelOperation()
{
- m_readListener = nullptr;
+ m_readListener = NULL;
setState(eStatsState_Canceled);
if(m_leaderboardAsyncOp) m_leaderboardAsyncOp->Cancel();
@@ -428,7 +428,7 @@ void DurangoLeaderboardManager::runLeaderboardRequest(WF::IAsyncOperation<MXSL::
app.DebugPrintf(
"Name: %ls - Filter: %ls - Rows: Retrieved=%d Total=%d Requested=%d.\n",
lastResult->DisplayName->Data(),
- LeaderboardManager::filterNames[ static_cast<int>(filter) ].c_str(),
+ LeaderboardManager::filterNames[ (int) filter ].c_str(),
lastResult->Rows->Size, lastResult->TotalRowCount, readCount
);
@@ -458,7 +458,7 @@ void DurangoLeaderboardManager::runLeaderboardRequest(WF::IAsyncOperation<MXSL::
m_maxRank = lastResult->TotalRowCount;
m_readCount = lastResult->Rows->Size;
- if (m_scores != nullptr) delete [] m_scores;
+ if (m_scores != NULL) delete [] m_scores;
m_scores = new ReadScore[m_readCount];
ZeroMemory(m_scores, sizeof(ReadScore) * m_readCount);
@@ -480,10 +480,10 @@ void DurangoLeaderboardManager::runLeaderboardRequest(WF::IAsyncOperation<MXSL::
m_scores[index].m_name = row->Gamertag->Data();
m_scores[index].m_rank = row->Rank;
- m_scores[index].m_uid = static_cast<PlayerUID>(row->XboxUserId->Data());
+ m_scores[index].m_uid = PlayerUID(row->XboxUserId->Data());
// 4J-JEV: Added to help determine if this player's score is hidden due to their privacy settings.
- m_scores[index].m_totalScore = static_cast<unsigned long>(_fromString<long long>(row->Values->GetAt(0)->Data()));
+ m_scores[index].m_totalScore = (unsigned long) _fromString<long long>(row->Values->GetAt(0)->Data());
m_xboxUserIds->Append(row->XboxUserId);
}
@@ -493,7 +493,7 @@ void DurangoLeaderboardManager::runLeaderboardRequest(WF::IAsyncOperation<MXSL::
vector<PlayerUID> xuids = vector<PlayerUID>();
for(int i = 0; i < lastResult->Rows->Size; i++)
{
- xuids.push_back(static_cast<PlayerUID>(lastResult->Rows->GetAt(i)->XboxUserId->Data()));
+ xuids.push_back(PlayerUID(lastResult->Rows->GetAt(i)->XboxUserId->Data()));
}
m_waitingForProfiles = true;
ProfileManager.GetProfiles(xuids, &GetProfilesCallback, this);
@@ -579,7 +579,7 @@ void DurangoLeaderboardManager::updateStatsInfo(int userIndex, int difficulty, E
void DurangoLeaderboardManager::GetProfilesCallback(LPVOID param, std::vector<Microsoft::Xbox::Services::Social::XboxUserProfile^> profiles)
{
- DurangoLeaderboardManager *dlm = static_cast<DurangoLeaderboardManager *>(param);
+ DurangoLeaderboardManager *dlm = (DurangoLeaderboardManager *)param;
app.DebugPrintf("[LeaderboardManager] GetProfilesCallback, profiles.size() == %d.\n", profiles.size());
diff --git a/Minecraft.Client/Durango/Leaderboards/DurangoStatsDebugger.cpp b/Minecraft.Client/Durango/Leaderboards/DurangoStatsDebugger.cpp
index 5ac71141..caa5857e 100644
--- a/Minecraft.Client/Durango/Leaderboards/DurangoStatsDebugger.cpp
+++ b/Minecraft.Client/Durango/Leaderboards/DurangoStatsDebugger.cpp
@@ -84,7 +84,7 @@ vector<wstring> *StatParam::getStats()
return out;
}
-DurangoStatsDebugger *DurangoStatsDebugger::instance = nullptr;
+DurangoStatsDebugger *DurangoStatsDebugger::instance = NULL;
DurangoStatsDebugger::DurangoStatsDebugger()
{
@@ -320,7 +320,7 @@ DurangoStatsDebugger *DurangoStatsDebugger::Initialize()
void DurangoStatsDebugger::PrintStats(int iPad)
{
- if (instance == nullptr) instance = Initialize();
+ if (instance == NULL) instance = Initialize();
vector<wstring> *tmp = instance->getStats();
instance->m_printQueue.insert(instance->m_printQueue.end(), tmp->begin(), tmp->end());
diff --git a/Minecraft.Client/Durango/Leaderboards/GameProgress.cpp b/Minecraft.Client/Durango/Leaderboards/GameProgress.cpp
index f97f9bb3..dd07f3e9 100644
--- a/Minecraft.Client/Durango/Leaderboards/GameProgress.cpp
+++ b/Minecraft.Client/Durango/Leaderboards/GameProgress.cpp
@@ -10,11 +10,11 @@ namespace WFC = Windows::Foundation::Collections;
namespace MXSA = Microsoft::Xbox::Services::Achievements;
namespace CC = concurrency;
-GameProgress *GameProgress::instance = nullptr;
+GameProgress *GameProgress::instance = NULL;
void GameProgress::Flush(int iPad)
{
- if (instance == nullptr)
+ if (instance == NULL)
instance = new GameProgress();
instance->updatePlayer(iPad);
@@ -22,7 +22,7 @@ void GameProgress::Flush(int iPad)
void GameProgress::Tick()
{
- if (instance == nullptr)
+ if (instance == NULL)
instance = new GameProgress();
long long currentTime = System::currentTimeMillis();
@@ -103,5 +103,5 @@ void GameProgress::updatePlayer(int iPad)
float GameProgress::calcGameProgress(int achievementsUnlocked)
{
- return static_cast<float>(achievementsUnlocked) / 0.60f;
+ return (float) achievementsUnlocked / 0.60f;
} \ No newline at end of file