aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Orbis/Network/PsPlusUpsellWrapper_Orbis.cpp
diff options
context:
space:
mode:
authordaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
committerdaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
commitb691c43c44ff180d10e7d4a9afc83b98551ff586 (patch)
tree3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.Client/Orbis/Network/PsPlusUpsellWrapper_Orbis.cpp
parentdef8cb415354ac390b7e89052a50605285f1aca9 (diff)
Initial commit
Diffstat (limited to 'Minecraft.Client/Orbis/Network/PsPlusUpsellWrapper_Orbis.cpp')
-rw-r--r--Minecraft.Client/Orbis/Network/PsPlusUpsellWrapper_Orbis.cpp54
1 files changed, 54 insertions, 0 deletions
diff --git a/Minecraft.Client/Orbis/Network/PsPlusUpsellWrapper_Orbis.cpp b/Minecraft.Client/Orbis/Network/PsPlusUpsellWrapper_Orbis.cpp
new file mode 100644
index 00000000..0af16589
--- /dev/null
+++ b/Minecraft.Client/Orbis/Network/PsPlusUpsellWrapper_Orbis.cpp
@@ -0,0 +1,54 @@
+#include "stdafx.h"
+#include "PsPlusUpsellWrapper_Orbis.h"
+
+PsPlusUpsellWrapper::PsPlusUpsellWrapper(int userIndex)
+ : m_userIndex(userIndex)
+{
+ m_bHasResponse = false;
+}
+
+bool PsPlusUpsellWrapper::displayUpsell()
+{
+ app.DebugPrintf("<PsPlusUpsellWrapper> Bringing up system PsPlus upsell for Pad_%i.\n", m_userIndex);
+
+ sceNpCommerceDialogInitialize();
+
+ SceNpCommerceDialogParam param;
+ sceNpCommerceDialogParamInitialize(&param);
+ param.mode = SCE_NP_COMMERCE_DIALOG_MODE_PLUS;
+ param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY;
+ param.userId = ProfileManager.getUserID(m_userIndex);
+
+ sceNpCommerceDialogOpen(&param);
+
+ return true;
+}
+
+bool PsPlusUpsellWrapper::hasResponse()
+{
+ if (m_bHasResponse) return true;
+
+ if (sceNpCommerceDialogUpdateStatus() == SCE_COMMON_DIALOG_STATUS_FINISHED)
+ {
+ app.DebugPrintf(
+ "<PsPlusUpsellWrapper> Pad_%i %s an PsPlus upsell.\n",
+ m_userIndex, (m_result.authorized?"accepted":"rejected")
+ );
+
+ m_bHasResponse = true;
+
+ sceNpCommerceDialogGetResult(&m_result);
+
+ sceNpCommerceDialogTerminate();
+
+#ifndef _CONTENT_PACKAGE
+ // 4J-JEV: If HasPlayStationPlus is miraculously true now,
+ // we didn't give it enough time to update before bringing up the upsell
+ assert( ProfileManager.HasPlayStationPlus(m_userIndex) == false );
+#endif
+
+ ProfileManager.PsPlusUpdate(m_userIndex, &m_result);
+ }
+
+ return false;
+}