fix: player list count, leaderboard stubs

This commit is contained in:
qloak committed 2026-07-14 12:16:55 -07:00
1 parent 43b9d829c8
commit 0eea592b86
10 files changed
+34 -16

No files matched your search

@@ -9,7 +9,9 @@ const wstring LeaderboardManager::filterNames[eNumFilterModes] =
L"Friends", L"MyScore", L"TopRank" L"Friends", L"MyScore", L"TopRank"
}; };
#if !defined(_WINDOWS64) && !defined(_DURANGO) && !defined(__ORBIS__) && !defined(__PS3__) && !defined(__PSVITA__) && !defined(_XBOX)
LeaderboardManager *LeaderboardManager::m_instance = NULL; LeaderboardManager *LeaderboardManager::m_instance = NULL;
#endif
void LeaderboardManager::DeleteInstance() void LeaderboardManager::DeleteInstance()
{ {
@@ -165,6 +165,6 @@ private:
void NotifyPlayerJoined( IQNetPlayer *pQNetPlayer ); void NotifyPlayerJoined( IQNetPlayer *pQNetPlayer );
#ifndef _XBOX #ifndef _XBOX
void FakeLocalPlayerJoined() { NotifyPlayerJoined(m_pIQNet->GetLocalPlayerByUserIndex(0)); } void FakeLocalPlayerJoined() { AddLocalPlayerByUserIndex(0); }
#endif #endif
}; };
@@ -93,7 +93,9 @@ void UIScene_InGameInfoMenu::updateTooltips()
if(CGameNetworkManager::usingAdhocMode()) keyX = -1; if(CGameNetworkManager::usingAdhocMode()) keyX = -1;
#endif #endif
INetworkPlayer *selectedPlayer = g_NetworkManager.GetPlayerBySmallId(m_players[m_playerList.getCurrentSelection()]->m_smallId); INetworkPlayer *selectedPlayer = NULL;
if(m_playerList.getCurrentSelection() < m_players.size())
selectedPlayer = g_NetworkManager.GetPlayerBySmallId(m_players[m_playerList.getCurrentSelection()]->m_smallId);
int keyA = -1; int keyA = -1;
Minecraft *pMinecraft = Minecraft::GetInstance(); Minecraft *pMinecraft = Minecraft::GetInstance();
@@ -335,7 +337,9 @@ void UIScene_InGameInfoMenu::handlePress(F64 controlId, F64 childId)
break; break;
case eControl_GamePlayers: case eControl_GamePlayers:
int currentSelection = (int)childId; int currentSelection = (int)childId;
INetworkPlayer *selectedPlayer = g_NetworkManager.GetPlayerBySmallId(m_players[currentSelection]->m_smallId); INetworkPlayer *selectedPlayer = NULL;
if(currentSelection < m_players.size())
selectedPlayer = g_NetworkManager.GetPlayerBySmallId(m_players[currentSelection]->m_smallId);
Minecraft *pMinecraft = Minecraft::GetInstance(); Minecraft *pMinecraft = Minecraft::GetInstance();
shared_ptr<MultiplayerLocalPlayer> localPlayer = pMinecraft->localplayers[m_iPad]; shared_ptr<MultiplayerLocalPlayer> localPlayer = pMinecraft->localplayers[m_iPad];
@@ -387,6 +391,8 @@ void UIScene_InGameInfoMenu::handleFocusChange(F64 controlId, F64 childId)
void UIScene_InGameInfoMenu::OnPlayerChanged(void *callbackParam, INetworkPlayer *pPlayer, bool leaving) void UIScene_InGameInfoMenu::OnPlayerChanged(void *callbackParam, INetworkPlayer *pPlayer, bool leaving)
{ {
if(pPlayer == NULL) return;
app.DebugPrintf("<UIScene_InGameInfoMenu::OnPlayerChanged> Player \"%ls\" %s (smallId: %d)\n", pPlayer->GetOnlineName(), leaving ? "leaving" : "joining", pPlayer->GetSmallId()); app.DebugPrintf("<UIScene_InGameInfoMenu::OnPlayerChanged> Player \"%ls\" %s (smallId: %d)\n", pPlayer->GetOnlineName(), leaving ? "leaving" : "joining", pPlayer->GetSmallId());
UIScene_InGameInfoMenu *scene = (UIScene_InGameInfoMenu *)callbackParam; UIScene_InGameInfoMenu *scene = (UIScene_InGameInfoMenu *)callbackParam;
+2 -2
View File
@@ -231,8 +231,8 @@ DWORD IQNet::GetPlayerCount() { return s_playerCount; }
QNET_STATE IQNet::GetState() { return _bQNetStubGameRunning ? QNET_STATE_GAME_PLAY : QNET_STATE_IDLE; } QNET_STATE IQNet::GetState() { return _bQNetStubGameRunning ? QNET_STATE_GAME_PLAY : QNET_STATE_IDLE; }
bool IQNet::IsHost() { return s_isHosting; } bool IQNet::IsHost() { return s_isHosting; }
HRESULT IQNet::JoinGameFromInviteInfo(DWORD dwUserIndex, DWORD dwUserMask, const INVITE_INFO *pInviteInfo) { return S_OK; } HRESULT IQNet::JoinGameFromInviteInfo(DWORD dwUserIndex, DWORD dwUserMask, const INVITE_INFO *pInviteInfo) { return S_OK; }
void IQNet::HostGame() { _bQNetStubGameRunning = true; s_isHosting = true; } void IQNet::HostGame() { _bQNetStubGameRunning = true; s_isHosting = true; if(s_playerCount == 0) s_playerCount = 1; }
void IQNet::ClientJoinGame() { _bQNetStubGameRunning = true; s_isHosting = false; } void IQNet::ClientJoinGame() { _bQNetStubGameRunning = true; s_isHosting = false; if(s_playerCount == 0) s_playerCount = 1; }
void IQNet::EndGame() { _bQNetStubGameRunning = false; s_isHosting = false; } void IQNet::EndGame() { _bQNetStubGameRunning = false; s_isHosting = false; }
DWORD MinecraftDynamicConfigurations::GetTrialTime() { return DYNAMIC_CONFIG_DEFAULT_TRIAL_TIME; } DWORD MinecraftDynamicConfigurations::GetTrialTime() { return DYNAMIC_CONFIG_DEFAULT_TRIAL_TIME; }
+1 -1
View File
@@ -34044,7 +34044,7 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Win32'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|x64'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Win32'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|x64'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Win32'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Win32'">false</ExcludedFromBuild>
+1 -1
View File
@@ -1858,7 +1858,7 @@ void Minecraft::run_middle()
achievementPopup->render(); achievementPopup->render();
PIXBeginNamedEvent(0,"Sleeping"); PIXBeginNamedEvent(0,"Sleeping");
Sleep(0); // 4J - was Thread.yield() //Sleep(0); // 4J - was Thread.yield()
PIXEndNamedEvent(); PIXEndNamedEvent();
// if (Keyboard::isKeyDown(Keyboard::KEY_F7)) Display.update(); // 4J - removed condition // if (Keyboard::isKeyDown(Keyboard::KEY_F7)) Display.update(); // 4J - removed condition
+1 -1
View File
@@ -116,7 +116,7 @@ void Options::init()
bobView = true; bobView = true;
anaglyph3d = false; anaglyph3d = false;
advancedOpengl = false; advancedOpengl = false;
framerateLimit = 2; framerateLimit = 0;
fancyGraphics = true; fancyGraphics = true;
ambientOcclusion = true; ambientOcclusion = true;
renderClouds = true; renderClouds = true;
@@ -17,13 +17,23 @@ public:
virtual void DeleteSession() {} virtual void DeleteSession() {}
//Write the given stats //Write the given stats
//This is called synchronously and will not free any memory allocated for views when it is done virtual bool WriteStats(unsigned int viewCount, ViewIn views) { return true; }
virtual bool WriteStats(unsigned int viewCount, ViewIn views) { return false; } virtual bool ReadStats_Friends(LeaderboardReadListener *callback, int difficulty, EStatsType type, PlayerUID myUID, unsigned int startIndex, unsigned int readCount) {
ReadView view = { 0, NULL };
virtual bool ReadStats_Friends(LeaderboardReadListener *callback, int difficulty, EStatsType type, PlayerUID myUID) { return false; } callback->OnStatsReadComplete(eStatsReturn_Success, 0, view);
virtual bool ReadStats_MyScore(LeaderboardReadListener *callback, int difficulty, EStatsType type, PlayerUID myUID, unsigned int readCount) { return false; } return true;
virtual bool ReadStats_TopRank(LeaderboardReadListener *callback, int difficulty, EStatsType type, unsigned int startIndex, unsigned int readCount) { return false; } }
virtual bool ReadStats_MyScore(LeaderboardReadListener *callback, int difficulty, EStatsType type, PlayerUID myUID, unsigned int readCount) {
ReadView view = { 0, NULL };
callback->OnStatsReadComplete(eStatsReturn_Success, 0, view);
return true;
}
virtual bool ReadStats_TopRank(LeaderboardReadListener *callback, int difficulty, EStatsType type, unsigned int startIndex, unsigned int readCount) {
ReadView view = { 0, NULL };
callback->OnStatsReadComplete(eStatsReturn_Success, 0, view);
return true;
}
//Perform a flush of the stats //Perform a flush of the stats
virtual void FlushStats() {} virtual void FlushStats() {}
@@ -498,7 +498,7 @@ app.DebugPrintf("width: %d, height: %d\n", width, height);
DXGI_SWAP_CHAIN_DESC sd; DXGI_SWAP_CHAIN_DESC sd;
ZeroMemory( &sd, sizeof( sd ) ); ZeroMemory( &sd, sizeof( sd ) );
sd.BufferCount = 1; sd.BufferCount = 2;
sd.BufferDesc.Width = width; sd.BufferDesc.Width = width;
sd.BufferDesc.Height = height; sd.BufferDesc.Height = height;
sd.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; sd.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
+1 -1
View File
@@ -1124,7 +1124,7 @@
<ExceptionHandling>Sync</ExceptionHandling> <ExceptionHandling>Sync</ExceptionHandling>
<BufferSecurityCheck>false</BufferSecurityCheck> <BufferSecurityCheck>false</BufferSecurityCheck>
<PrecompiledHeaderOutputFile>$(OutDir)$(ProjectName).pch</PrecompiledHeaderOutputFile> <PrecompiledHeaderOutputFile>$(OutDir)$(ProjectName).pch</PrecompiledHeaderOutputFile>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PreprocessorDefinitions>_LARGE_WORLDS;_DEBUG_MENUS_ENABLED;_DEBUG;_LIB;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_LARGE_WORLDS;_DEBUG_MENUS_ENABLED;_DEBUG;_LIB;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CallAttributedProfiling>Disabled</CallAttributedProfiling> <CallAttributedProfiling>Disabled</CallAttributedProfiling>
<RuntimeTypeInfo>true</RuntimeTypeInfo> <RuntimeTypeInfo>true</RuntimeTypeInfo>