From b691c43c44ff180d10e7d4a9afc83b98551ff586 Mon Sep 17 00:00:00 2001 From: daoge_cmd <3523206925@qq.com> Date: Sun, 1 Mar 2026 12:16:08 +0800 Subject: Initial commit --- .../Orbis/Network/PsPlusUpsellWrapper_Orbis.cpp | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 Minecraft.Client/Orbis/Network/PsPlusUpsellWrapper_Orbis.cpp (limited to 'Minecraft.Client/Orbis/Network/PsPlusUpsellWrapper_Orbis.cpp') 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(" Bringing up system PsPlus upsell for Pad_%i.\n", m_userIndex); + + sceNpCommerceDialogInitialize(); + + SceNpCommerceDialogParam param; + sceNpCommerceDialogParamInitialize(¶m); + param.mode = SCE_NP_COMMERCE_DIALOG_MODE_PLUS; + param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY; + param.userId = ProfileManager.getUserID(m_userIndex); + + sceNpCommerceDialogOpen(¶m); + + return true; +} + +bool PsPlusUpsellWrapper::hasResponse() +{ + if (m_bHasResponse) return true; + + if (sceNpCommerceDialogUpdateStatus() == SCE_COMMON_DIALOG_STATUS_FINISHED) + { + app.DebugPrintf( + " 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; +} -- cgit v1.2.3