aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Common/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/Common/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/Common/Leaderboards')
-rw-r--r--Minecraft.Client/Common/Leaderboards/LeaderboardInterface.cpp4
-rw-r--r--Minecraft.Client/Common/Leaderboards/LeaderboardManager.cpp4
-rw-r--r--Minecraft.Client/Common/Leaderboards/SonyLeaderboardManager.cpp60
3 files changed, 34 insertions, 34 deletions
diff --git a/Minecraft.Client/Common/Leaderboards/LeaderboardInterface.cpp b/Minecraft.Client/Common/Leaderboards/LeaderboardInterface.cpp
index 06f9a69b..07463517 100644
--- a/Minecraft.Client/Common/Leaderboards/LeaderboardInterface.cpp
+++ b/Minecraft.Client/Common/Leaderboards/LeaderboardInterface.cpp
@@ -6,8 +6,8 @@ LeaderboardInterface::LeaderboardInterface(LeaderboardManager *man)
m_manager = man;
m_pending = false;
- m_filter = static_cast<LeaderboardManager::EFilterMode>(-1);
- m_callback = nullptr;
+ m_filter = (LeaderboardManager::EFilterMode) -1;
+ m_callback = NULL;
m_difficulty = 0;
m_type = LeaderboardManager::eStatsType_UNDEFINED;
m_startIndex = 0;
diff --git a/Minecraft.Client/Common/Leaderboards/LeaderboardManager.cpp b/Minecraft.Client/Common/Leaderboards/LeaderboardManager.cpp
index 2ba1efd6..33707b14 100644
--- a/Minecraft.Client/Common/Leaderboards/LeaderboardManager.cpp
+++ b/Minecraft.Client/Common/Leaderboards/LeaderboardManager.cpp
@@ -12,7 +12,7 @@ const wstring LeaderboardManager::filterNames[eNumFilterModes] =
void LeaderboardManager::DeleteInstance()
{
delete m_instance;
- m_instance = nullptr;
+ m_instance = NULL;
}
LeaderboardManager::LeaderboardManager()
@@ -26,7 +26,7 @@ void LeaderboardManager::zeroReadParameters()
{
m_difficulty = -1;
m_statsType = eStatsType_UNDEFINED;
- m_readListener = nullptr;
+ m_readListener = NULL;
m_startIndex = 0;
m_readCount = 0;
m_eFilterMode = eFM_UNDEFINED;
diff --git a/Minecraft.Client/Common/Leaderboards/SonyLeaderboardManager.cpp b/Minecraft.Client/Common/Leaderboards/SonyLeaderboardManager.cpp
index f2d48947..78d62568 100644
--- a/Minecraft.Client/Common/Leaderboards/SonyLeaderboardManager.cpp
+++ b/Minecraft.Client/Common/Leaderboards/SonyLeaderboardManager.cpp
@@ -35,7 +35,7 @@ SonyLeaderboardManager::SonyLeaderboardManager()
m_myXUID = INVALID_XUID;
- m_scores = nullptr;
+ m_scores = NULL;
m_statsType = eStatsType_Kills;
m_difficulty = 0;
@@ -47,7 +47,7 @@ SonyLeaderboardManager::SonyLeaderboardManager()
InitializeCriticalSection(&m_csViewsLock);
m_running = false;
- m_threadScoreboard = nullptr;
+ m_threadScoreboard = NULL;
}
SonyLeaderboardManager::~SonyLeaderboardManager()
@@ -288,7 +288,7 @@ bool SonyLeaderboardManager::getScoreByIds()
SonyRtcTick last_sort_date;
SceNpScoreRankNumber mTotalRecord;
- SceNpId *npIds = nullptr;
+ SceNpId *npIds = NULL;
int ret;
uint32_t num = 0;
@@ -322,7 +322,7 @@ bool SonyLeaderboardManager::getScoreByIds()
ZeroMemory(comments, sizeof(SceNpScoreComment) * num);
/* app.DebugPrintf("sceNpScoreGetRankingByNpId(\n\t transaction=%i,\n\t boardID=0,\n\t npId=%i,\n\t friendCount*sizeof(SceNpId)=%i*%i=%i,\
- rankData=%i,\n\t friendCount*sizeof(SceNpScorePlayerRankData)=%i,\n\t nullptr, 0, nullptr, 0,\n\t friendCount=%i,\n...\n",
+ rankData=%i,\n\t friendCount*sizeof(SceNpScorePlayerRankData)=%i,\n\t NULL, 0, NULL, 0,\n\t friendCount=%i,\n...\n",
transaction, npId, friendCount, sizeof(SceNpId), friendCount*sizeof(SceNpId),
rankData, friendCount*sizeof(SceNpScorePlayerRankData), friendCount
); */
@@ -342,9 +342,9 @@ bool SonyLeaderboardManager::getScoreByIds()
destroyTransactionContext(ret);
- if (npIds != nullptr) delete [] npIds;
- if (ptr != nullptr) delete [] ptr;
- if (comments != nullptr) delete [] comments;
+ if (npIds != NULL) delete [] npIds;
+ if (ptr != NULL) delete [] ptr;
+ if (comments != NULL) delete [] comments;
return false;
}
@@ -355,9 +355,9 @@ bool SonyLeaderboardManager::getScoreByIds()
m_eStatsState = eStatsState_Failed;
- if (npIds != nullptr) delete [] npIds;
- if (ptr != nullptr) delete [] ptr;
- if (comments != nullptr) delete [] comments;
+ if (npIds != NULL) delete [] npIds;
+ if (ptr != NULL) delete [] ptr;
+ if (comments != NULL) delete [] comments;
return false;
}
@@ -387,14 +387,14 @@ bool SonyLeaderboardManager::getScoreByIds()
comments, sizeof(SceNpScoreComment) * tmpNum, //OUT: Comments
#endif
- nullptr, 0, // GameData. (unused)
+ NULL, 0, // GameData. (unused)
tmpNum,
&last_sort_date,
&mTotalRecord,
- nullptr // Reserved, specify null.
+ NULL // Reserved, specify null.
);
if (ret == SCE_NP_COMMUNITY_ERROR_ABORTED)
@@ -425,7 +425,7 @@ bool SonyLeaderboardManager::getScoreByIds()
m_readCount = num;
// Filter scorers and construct output structure.
- if (m_scores != nullptr) delete [] m_scores;
+ if (m_scores != NULL) delete [] m_scores;
m_scores = new ReadScore[m_readCount];
convertToOutput(m_readCount, m_scores, ptr, comments);
m_maxRank = m_readCount;
@@ -458,7 +458,7 @@ error3:
delete [] ptr;
delete [] comments;
error2:
- if (npIds != nullptr) delete [] npIds;
+ if (npIds != NULL) delete [] npIds;
error1:
if (m_eStatsState != eStatsState_Canceled) m_eStatsState = eStatsState_Failed;
app.DebugPrintf("[SonyLeaderboardManager] getScoreByIds() FAILED, ret=0x%X\n", ret);
@@ -511,14 +511,14 @@ bool SonyLeaderboardManager::getScoreByRange()
comments, sizeof(SceNpScoreComment) * num, //OUT: Comment Data
- nullptr, 0, // GameData.
+ NULL, 0, // GameData.
num,
&last_sort_date,
&m_maxRank, // 'Total number of players registered in the target scoreboard.'
- nullptr // Reserved, specify null.
+ NULL // Reserved, specify null.
);
if (ret == SCE_NP_COMMUNITY_ERROR_ABORTED)
@@ -539,7 +539,7 @@ bool SonyLeaderboardManager::getScoreByRange()
delete [] ptr;
delete [] comments;
- m_scores = nullptr;
+ m_scores = NULL;
m_readCount = 0;
m_eStatsState = eStatsState_Ready;
@@ -557,7 +557,7 @@ bool SonyLeaderboardManager::getScoreByRange()
//m_stats = ptr; //Maybe: addPadding(num,ptr);
- if (m_scores != nullptr) delete [] m_scores;
+ if (m_scores != NULL) delete [] m_scores;
m_readCount = ret;
m_scores = new ReadScore[m_readCount];
for (int i=0; i<m_readCount; i++)
@@ -642,15 +642,15 @@ bool SonyLeaderboardManager::setScore()
rscore.m_score, //IN: new score,
&comment, // Comments
- nullptr, // GameInfo
+ NULL, // GameInfo
&tmp, //OUT: current rank,
#ifndef __PS3__
- nullptr, //compareDate
+ NULL, //compareDate
#endif
- nullptr // Reserved, specify null.
+ NULL // Reserved, specify null.
);
if (ret==SCE_NP_COMMUNITY_SERVER_ERROR_NOT_BEST_SCORE) //0x8002A415
@@ -695,7 +695,7 @@ void SonyLeaderboardManager::Tick()
{
case eStatsState_Ready:
{
- assert(m_scores != nullptr || m_readCount == 0);
+ assert(m_scores != NULL || m_readCount == 0);
view.m_numQueries = m_readCount;
view.m_queries = m_scores;
@@ -707,7 +707,7 @@ void SonyLeaderboardManager::Tick()
if (view.m_numQueries > 0)
ret = eStatsReturn_Success;
- if (m_readListener != nullptr)
+ if (m_readListener != NULL)
{
app.DebugPrintf("[SonyLeaderboardManager] OnStatsReadComplete(%i, %i, _), m_readCount=%i.\n", ret, m_maxRank, m_readCount);
m_readListener->OnStatsReadComplete(ret, m_maxRank, view);
@@ -716,16 +716,16 @@ void SonyLeaderboardManager::Tick()
m_eStatsState = eStatsState_Idle;
delete [] m_scores;
- m_scores = nullptr;
+ m_scores = NULL;
}
break;
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);
m_eStatsState = eStatsState_Idle;
@@ -747,7 +747,7 @@ bool SonyLeaderboardManager::OpenSession()
{
if (m_openSessions == 0)
{
- if (m_threadScoreboard == nullptr)
+ if (m_threadScoreboard == NULL)
{
m_threadScoreboard = new C4JThread(&scoreboardThreadEntry, this, "4JScoreboard");
m_threadScoreboard->SetProcessor(CPU_CORE_LEADERBOARDS);
@@ -837,7 +837,7 @@ void SonyLeaderboardManager::FlushStats() {}
void SonyLeaderboardManager::CancelOperation()
{
- m_readListener = nullptr;
+ m_readListener = NULL;
m_eStatsState = eStatsState_Canceled;
if (m_requestId != 0)
@@ -980,7 +980,7 @@ void SonyLeaderboardManager::fromBase32(void *out, SceNpScoreComment *in)
for (int i = 0; i < SCE_NP_SCORE_COMMENT_MAXLEN; i++)
{
ch[0] = getComment(in)[i];
- unsigned char fivebits = strtol(ch, nullptr, 32) << 3;
+ unsigned char fivebits = strtol(ch, NULL, 32) << 3;
int sByte = (i*5) / 8;
int eByte = (5+(i*5)) / 8;
@@ -1041,7 +1041,7 @@ bool SonyLeaderboardManager::test_string(string testing)
int ctx = createTransactionContext(m_titleContext);
if (ctx<0) return false;
- int ret = sceNpScoreCensorComment(ctx, (const char *) &comment, nullptr);
+ int ret = sceNpScoreCensorComment(ctx, (const char *) &comment, NULL);
if (ret == SCE_NP_COMMUNITY_SERVER_ERROR_CENSORED)
{