fixed vita startup crash by guarding commerce calls #21

Merged
pieeebot merged 1 commits from ubergamer-pie/cafeberry:networking into networking 2026-08-04 21:41:13 +00:00
6 changed files with 9 additions and 6 deletions

No files matched your search

+1 -1
View File
@@ -4419,7 +4419,7 @@ int CMinecraftApp::EthernetDisconnectReturned(void *pParam,int iPad,const C4JSto
// 4J-PB - turn off the PSN store icon just in case this happened when we were in one of the DLC menus // 4J-PB - turn off the PSN store icon just in case this happened when we were in one of the DLC menus
#ifdef __ORBIS__ #ifdef __ORBIS__
sceNpCommerceHidePsStoreIcon(); sceNpCommerceHidePsStoreIcon();
#elif defined __PSVITA__ #elif defined(__PSVITA__) && !defined(DISABLE_PSN)
app.GetCommerce()->HidePsStoreIcon(); app.GetCommerce()->HidePsStoreIcon();
#endif #endif
app.SetAction(iPad,eAppAction_EthernetDisconnectedReturned_Menus); app.SetAction(iPad,eAppAction_EthernetDisconnectedReturned_Menus);
@@ -56,7 +56,7 @@ void CPlatformNetworkManagerSony::HandleStateChange(SQRNetworkManager::eSQRNetwo
// 4J Stu - We may be accepting an invite from the DLC menu, so hide the icon // 4J Stu - We may be accepting an invite from the DLC menu, so hide the icon
#ifdef __ORBIS__ #ifdef __ORBIS__
sceNpCommerceHidePsStoreIcon(); sceNpCommerceHidePsStoreIcon();
#elif defined __PSVITA__ #elif defined(__PSVITA__) && !defined(DISABLE_PSN)
app.GetCommerce()->HidePsStoreIcon(); app.GetCommerce()->HidePsStoreIcon();
#endif #endif
m_bLeavingGame = false; m_bLeavingGame = false;
@@ -100,7 +100,7 @@ void UIScene_DLCMainMenu::handleInput(int iPad, int key, bool repeat, bool press
{ {
#ifdef __ORBIS__ #ifdef __ORBIS__
sceNpCommerceHidePsStoreIcon(); sceNpCommerceHidePsStoreIcon();
#elif defined __PSVITA__ #elif defined(__PSVITA__) && !defined(DISABLE_PSN)
app.GetCommerce()->HidePsStoreIcon(); app.GetCommerce()->HidePsStoreIcon();
#endif #endif
navigateBack(); navigateBack();
@@ -174,7 +174,7 @@ int UIScene_DLCMainMenu::ExitDLCMainMenu(void *pParam,int iPad,C4JStorage::EMess
#ifdef __ORBIS__ #ifdef __ORBIS__
sceNpCommerceHidePsStoreIcon(); sceNpCommerceHidePsStoreIcon();
#elif defined __PSVITA__ #elif defined(__PSVITA__) && !defined(DISABLE_PSN)
app.GetCommerce()->HidePsStoreIcon(); app.GetCommerce()->HidePsStoreIcon();
#endif #endif
pClass->navigateBack(); pClass->navigateBack();
@@ -107,7 +107,7 @@ int UIScene_DLCOffersMenu::ExitDLCOffersMenu(void *pParam,int iPad,C4JStorage::E
#ifdef __ORBIS__ #ifdef __ORBIS__
sceNpCommerceHidePsStoreIcon(); sceNpCommerceHidePsStoreIcon();
#elif defined __PSVITA__ #elif defined(__PSVITA__) && !defined(DISABLE_PSN)
app.GetCommerce()->HidePsStoreIcon(); app.GetCommerce()->HidePsStoreIcon();
#endif #endif
ui.NavigateToHomeMenu();//iPad,eUIScene_MainMenu); ui.NavigateToHomeMenu();//iPad,eUIScene_MainMenu);
+2 -1
View File
@@ -46,6 +46,7 @@ CConsoleMinecraftApp::CConsoleMinecraftApp() : CMinecraftApp()
m_pSaveToDelete = NULL; m_pSaveToDelete = NULL;
m_pCheckoutProductInfo = NULL; m_pCheckoutProductInfo = NULL;
m_pCommerce = NULL;
} }
void CConsoleMinecraftApp::SetRichPresenceContext(int iPad, int contextId) void CConsoleMinecraftApp::SetRichPresenceContext(int iPad, int contextId)
@@ -1080,7 +1081,7 @@ void CConsoleMinecraftApp::AppEventTick()
bool CConsoleMinecraftApp::CheckForEmptyStore(int iPad) bool CConsoleMinecraftApp::CheckForEmptyStore(int iPad)
{ {
#ifdef VITA_COMMERCE #ifdef VITA_COMMERCE_ENABLED
SonyCommerce::CategoryInfo *pCategories=app.GetCategoryInfo(); SonyCommerce::CategoryInfo *pCategories=app.GetCategoryInfo();
bool bEmptyStore=true; bool bEmptyStore=true;
@@ -665,7 +665,9 @@ int main()
app.CommerceInit(); // MGH - moved this here so GetCommerce isn't NULL app.CommerceInit(); // MGH - moved this here so GetCommerce isn't NULL
// 4J-PB - Kick of the check for trial or full version - requires ui to be initialised // 4J-PB - Kick of the check for trial or full version - requires ui to be initialised
#ifndef DISABLE_PSN
app.GetCommerce()->CheckForTrialUpgradeKey(); app.GetCommerce()->CheckForTrialUpgradeKey();
#endif