-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathStoreBrowsing.cpp
More file actions
73 lines (68 loc) · 1.62 KB
/
StoreBrowsing.cpp
File metadata and controls
73 lines (68 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include "stdafx.h"
#ifdef _PS3
#include "SignIn.h"
#include "StoreBrowsing.h"
#include "Master.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <cell/ssl.h>
#include <np/commerce2.h>
#include <netex/net.h>
#include <netex/libnetctl.h>
#include <cell/sysmodule.h>
#include <np.h>
namespace GameService
{
StoreBrowsing::StoreBrowsing()
{
bInited = false;
}
StoreBrowsing::~StoreBrowsing()
{
if(bInited)
{
int ret = 0;
ret = sceNpCommerce2Term();
if (ret < 0) {
Master::G()->Log("sceNpCommerce2Term() failed (0x%x)\n", ret);
}
ret = cellSysmoduleUnloadModule(CELL_SYSMODULE_SYSUTIL_NP_COMMERCE2);
if (ret < 0) {
Master::G()->Log("cellSysmoduleUnloadModule(CELL_SYSMODULE_SYSUTIL_NP_COMMERCE2) failed (0x%x)\n", ret);
}
}
}
void StoreBrowsing::Init()
{
int ret = 0;
ret = cellSysmoduleLoadModule(CELL_SYSMODULE_SYSUTIL_NP_COMMERCE2);
if (ret < 0) {
Master::G()->Log("cellSysmoduleLoadModule(CELL_SYSMODULE_SYSUTIL_COMMERCE2) failed (0x%x)\n", ret);
return;
}
//sceNpInit()
ret = sceNpCommerce2Init();
if (ret < 0) {
Master::G()->Log("cellSslCertificateLoader() failed (0x%x)\n", ret);
return;
}
bInited = true;
}
void StoreBrowsing::Start()
{
int ret = 0;
if(!bInited)
{
Master::G()->Log("inited failed\n");
return;
}
ret = sceNpCommerce2ExecuteStoreBrowse(
SCE_NP_COMMERCE2_STORE_BROWSE_TYPE_PRODUCT,
SignIn::GetNpProductID(), 0x87654321);
if(ret < 0){
Master::G()->Log("sceNpCommerce2ExecuteStoreBrowse() failed. ret = 0x%x\n", ret);
}
}
}
#endif