the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#include "stdafx.h"
2#include "PsPlusUpsellWrapper_Orbis.h"
3
4PsPlusUpsellWrapper::PsPlusUpsellWrapper(int userIndex)
5 : m_userIndex(userIndex)
6{
7 m_bHasResponse = false;
8}
9
10bool PsPlusUpsellWrapper::displayUpsell()
11{
12 app.DebugPrintf("<PsPlusUpsellWrapper> Bringing up system PsPlus upsell for Pad_%i.\n", m_userIndex);
13
14 sceNpCommerceDialogInitialize();
15
16 SceNpCommerceDialogParam param;
17 sceNpCommerceDialogParamInitialize(¶m);
18 param.mode = SCE_NP_COMMERCE_DIALOG_MODE_PLUS;
19 param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY;
20 param.userId = ProfileManager.getUserID(m_userIndex);
21
22 sceNpCommerceDialogOpen(¶m);
23
24 return true;
25}
26
27bool PsPlusUpsellWrapper::hasResponse()
28{
29 if (m_bHasResponse) return true;
30
31 if (sceNpCommerceDialogUpdateStatus() == SCE_COMMON_DIALOG_STATUS_FINISHED)
32 {
33 app.DebugPrintf(
34 "<PsPlusUpsellWrapper> Pad_%i %s an PsPlus upsell.\n",
35 m_userIndex, (m_result.authorized?"accepted":"rejected")
36 );
37
38 m_bHasResponse = true;
39
40 sceNpCommerceDialogGetResult(&m_result);
41
42 sceNpCommerceDialogTerminate();
43
44#ifndef _CONTENT_PACKAGE
45 // 4J-JEV: If HasPlayStationPlus is miraculously true now,
46 // we didn't give it enough time to update before bringing up the upsell
47 assert( ProfileManager.HasPlayStationPlus(m_userIndex) == false );
48#endif
49
50 ProfileManager.PsPlusUpdate(m_userIndex, &m_result);
51 }
52
53 return false;
54}