Skip to content

Commit dc2e4b3

Browse files
committed
improved:verification struct field size
added:verification string type field
1 parent 9ee4f67 commit dc2e4b3

File tree

1 file changed

+28
-10
lines changed

1 file changed

+28
-10
lines changed

XEngine_Module/XEngine_Verification/Verification_Define.h

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,25 @@
1010
// Purpose: 验证模块导出定义
1111
// History:
1212
*********************************************************************/
13+
//////////////////////////////////////////////////////////////////////////
14+
// 导出的枚举型
15+
//////////////////////////////////////////////////////////////////////////
16+
#ifndef _MSC_BUILD
17+
#pragma GCC diagnostic push
18+
#pragma GCC diagnostic ignored "-Wunused-variable"
19+
#endif
20+
static LPCXSTR lpszXSerialType[5] = { "UNKNOW","SECOND","DAY","TIME","CUSTOM" };
21+
static LPCXSTR lpszXRegType[6] = { "UNKNOW","TEMP","TRY","OFFICIAL","UNLIMIT","EXPIRED" };
22+
static LPCXSTR lpszXHDType[6] = { "UNKNOW","CPU","DISK","BOARD","MAC","BIOS" };
23+
static LPCXSTR lpszXVerType[6] = { "UNKNOW","LOCAL","NETWORK" };
24+
25+
static const wchar_t* lpszTSerialType[5] = { L"UNKNOW",L"SECOND",L"DAY",L"TIME",L"CUSTOM" };
26+
static const wchar_t* lpszTRegType[6] = { L"UNKNOW",L"TEMP",L"TRY",L"OFFICIAL",L"UNLIMIT",L"EXPIRED" };
27+
static const wchar_t* lpszTHDType[6] = { L"UNKNOW",L"CPU",L"DISK",L"BOARD",L"MAC",L"BIOS" };
28+
static const wchar_t* lpszTVerType[6] = { L"UNKNOW",L"LOCAL",L"NETWORK" };
29+
#ifndef _MSC_BUILD
30+
#pragma GCC diagnostic pop
31+
#endif
1332
typedef enum
1433
{
1534
ENUM_VERIFICATION_MODULE_SERIAL_TYPE_UNKNOW = 0, //无法识别的充值卡
@@ -86,20 +105,20 @@ typedef struct
86105
}VERIFICATION_TOKENINFO;
87106
typedef struct
88107
{
89-
XCHAR tszAddr[XPATH_MAX]; //服务器或者域名地址
108+
XCHAR tszAddr[XPATH_MID]; //服务器或者域名地址
90109
int nPort; //端口号码,如果>0表示CDKEY验证失败后改为网络验证
91110
//版本信息
92111
struct
93112
{
94-
XCHAR tszAppName[128]; //应用程序名称
95-
XCHAR tszAppVer[128]; //应用程序版本号
113+
XCHAR tszAppName[XPATH_MID]; //应用程序名称
114+
XCHAR tszAppVer[XPATH_MID]; //应用程序版本号
96115
__int64x nExecTime; //程序已经执行次数,调用Authorize_CDKey_GetLeftTimer会更新
97116
bool bInit; //是否初始化,由用户控制
98117
}st_AuthAppInfo;
99118
//CDKEY信息
100119
struct
101120
{
102-
XCHAR tszHardware[1024]; //硬件码
121+
XCHAR tszHardware[XPATH_MID]; //硬件码
103122
XCHAR tszCreateTime[64]; //CDKEY创建日期,年/月/日-小时:分钟:秒
104123
XCHAR tszRegisterTime[64]; //注册时间,年/月/日-小时:分钟:秒
105124
XCHAR tszLeftTime[64]; //总的剩余时间,过期日期,根据nLeftType决定此值的意义
@@ -117,30 +136,29 @@ typedef struct
117136
//次数限制
118137
struct
119138
{
120-
XCHAR tszTimeSerial[128];
139+
XCHAR tszTimeSerial[XPATH_MIN];
121140
int nTimeCount; //使用次数
122141
}st_TimeLimit;
123142
//时间限制
124143
struct
125144
{
126-
XCHAR tszDataTime[128]; //过期时间
127-
XCHAR tszDataSerial[128]; //序列号
145+
XCHAR tszDataTime[XPATH_MIN]; //过期时间
146+
XCHAR tszDataSerial[XPATH_MIN]; //序列号
128147
bool bTimeAdd; //真,过期时间是设置的日期-创建日期.假过期日期就是设定的日期
129148
}st_DataLimit;
130149
//无限制
131150
struct
132151
{
133-
XCHAR tszUNLimitSerial[128]; //无限制序列号
152+
XCHAR tszUNLimitSerial[XPATH_MIN]; //无限制序列号
134153
}st_UNLimit;
135154
}st_AuthSerial;
136155
//注册的用户信息,可以不填
137156
struct
138157
{
139158
XCHAR tszUserName[64]; //注册的用户
140159
XCHAR tszUserContact[64]; //联系方式,电子邮件或者手机等
141-
XCHAR tszCustom[1024]; //自定义数据
160+
XCHAR tszCustom[XPATH_MID]; //自定义数据
142161
}st_AuthUserInfo;
143-
144162
XCHAR tszTimeList[2048];
145163
}VERIFICATION_XAUTHKEY;
146164
//////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)