Something went wrong. Try again.
the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
Something went wrong. Try again.
41 kB · 1314 lines
C++
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314#include "stdafx.h"
#include "SonyCommerce_Orbis.h"#include "PS3\PS3Extras\ShutdownManager.h"#include <sys/event.h>
bool SonyCommerce_Orbis::m_bCommerceInitialised = false;// SceNpCommerce2SessionInfo SonyCommerce_Orbis::m_sessionInfo;SonyCommerce_Orbis::State SonyCommerce_Orbis::m_state = e_state_noSession;int SonyCommerce_Orbis::m_errorCode = 0;LPVOID SonyCommerce_Orbis::m_callbackParam = NULL;
void* SonyCommerce_Orbis::m_receiveBuffer = NULL;SonyCommerce_Orbis::Event SonyCommerce_Orbis::m_event;std::queue<SonyCommerce_Orbis::Message> SonyCommerce_Orbis::m_messageQueue;std::vector<SonyCommerce_Orbis::ProductInfo>* SonyCommerce_Orbis::m_pProductInfoList = NULL;SonyCommerce_Orbis::ProductInfoDetailed* SonyCommerce_Orbis::m_pProductInfoDetailed = NULL;SonyCommerce_Orbis::ProductInfo* SonyCommerce_Orbis::m_pProductInfo = NULL;
SonyCommerce_Orbis::CategoryInfo* SonyCommerce_Orbis::m_pCategoryInfo = NULL;const char* SonyCommerce_Orbis::m_pProductID = NULL;char* SonyCommerce_Orbis::m_pCategoryID = NULL;SonyCommerce_Orbis::CheckoutInputParams SonyCommerce_Orbis::m_checkoutInputParams;SonyCommerce_Orbis::DownloadListInputParams SonyCommerce_Orbis::m_downloadInputParams;
SonyCommerce_Orbis::CallbackFunc SonyCommerce_Orbis::m_callbackFunc = NULL;// sys_memory_container_t SonyCommerce_Orbis::m_memContainer = SYS_MEMORY_CONTAINER_ID_INVALID;bool SonyCommerce_Orbis::m_bUpgradingTrial = false;
SonyCommerce_Orbis::CallbackFunc SonyCommerce_Orbis::m_trialUpgradeCallbackFunc;LPVOID SonyCommerce_Orbis::m_trialUpgradeCallbackParam;
CRITICAL_SECTION SonyCommerce_Orbis::m_queueLock;
uint32_t SonyCommerce_Orbis::m_contextId=0; ///< The npcommerce2 context IDbool SonyCommerce_Orbis::m_contextCreated=false; ///< npcommerce2 context ID created?SonyCommerce_Orbis::Phase SonyCommerce_Orbis::m_currentPhase = e_phase_stopped; ///< Current commerce2 util// char SonyCommerce_Orbis::m_commercebuffer[SCE_NP_COMMERCE2_RECV_BUF_SIZE];
C4JThread* SonyCommerce_Orbis::m_tickThread = NULL;bool SonyCommerce_Orbis::m_bLicenseChecked=false; // Check the trial/full license for the game
sce::Toolkit::NP::Utilities::Future<std::vector<sce::Toolkit::NP::ProductInfo> > g_productList;sce::Toolkit::NP::Utilities::Future<sce::Toolkit::NP::CategoryInfo> g_categoryInfo;sce::Toolkit::NP::Utilities::Future<sce::Toolkit::NP::ProductInfoDetailed> g_detailedProductInfo;
SonyCommerce_Orbis::ProductInfoDetailed s_trialUpgradeProductInfoDetailed;void SonyCommerce_Orbis::Delete(){ m_pProductInfoList=NULL; m_pProductInfoDetailed=NULL; m_pProductInfo=NULL; m_pCategoryInfo = NULL; m_pProductID = NULL; m_pCategoryID = NULL;}
void SonyCommerce_Orbis::Init(){ assert(m_state == e_state_noSession); if(!m_bCommerceInitialised) { m_bCommerceInitialised = true; m_pCategoryID=(char *)malloc(sizeof(char) * 100); InitializeCriticalSection(&m_queueLock); }}
void SonyCommerce_Orbis::CheckForTrialUpgradeKey_Callback(LPVOID param, bool bFullVersion){ ProfileManager.SetFullVersion(bFullVersion); if(ProfileManager.IsFullVersion()) { StorageManager.SetSaveDisabled(false); ConsoleUIController::handleUnlockFullVersionCallback(); // licence has been checked, so we're ok to install the trophies now// ProfileManager.InitialiseTrophies( SQRNetworkManager_Orbis::GetSceNpCommsId(),// SQRNetworkManager_Orbis::GetSceNpCommsSig());// } m_bLicenseChecked=true;}
bool SonyCommerce_Orbis::LicenseChecked() { return m_bLicenseChecked;}
void SonyCommerce_Orbis::CheckForTrialUpgradeKey(){ StorageManager.CheckForTrialUpgradeKey(CheckForTrialUpgradeKey_Callback, NULL);}
int SonyCommerce_Orbis::Shutdown(){ int ret=0; m_bCommerceInitialised = false; if (m_contextCreated) { m_contextId = 0; m_contextCreated = false; }
delete m_pCategoryID; DeleteCriticalSection(&m_queueLock);
// clear any possible callback function m_callbackFunc = NULL; return ret;}
int SonyCommerce_Orbis::TickLoop(void* lpParam){ ShutdownManager::HasStarted(ShutdownManager::eCommerceThread); while( (m_currentPhase != e_phase_stopped) && ShutdownManager::ShouldRun(ShutdownManager::eCommerceThread) ) { processEvent(); processMessage(); Sleep(16); // sleep for a frame// ((SonyCommerce_Orbis*)app.GetCommerce())->Test(); }
Shutdown(); ShutdownManager::HasFinished(ShutdownManager::eCommerceThread);
return 0;}
void SonyCommerce_Orbis::copyProductList(std::vector<ProductInfo>* pProductList, std::vector<sce::Toolkit::NP::ProductInfo>* pNPProductList){ ProductInfo tempInfo; std::vector<ProductInfo> tempProductVec; // Reserve some space int numProducts = pNPProductList->size(); tempProductVec.reserve(numProducts); for(int i=0;i<numProducts;i++) { sce::Toolkit::NP::ProductInfo& npInfo = pNPProductList->at(i);
// reset tempInfo memset(&tempInfo, 0x0, sizeof(tempInfo)); strncpy(tempInfo.productId, npInfo.productId, SCE_NP_COMMERCE2_PRODUCT_ID_LEN); strncpy(tempInfo.productName, npInfo.productName, SCE_NP_COMMERCE2_PRODUCT_NAME_LEN); strncpy(tempInfo.shortDescription, npInfo.shortDescription, SCE_NP_COMMERCE2_PRODUCT_SHORT_DESCRIPTION_LEN); strcpy(tempInfo.longDescription,"Missing long description"); strncpy(tempInfo.spName, npInfo.spName, SCE_NP_COMMERCE2_SP_NAME_LEN); strncpy(tempInfo.imageUrl, npInfo.imageUrl, SCE_NP_COMMERCE2_URL_LEN); tempInfo.releaseDate = npInfo.releaseDate; tempInfo.purchasabilityFlag = npInfo.purchasabilityFlag; // Take out the price. Nicely formatted // but also keep the price as a value in case it's 0 - we need to show "free" for that tempInfo.ui32Price = -1;// not available here strncpy(tempInfo.price, npInfo.price, SCE_TOOLKIT_NP_SKU_PRICE_LEN); tempProductVec.push_back(tempInfo); } pNPProductList->clear(); // clear the vector now we're done, this doesn't happen automatically for the next query
// Set our result *pProductList = tempProductVec;}
int SonyCommerce_Orbis::getProductList(std::vector<ProductInfo>* productList, char *categoryId){ int ret; sce::Toolkit::NP::ProductListInputParams params; SceUserServiceUserId userId = ProfileManager.getUserID(ProfileManager.GetPrimaryPad());
params.userInfo.userId = userId; strcpy(params.categoryId, categoryId); params.serviceLabel = 0; app.DebugPrintf("Getting Product List ...\n");
ret = sce::Toolkit::NP::Commerce::Interface::getProductList(&g_productList, params, true); if (ret < 0) { app.DebugPrintf("CommerceInterface::getProductList() error. ret = 0x%x\n", ret); return ret; }
if (g_productList.hasResult()) { // result has returned immediately (don't think this should happen, but was handled in the samples copyProductList(productList, g_productList.get()); m_event = e_event_commerceGotProductList; }
return ret;}
void SonyCommerce_Orbis::copyCategoryInfo(CategoryInfo *pInfo, sce::Toolkit::NP::CategoryInfo *pNPInfo){ strcpy(pInfo->current.categoryId, pNPInfo->current.categoryId); strcpy(pInfo->current.categoryName, pNPInfo->current.categoryName); strcpy(pInfo->current.categoryDescription, pNPInfo->current.categoryDescription); strcpy(pInfo->current.imageUrl, pNPInfo->current.imageUrl); pInfo->countOfProducts = pNPInfo->countOfProducts; pInfo->countOfSubCategories = pNPInfo->countOfSubCategories; if(pInfo->countOfSubCategories > 0) { std::list<sce::Toolkit::NP::CategoryInfoSub>::iterator iter = pNPInfo->subCategories.begin(); std::list<sce::Toolkit::NP::CategoryInfoSub>::iterator iterEnd = pNPInfo->subCategories.end();
while(iter != iterEnd) { // For each sub category, obtain information CategoryInfoSub tempSubCatInfo; strcpy(tempSubCatInfo.categoryId, iter->categoryId); strcpy(tempSubCatInfo.categoryName, iter->categoryName); strcpy(tempSubCatInfo.categoryDescription, iter->categoryDescription); strcpy(tempSubCatInfo.imageUrl, iter->imageUrl); // Add to the list pInfo->subCategories.push_back(tempSubCatInfo); iter++; } }}
int SonyCommerce_Orbis::getCategoryInfo(CategoryInfo *pInfo, char *categoryId){
int ret; sce::Toolkit::NP::CategoryInfoInputParams params; SceUserServiceUserId userId = ProfileManager.getUserID(ProfileManager.GetPrimaryPad());
params.userInfo.userId = userId; strcpy(params.categoryId, "");//categoryId); params.serviceLabel = 0;
app.DebugPrintf("Getting Category Information...\n");
ret = sce::Toolkit::NP::Commerce::Interface::getCategoryInfo(&g_categoryInfo, params, true); if (ret < 0) { // error app.DebugPrintf("Commerce::Interface::getCategoryInfo error: 0x%x\n", ret); return ret; } else if (g_categoryInfo.hasResult()) { // result has returned immediately (don't think this should happen, but was handled in the samples copyCategoryInfo(pInfo, g_categoryInfo.get()); m_event = e_event_commerceGotCategoryInfo; }
return ret;}
void SonyCommerce_Orbis::copyDetailedProductInfo(ProductInfoDetailed *pInfo, sce::Toolkit::NP::ProductInfoDetailed* pNPInfo){ // populate our temp struct // pInfo->ratingDescriptors = npInfo.ratingSystemId; strncpy(pInfo->productId, pNPInfo->productId, SCE_NP_COMMERCE2_PRODUCT_ID_LEN); strncpy(pInfo->productName, pNPInfo->productName, SCE_NP_COMMERCE2_PRODUCT_NAME_LEN); strncpy(pInfo->shortDescription, pNPInfo->shortDescription, SCE_NP_COMMERCE2_PRODUCT_SHORT_DESCRIPTION_LEN); strncpy(pInfo->longDescription, pNPInfo->longDescription, SCE_NP_COMMERCE2_PRODUCT_LONG_DESCRIPTION_LEN); strncpy(pInfo->legalDescription, pNPInfo->legalDescription, SCE_NP_COMMERCE2_PRODUCT_LEGAL_DESCRIPTION_LEN); strncpy(pInfo->spName, pNPInfo->spName, SCE_NP_COMMERCE2_SP_NAME_LEN); strncpy(pInfo->imageUrl, pNPInfo->imageUrl, SCE_NP_COMMERCE2_URL_LEN); pInfo->releaseDate = pNPInfo->releaseDate; strncpy(pInfo->ratingSystemId, pNPInfo->ratingSystemId, SCE_NP_COMMERCE2_RATING_SYSTEM_ID_LEN); strncpy(pInfo->ratingImageUrl, pNPInfo->imageUrl, SCE_NP_COMMERCE2_URL_LEN); strncpy(pInfo->skuId, pNPInfo->skuId, SCE_NP_COMMERCE2_SKU_ID_LEN); pInfo->purchasabilityFlag = pNPInfo->purchasabilityFlag; pInfo->ui32Price= pNPInfo->intPrice; strncpy(pInfo->price, pNPInfo->price, SCE_TOOLKIT_NP_SKU_PRICE_LEN);
}int SonyCommerce_Orbis::getDetailedProductInfo(ProductInfoDetailed *pInfo, const char *productId, char *categoryId){ int ret; sce::Toolkit::NP::DetailedProductInfoInputParams params; SceUserServiceUserId userId = ProfileManager.getUserID(ProfileManager.GetPrimaryPad());
params.userInfo.userId = userId; strcpy(params.categoryId, categoryId); strcpy(params.productId, productId);
app.DebugPrintf("Getting Detailed Product Information ... \n"); ret = sce::Toolkit::NP::Commerce::Interface::getDetailedProductInfo(&g_detailedProductInfo, params, true); if (ret < 0) { app.DebugPrintf("CommerceInterface::getDetailedProductInfo() error. ret = 0x%x\n", ret); return ret; }
if (g_detailedProductInfo.hasResult()) { // result has returned immediately (don't think this should happen, but was handled in the samples copyDetailedProductInfo(pInfo, g_detailedProductInfo.get()); m_event = e_event_commerceGotDetailedProductInfo; } return ret;}
void SonyCommerce_Orbis::copyAddDetailedProductInfo(ProductInfo *pInfo, sce::Toolkit::NP::ProductInfoDetailed* pNPInfo){
// populate our temp struct // pInfo->ratingDescriptors = npInfo.ratingSystemId; // strncpy(pInfo->productId, npInfo.productId, SCE_NP_COMMERCE2_PRODUCT_ID_LEN); // strncpy(pInfo->productName, npInfo.productName, SCE_NP_COMMERCE2_PRODUCT_NAME_LEN); // strncpy(pInfo->shortDescription, npInfo.shortDescription, SCE_NP_COMMERCE2_PRODUCT_SHORT_DESCRIPTION_LEN); strncpy(pInfo->longDescription, pNPInfo->longDescription, SCE_NP_COMMERCE2_PRODUCT_LONG_DESCRIPTION_LEN); // strncpy(pInfo->legalDescription, npInfo.legalDescription, SCE_NP_COMMERCE2_PRODUCT_LEGAL_DESCRIPTION_LEN); // strncpy(pInfo->spName, npInfo.spName, SCE_NP_COMMERCE2_SP_NAME_LEN); // strncpy(pInfo->imageUrl, npInfo.imageUrl, SCE_NP_COMMERCE2_URL_LEN); // pInfo->releaseDate = npInfo.releaseDate; // strncpy(pInfo->ratingSystemId, npInfo.ratingSystemId, SCE_NP_COMMERCE2_RATING_SYSTEM_ID_LEN); // strncpy(pInfo->ratingImageUrl, npInfo.imageUrl, SCE_NP_COMMERCE2_URL_LEN); strncpy(pInfo->skuId, pNPInfo->skuId, SCE_NP_COMMERCE2_SKU_ID_LEN); pInfo->purchasabilityFlag = pNPInfo->purchasabilityFlag; pInfo->ui32Price= pNPInfo->intPrice; strncpy(pInfo->price, pNPInfo->price, SCE_TOOLKIT_NP_SKU_PRICE_LEN);
}
int SonyCommerce_Orbis::addDetailedProductInfo(ProductInfo *pInfo, const char *productId, char *categoryId){ int ret; sce::Toolkit::NP::DetailedProductInfoInputParams params; SceUserServiceUserId userId = ProfileManager.getUserID(ProfileManager.GetPrimaryPad());
params.userInfo.userId = userId; strcpy(params.categoryId, categoryId); strcpy(params.productId, productId);
app.DebugPrintf("Getting Detailed Product Information ... \n"); ret = sce::Toolkit::NP::Commerce::Interface::getDetailedProductInfo(&g_detailedProductInfo, params, true); if (ret < 0) { app.DebugPrintf("CommerceInterface::addDetailedProductInfo() error. ret = 0x%x\n", ret); }
if (g_detailedProductInfo.hasResult()) { // result has returned immediately (don't think this should happen, but was handled in the samples copyAddDetailedProductInfo(pInfo, g_detailedProductInfo.get()); m_event = e_event_commerceAddedDetailedProductInfo; } return ret;}
int SonyCommerce_Orbis::checkout(CheckoutInputParams ¶ms){
int ret; sce::Toolkit::NP::CheckoutInputParams npParams; SceUserServiceUserId userId = ProfileManager.getUserID(ProfileManager.GetPrimaryPad()); npParams.userInfo.userId = userId; npParams.serviceLabel = 0;
std::list<const char*>::iterator iter = params.skuIds.begin(); std::list<const char*>::iterator iterEnd = params.skuIds.end(); while(iter != iterEnd) { npParams.skuIds.push_back((char*)*iter); // have to remove the const here, not sure why the libs pointers aren't const iter++; }
app.DebugPrintf("Starting Checkout...\n");
ret = sce::Toolkit::NP::Commerce::Interface::checkout(npParams, false); if (ret < 0) { app.DebugPrintf("Sample menu checkout() error. ret = 0x%x\n", ret); }
return ret; }
int SonyCommerce_Orbis::downloadList(DownloadListInputParams ¶ms){ int ret; sce::Toolkit::NP::DownloadListInputParams npParams; //memset(&npParams,0,sizeof(sce::Toolkit::NP::DownloadListInputParams)); SceUserServiceUserId userId = ProfileManager.getUserID(ProfileManager.GetPrimaryPad()); npParams.userInfo.userId = userId; npParams.serviceLabel = 0; npParams.skuIds.clear();
std::list<const char*>::iterator iter = params.skuIds.begin(); std::list<const char*>::iterator iterEnd = params.skuIds.end(); while(iter != iterEnd) { npParams.skuIds.push_back((char*)*iter); // have to remove the const here, not sure why the libs pointers aren't const iter++; }
app.DebugPrintf("Starting Store Download List...\n"); ret = sce::Toolkit::NP::Commerce::Interface::displayDownloadList(npParams, true); if (ret < 0) { app.DebugPrintf("Commerce::Interface::displayDownloadList error: 0x%x\n", ret); }
return ret; }
int SonyCommerce_Orbis::checkout_game(CheckoutInputParams ¶ms){
int ret; sce::Toolkit::NP::CheckoutInputParams npParams; SceUserServiceUserId userId = ProfileManager.getUserID(ProfileManager.GetPrimaryPad()); npParams.userInfo.userId = userId; npParams.serviceLabel = 0;
std::list<const char*>::iterator iter = params.skuIds.begin(); std::list<const char*>::iterator iterEnd = params.skuIds.end(); while(iter != iterEnd) { npParams.skuIds.push_back((char*)*iter); // have to remove the const here, not sure why the libs pointers aren't const iter++; }
app.DebugPrintf("Starting Checkout...\n"); sce::Toolkit::NP::ProductBrowseParams Myparams;
Myparams.serviceLabel = 0; Myparams.userInfo.userId = userId; strncpy(Myparams.productId, "MINECRAFTPS40000", strlen("MINECRAFTPS40000"));
ret = sce::Toolkit::NP::Commerce::Interface::productBrowse(Myparams, false); if (ret < 0) { // Error handling }
//ret = sce::Toolkit::NP::Commerce::Interface::checkout(npParams, false); if (ret < 0) { app.DebugPrintf("Sample menu checkout() error. ret = 0x%x\n", ret); }
return ret; }
int SonyCommerce_Orbis::downloadList_game(DownloadListInputParams ¶ms){
int ret; sce::Toolkit::NP::DownloadListInputParams npParams; //memset(&npParams,0,sizeof(sce::Toolkit::NP::DownloadListInputParams)); SceUserServiceUserId userId = ProfileManager.getUserID(ProfileManager.GetPrimaryPad()); npParams.userInfo.userId = userId; npParams.serviceLabel = 0; npParams.skuIds.clear();
std::list<const char*>::iterator iter = params.skuIds.begin(); std::list<const char*>::iterator iterEnd = params.skuIds.end(); while(iter != iterEnd) { npParams.skuIds.push_back((char*)*iter); // have to remove the const here, not sure why the libs pointers aren't const iter++; }
app.DebugPrintf("Starting Store Download List...\n");// ret = sce::Toolkit::NP::Commerce::Interface::displayDownloadList(npParams, true);// if (ret < 0) // {// app.DebugPrintf("Commerce::Interface::displayDownloadList error: 0x%x\n", ret);// }
sce::Toolkit::NP::ProductBrowseParams Myparams;
Myparams.serviceLabel = 0; Myparams.userInfo.userId = userId; strncpy(Myparams.productId, "MINECRAFTPS40000", strlen("MINECRAFTPS40000"));
ret = sce::Toolkit::NP::Commerce::Interface::productBrowse(Myparams, false); if (ret < 0) { // Error handling app.DebugPrintf("Commerce::Interface::displayDownloadList error: 0x%x\n", ret); }
return ret; }
void SonyCommerce_Orbis::UpgradeTrialCallback2(LPVOID lpParam,int err){ SonyCommerce* pCommerce = (SonyCommerce*)lpParam; app.DebugPrintf(4,"SonyCommerce_UpgradeTrialCallback2 : err : 0x%08x\n", err); pCommerce->CheckForTrialUpgradeKey(); if(err != SCE_OK) { UINT uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; C4JStorage::EMessageResult result = ui.RequestMessageBox( IDS_PRO_UNLOCKGAME_TITLE, IDS_NO_DLCOFFERS, uiIDA,1,ProfileManager.GetPrimaryPad()); } m_trialUpgradeCallbackFunc(m_trialUpgradeCallbackParam, m_errorCode);}
void SonyCommerce_Orbis::UpgradeTrialCallback1(LPVOID lpParam,int err){ SonyCommerce* pCommerce = (SonyCommerce*)lpParam; app.DebugPrintf(4,"SonyCommerce_UpgradeTrialCallback1 : err : 0x%08x\n", err); if(err == SCE_OK) { char* skuID = s_trialUpgradeProductInfoDetailed.skuId; if(s_trialUpgradeProductInfoDetailed.purchasabilityFlag == SCE_TOOLKIT_NP_COMMERCE_NOT_PURCHASED) { app.DebugPrintf(4,"UpgradeTrialCallback1 - Checkout\n"); pCommerce->Checkout_Game(UpgradeTrialCallback2, pCommerce, skuID);
} else { app.DebugPrintf(4,"UpgradeTrialCallback1 - DownloadAlreadyPurchased\n"); pCommerce->DownloadAlreadyPurchased_Game(UpgradeTrialCallback2, pCommerce, skuID); } } else { UINT uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; C4JStorage::EMessageResult result = ui.RequestMessageBox( IDS_PRO_UNLOCKGAME_TITLE, IDS_NO_DLCOFFERS, uiIDA,1,ProfileManager.GetPrimaryPad()); m_trialUpgradeCallbackFunc(m_trialUpgradeCallbackParam, m_errorCode); }}
// global func, so we can call from the profile libvoid SonyCommerce_UpgradeTrial(){ // we're now calling the app function here, which manages pending requests app.UpgradeTrial();}
void SonyCommerce_Orbis::UpgradeTrial(CallbackFunc cb, LPVOID lpParam){ m_trialUpgradeCallbackFunc = cb; m_trialUpgradeCallbackParam = lpParam; // static char szTrialUpgradeSkuID[64];// sprintf(szTrialUpgradeSkuID, "%s-TRIALUPGRADE0001", app.GetCommerceCategory());//, szSKUSuffix); GetDetailedProductInfo(UpgradeTrialCallback1, this, &s_trialUpgradeProductInfoDetailed, app.GetUpgradeKey(), app.GetCommerceCategory());}
int SonyCommerce_Orbis::createContext(){// SceNpId npId;// int ret = sceNpManagerGetNpId(&npId);// if(ret < 0)// {// app.DebugPrintf(4,"createContext sceNpManagerGetNpId problem\n");// return ret;// }// // if (m_contextCreated) {// ret = sceNpCommerce2DestroyCtx(m_contextId);// if (ret < 0) // {// app.DebugPrintf(4,"createContext sceNpCommerce2DestroyCtx problem\n");// return ret;// }// }// // // Create commerce2 context// ret = sceNpCommerce2CreateCtx(SCE_NP_COMMERCE2_VERSION, &npId, commerce2Handler, NULL, &m_contextId);// if (ret < 0) // {// app.DebugPrintf(4,"createContext sceNpCommerce2CreateCtx problem\n");// return ret;// }
m_contextCreated = true;
return SCE_OK;}
int SonyCommerce_Orbis::createSession(){ // From the Sony docs // // sce::Toolkit::NP::Commerce::Interface::CreateSession // // This function is provided to maintain compatibility with the PlayStation�Vita and PlayStation�3 platforms. Because commerce on the PlayStation�4 is not session based, SCE_TOOLKIT_NP_SUCCESS is always returned.
int ret = sce::Toolkit::NP::Commerce::Interface::createSession();
if (ret < 0) { return ret; } m_currentPhase = e_phase_creatingSessionPhase;
return ret;}
void SonyCommerce_Orbis::commerce2Handler( const sce::Toolkit::NP::Event& event){// Event reply;// reply.service = Toolkit::NP::commerce;// if(m_bCommerceInitialised==false) { // 4J-PB - this happens when we've signed out of the PSn, and we were in the process of retrieving DLC product info // Ignore this event app.DebugPrintf("@@@@@@@@ IGNORING COMMERCE EVENT AFTER COMMERCE SHUTDOWN @@@@@@@@@\n"); return; } EnterCriticalSection(&m_queueLock);
switch (event.event) { case sce::Toolkit::NP::Event::UserEvent::commerceError: { m_messageQueue.push(e_message_commerceEnd); m_errorCode = event.returnCode; break; } case sce::Toolkit::NP::Event::UserEvent::commerceSessionCreated: { m_messageQueue.push(e_message_commerceEnd); m_event = e_event_commerceSessionCreated; break; } case sce::Toolkit::NP::Event::UserEvent::commerceSessionAborted: { m_messageQueue.push(e_message_commerceEnd); m_event = e_event_commerceSessionAborted; break; } case sce::Toolkit::NP::Event::UserEvent::commerceCheckoutStarted: { m_currentPhase = e_phase_checkoutPhase; m_event = e_event_commerceCheckoutStarted; break; } case sce::Toolkit::NP::Event::UserEvent::commerceGotCategoryInfo: { copyCategoryInfo(m_pCategoryInfo, g_categoryInfo.get()); m_pCategoryInfo = NULL; m_event = e_event_commerceGotCategoryInfo; break; }
case sce::Toolkit::NP::Event::UserEvent::commerceGotProductList: { copyProductList(m_pProductInfoList, g_productList.get()); m_pProductInfoDetailed = NULL; m_event = e_event_commerceGotProductList; break; }
case sce::Toolkit::NP::Event::UserEvent::commerceGotDetailedProductInfo: { if(m_pProductInfoDetailed) { copyDetailedProductInfo(m_pProductInfoDetailed, g_detailedProductInfo.get()); m_pProductInfoDetailed = NULL; } else { copyAddDetailedProductInfo(m_pProductInfo, g_detailedProductInfo.get()); m_pProductInfo = NULL; } m_event = e_event_commerceGotDetailedProductInfo; break; }
// case SCE_NP_COMMERCE2_EVENT_DO_CHECKOUT_SUCCESS:// {// m_messageQueue.push(e_message_commerceEnd);// m_event = e_event_commerceCheckoutSuccess;// break;// }// case SCE_NP_COMMERCE2_EVENT_DO_CHECKOUT_BACK:// {// m_messageQueue.push(e_message_commerceEnd);// m_event = e_event_commerceCheckoutAborted;// break;// } case sce::Toolkit::NP::Event::UserEvent::commerceCheckoutFinished: { m_event = e_event_commerceCheckoutFinished; break; } case sce::Toolkit::NP::Event::UserEvent::commerceDownloadListStarted: { m_currentPhase = e_phase_downloadListPhase; m_event = e_event_commerceDownloadListStarted; break; }// case SCE_NP_COMMERCE2_EVENT_DO_DL_LIST_SUCCESS:// {// m_messageQueue.push(e_message_commerceEnd);// m_event = e_event_commerceDownloadListSuccess;// break;// } case sce::Toolkit::NP::Event::UserEvent::commerceDownloadListFinished: { m_event = e_event_commerceDownloadListFinished; break; }
case sce::Toolkit::NP::Event::UserEvent::commerceProductBrowseStarted: { m_currentPhase = e_phase_productBrowsePhase; m_event = e_event_commerceProductBrowseStarted; break; } case sce::Toolkit::NP::Event::UserEvent::commerceProductBrowseSuccess: { m_messageQueue.push(e_message_commerceEnd); m_event = e_event_commerceProductBrowseSuccess; break; } case sce::Toolkit::NP::Event::UserEvent::commerceProductBrowseAborted: { m_messageQueue.push(e_message_commerceEnd); m_event = e_event_commerceProductBrowseAborted; break; } case sce::Toolkit::NP::Event::UserEvent::commerceProductBrowseFinished: { m_event = e_event_commerceProductBrowseFinished; break; }
// case SCE_NP_COMMERCE2_EVENT_DO_PROD_BROWSE_OPENED:// break;// case SCE_NP_COMMERCE2_EVENT_DO_PRODUCT_CODE_STARTED:// {// m_currentPhase = e_phase_voucherRedeemPhase;// m_event = e_event_commerceVoucherInputStarted;// break;// }// case SCE_NP_COMMERCE2_EVENT_DO_PRODUCT_CODE_SUCCESS:// {// m_messageQueue.push(e_message_commerceEnd);// m_event = e_event_commerceVoucherInputSuccess; // break;// }// case SCE_NP_COMMERCE2_EVENT_DO_PRODUCT_CODE_BACK:// {// m_messageQueue.push(e_message_commerceEnd);// m_event = e_event_commerceVoucherInputAborted;// break;// }// case SCE_NP_COMMERCE2_EVENT_DO_PRODUCT_CODE_FINISHED:// {// m_event = e_event_commerceVoucherInputFinished;// break;// } default: break; };
LeaveCriticalSection(&m_queueLock);}
void SonyCommerce_Orbis::processMessage(){ EnterCriticalSection(&m_queueLock); int ret; if(m_messageQueue.empty()) { LeaveCriticalSection(&m_queueLock); return; } Message msg = m_messageQueue.front(); m_messageQueue.pop();
switch (msg) {
case e_message_commerceCreateSession: ret = createSession(); if (ret < 0) { m_event = e_event_commerceError; m_errorCode = ret; } break;
case e_message_commerceGetCategoryInfo: { ret = getCategoryInfo(m_pCategoryInfo, m_pCategoryID); if (ret < 0) { m_event = e_event_commerceError; app.DebugPrintf(4,"ERROR - e_event_commerceGotCategoryInfo - %s\n",m_pCategoryID); m_errorCode = ret; } break; }
case e_message_commerceGetProductList: { ret = getProductList(m_pProductInfoList, m_pCategoryID); if (ret < 0) { m_event = e_event_commerceError; } break; }
case e_message_commerceGetDetailedProductInfo: { ret = getDetailedProductInfo(m_pProductInfoDetailed, m_pProductID, m_pCategoryID); if (ret < 0) { m_event = e_event_commerceError; m_errorCode = ret; } break; } case e_message_commerceAddDetailedProductInfo: { ret = addDetailedProductInfo(m_pProductInfo, m_pProductID, m_pCategoryID); if (ret < 0) { m_event = e_event_commerceError; m_errorCode = ret; } break; }
// // case e_message_commerceStoreProductBrowse:// {// ret = productBrowse(*(ProductBrowseParams *)msg.inputArgs);// if (ret < 0) {// m_event = e_event_commerceError;// m_errorCode = ret;// } // _TOOLKIT_NP_DEL (ProductBrowseParams *)msg.inputArgs;// break;// }// // case e_message_commerceUpgradeTrial:// {// ret = upgradeTrial();// if (ret < 0) {// m_event = e_event_commerceError;// m_errorCode = ret;// } // break;// }// // case e_message_commerceRedeemVoucher:// {// ret = voucherCodeInput(*(VoucherInputParams *)msg.inputArgs);// if (ret < 0) {// m_event = e_event_commerceError;// m_errorCode = ret;// } // _TOOLKIT_NP_DEL (VoucherInputParams *)msg.inputArgs;// break;// }// // case e_message_commerceGetEntitlementList:// { // Job<std::vector<SceNpEntitlement> > tmpJob(static_cast<Future<std::vector<SceNpEntitlement> > *>(msg.output));// // int state = 0;// int ret = sceNpManagerGetStatus(&state);// // // We don't want to process this if we are offline// if (ret < 0 || state != SCE_NP_MANAGER_STATUS_ONLINE) {// m_event = e_event_commerceError;// reply.returnCode = SCE_TOOLKIT_NP_OFFLINE;// tmpJob.setError(SCE_TOOLKIT_NP_OFFLINE);// } else {// getEntitlementList(&tmpJob);// }// break;// }// // case e_message_commerceConsumeEntitlement:// { // int state = 0;// int ret = sceNpManagerGetStatus(&state);// // // We don't want to process this if we are offline// if (ret < 0 || state != SCE_NP_MANAGER_STATUS_ONLINE) {// m_event = e_event_commerceError;// reply.returnCode = SCE_TOOLKIT_NP_OFFLINE;// } else {// // ret = consumeEntitlement(*(EntitlementToConsume *)msg.inputArgs);// if (ret < 0) {// m_event = e_event_commerceError;// m_errorCode = ret;// } else { // m_event = e_event_commerceConsumedEntitlement;// }// }// _TOOLKIT_NP_DEL (EntitlementToConsume *)msg.inputArgs;// // break;// }// case e_message_commerceCheckout: { ret = checkout(m_checkoutInputParams); if (ret < 0) { m_event = e_event_commerceError; m_errorCode = ret; } break; }
case e_message_commerceDownloadList: { ret = downloadList(m_downloadInputParams); if (ret < 0) { m_event = e_event_commerceError; m_errorCode = ret; } break; }
case e_message_commerceCheckout_Game: { ret = checkout_game(m_checkoutInputParams); if (ret < 0) { m_event = e_event_commerceError; m_errorCode = ret; } break; }
case e_message_commerceDownloadList_Game: { ret = downloadList_game(m_downloadInputParams); if (ret < 0) { m_event = e_event_commerceError; m_errorCode = ret; } break; }
case e_message_commerceEnd: app.DebugPrintf("XXX - e_message_commerceEnd!\n"); ret = commerceEnd(); if (ret < 0) { m_event = e_event_commerceError; m_errorCode = ret; } // 4J-PB - we don't seem to handle the error code here else if(m_errorCode!=0) { m_event = e_event_commerceError; } break;
default: break; }
LeaveCriticalSection(&m_queueLock);}
void SonyCommerce_Orbis::processEvent(){ int ret = 0;
switch (m_event) { case e_event_none: break; case e_event_commerceSessionCreated: app.DebugPrintf(4,"Commerce Session Created.\n"); runCallback(); break; case e_event_commerceSessionAborted: app.DebugPrintf(4,"Commerce Session aborted.\n"); runCallback(); break; case e_event_commerceGotProductList: app.DebugPrintf(4,"Got product list.\n"); runCallback(); break; case e_event_commerceGotCategoryInfo: app.DebugPrintf(4,"Got category info\n"); runCallback(); break; case e_event_commerceGotDetailedProductInfo: app.DebugPrintf(4,"Got detailed product info.\n"); runCallback(); break; case e_event_commerceAddedDetailedProductInfo: app.DebugPrintf(4,"Added detailed product info.\n"); runCallback(); break; case e_event_commerceProductBrowseStarted: break; case e_event_commerceProductBrowseSuccess: break; case e_event_commerceProductBrowseAborted: break; case e_event_commerceProductBrowseFinished: app.DebugPrintf(4,"e_event_commerceProductBrowseFinished succeeded: 0x%x\n", m_errorCode);
if(m_callbackFunc!=NULL) { runCallback(); }
//assert(0);// ret = sys_memory_container_destroy(s_memContainer);// if (ret < 0) {// printf("Failed to destroy memory container");// }// s_memContainer = SYS_MEMORY_CONTAINER_ID_INVALID; break; case e_event_commerceVoucherInputStarted: break; case e_event_commerceVoucherInputSuccess: break; case e_event_commerceVoucherInputAborted: break; case e_event_commerceVoucherInputFinished: assert(0);// ret = sys_memory_container_destroy(s_memContainer);// if (ret < 0) {// printf("Failed to destroy memory container");// }// s_memContainer = SYS_MEMORY_CONTAINER_ID_INVALID; break; case e_event_commerceGotEntitlementList: break; case e_event_commerceConsumedEntitlement: break; case e_event_commerceCheckoutStarted: app.DebugPrintf(4,"Checkout Started\n"); break; case e_event_commerceCheckoutSuccess: app.DebugPrintf(4,"Checkout succeeded: 0x%x\n", m_errorCode); // clear the DLC installed and check again app.ClearDLCInstalled(); ui.HandleDLCInstalled(0); break; case e_event_commerceCheckoutAborted: app.DebugPrintf(4,"Checkout aborted: 0x%x\n", m_errorCode); break; case e_event_commerceCheckoutFinished: app.DebugPrintf(4,"Checkout Finished: 0x%x\n", m_errorCode); if (ret < 0) { app.DebugPrintf(4,"Failed to destroy memory container"); }
// 4J-PB - if there's been an error - like dlc already purchased, the runcallback has already happened, and will crash this time if(m_callbackFunc!=NULL) { runCallback(); } break; case e_event_commerceDownloadListStarted: app.DebugPrintf(4,"Download List Started\n"); break; case e_event_commerceDownloadListSuccess: app.DebugPrintf(4,"Download succeeded: 0x%x\n", m_errorCode); break; case e_event_commerceDownloadListFinished: app.DebugPrintf(4,"Download Finished: 0x%x\n", m_errorCode); if (ret < 0) { app.DebugPrintf(4,"Failed to destroy memory container"); }
// 4J-PB - if there's been an error - like dlc already purchased, the runcallback has already happened, and will crash this time if(m_callbackFunc!=NULL) { runCallback(); } break; case e_event_commerceError: app.DebugPrintf(4,"Commerce Error 0x%x\n", m_errorCode); runCallback(); break; default: break; } m_event = e_event_none;}
int SonyCommerce_Orbis::commerceEnd(){ int ret = 0;
// if (m_currentPhase == e_phase_voucherRedeemPhase)// ret = sceNpCommerce2DoProductCodeFinishAsync(m_contextId);// else if (m_currentPhase == e_phase_productBrowsePhase)// ret = sceNpCommerce2DoProductBrowseFinishAsync(m_contextId);// else if (m_currentPhase == e_phase_creatingSessionPhase)// ret = sceNpCommerce2CreateSessionFinish(m_contextId, &m_sessionInfo);// else if (m_currentPhase == e_phase_checkoutPhase)// ret = sceNpCommerce2DoCheckoutFinishAsync(m_contextId);// else if (m_currentPhase == e_phase_downloadListPhase)// ret = sceNpCommerce2DoDlListFinishAsync(m_contextId); m_currentPhase = e_phase_idle;
return ret;}
void SonyCommerce_Orbis::CreateSession( CallbackFunc cb, LPVOID lpParam ){ // 4J-PB - reset any previous error code // I had this happen when I was offline on Vita, and accepted the PSN sign-in // the m_errorCode was picked up in the message queue after the commerce init call if(m_errorCode!=0) { app.DebugPrintf("m_errorCode was set!\n"); m_errorCode=0; } Init(); EnterCriticalSection(&m_queueLock); setCallback(cb,lpParam);
// We don't need to create a session on PS4, from the Sony docs - // This function is provided to maintain compatibility with the PlayStation�Vita and PlayStation�3 // platforms. Because commerce on the PlayStation�4 is not session based, SCE_TOOLKIT_NP_SUCCESS is always returned.
// m_messageQueue.push(e_message_commerceCreateSession); m_messageQueue.push(e_message_commerceEnd); m_event = e_event_commerceSessionCreated;
if(m_tickThread == NULL) m_tickThread = new C4JThread(TickLoop, NULL, "SonyCommerce_Orbis tick"); if(m_tickThread->isRunning() == false) { m_currentPhase = e_phase_idle; m_tickThread->Run(); } LeaveCriticalSection(&m_queueLock);}
void SonyCommerce_Orbis::CloseSession(){ assert(m_currentPhase == e_phase_idle); m_currentPhase = e_phase_stopped; // 4J-PB - don't call shutdown here - the SonyCommerce_Orbis::TickLoop thread is still running and could crash accessing the critical section that Shutdown destroys //Shutdown();}
void SonyCommerce_Orbis::GetProductList( CallbackFunc cb, LPVOID lpParam, std::vector<ProductInfo>* productList, const char *categoryId){ EnterCriticalSection(&m_queueLock); setCallback(cb,lpParam); m_pProductInfoList = productList; strcpy(m_pCategoryID,categoryId); m_messageQueue.push(e_message_commerceGetProductList); LeaveCriticalSection(&m_queueLock);}
void SonyCommerce_Orbis::GetDetailedProductInfo( CallbackFunc cb, LPVOID lpParam, ProductInfoDetailed* productInfo, const char *productId, const char *categoryId ){ EnterCriticalSection(&m_queueLock); setCallback(cb,lpParam); m_pProductInfoDetailed = productInfo; m_pProductID = productId; strcpy(m_pCategoryID,categoryId); m_messageQueue.push(e_message_commerceGetDetailedProductInfo); LeaveCriticalSection(&m_queueLock);}
// 4J-PB - fill out the long description and the price for the productvoid SonyCommerce_Orbis::AddDetailedProductInfo( CallbackFunc cb, LPVOID lpParam, ProductInfo* productInfo, const char *productId, const char *categoryId ){ EnterCriticalSection(&m_queueLock); setCallback(cb,lpParam); m_pProductInfo = productInfo; m_pProductID = productId; strcpy(m_pCategoryID,categoryId); m_messageQueue.push(e_message_commerceAddDetailedProductInfo); LeaveCriticalSection(&m_queueLock);}void SonyCommerce_Orbis::GetCategoryInfo( CallbackFunc cb, LPVOID lpParam, CategoryInfo *info, const char *categoryId ){ EnterCriticalSection(&m_queueLock); setCallback(cb,lpParam); m_pCategoryInfo = info; strcpy(m_pCategoryID,categoryId); m_messageQueue.push(e_message_commerceGetCategoryInfo); LeaveCriticalSection(&m_queueLock);}
void SonyCommerce_Orbis::Checkout( CallbackFunc cb, LPVOID lpParam, const char* skuID ){ EnterCriticalSection(&m_queueLock); setCallback(cb,lpParam); m_checkoutInputParams.skuIds.clear(); m_checkoutInputParams.skuIds.push_back(skuID); m_messageQueue.push(e_message_commerceCheckout); LeaveCriticalSection(&m_queueLock);}
void SonyCommerce_Orbis::DownloadAlreadyPurchased( CallbackFunc cb, LPVOID lpParam, const char* skuID ){ EnterCriticalSection(&m_queueLock); setCallback(cb,lpParam); m_downloadInputParams.skuIds.clear(); m_downloadInputParams.skuIds.push_back(skuID); m_messageQueue.push(e_message_commerceDownloadList); LeaveCriticalSection(&m_queueLock);}
void SonyCommerce_Orbis::Checkout_Game( CallbackFunc cb, LPVOID lpParam, const char* skuID ){ EnterCriticalSection(&m_queueLock); setCallback(cb,lpParam); m_checkoutInputParams.skuIds.clear(); m_checkoutInputParams.skuIds.push_back(skuID); m_messageQueue.push(e_message_commerceCheckout_Game); LeaveCriticalSection(&m_queueLock);}void SonyCommerce_Orbis::DownloadAlreadyPurchased_Game( CallbackFunc cb, LPVOID lpParam, const char* skuID ){ EnterCriticalSection(&m_queueLock); setCallback(cb,lpParam); m_downloadInputParams.skuIds.clear(); m_downloadInputParams.skuIds.push_back(skuID); m_messageQueue.push(e_message_commerceDownloadList_Game); LeaveCriticalSection(&m_queueLock);}
/*bool g_bDoCommerceCreateSession = false;bool g_bDoCommerceGetProductList = false;bool g_bDoCommerceGetCategoryInfo = false;bool g_bDoCommerceGetProductInfoDetailed = false;bool g_bDoCommerceCheckout = false;bool g_bDoCommerceCloseSession = false;const char* g_category = "EP4433-CUSA00265_00";const char* g_skuID = "SKINPACK00000001-E001";std::vector<SonyCommerce::ProductInfo> g_productInfo;SonyCommerce::CategoryInfo g_categoryInfo2;SonyCommerce::ProductInfoDetailed g_productInfoDetailed;
void testCallback(LPVOID lpParam, int error_code){ app.DebugPrintf("Callback hit, error 0x%08x\n", error_code);}
void SonyCommerce_Orbis::Test(){ int err = SCE_OK; if(g_bDoCommerceCreateSession) { CreateSession(testCallback, this); g_bDoCommerceCreateSession = false; } if(g_bDoCommerceGetProductList) { GetProductList(testCallback, this, &g_productInfo, g_category); g_bDoCommerceGetProductList = false; }
if(g_bDoCommerceGetCategoryInfo) { GetCategoryInfo(testCallback, this, &g_categoryInfo2, g_category); g_bDoCommerceGetCategoryInfo = false; }
if(g_bDoCommerceGetProductInfoDetailed) { GetDetailedProductInfo(testCallback, this, &g_productInfoDetailed, g_productInfo[0].productId, g_category); g_bDoCommerceGetProductInfoDetailed = false; }
if(g_bDoCommerceCheckout) { //Checkout(testCallback, this, g_skuID);//g_productInfoDetailed.skuId); Checkout(testCallback, this, g_productInfoDetailed.skuId); g_bDoCommerceCheckout = false; } if(g_bDoCommerceCloseSession) { CloseSession(); g_bDoCommerceCloseSession = false; }
}*/