Skip to content

Commit d6e69a7

Browse files
committed
modify:custom serial type for try verification
1 parent 4c511f5 commit d6e69a7

File tree

5 files changed

+40
-7
lines changed

5 files changed

+40
-7
lines changed

XEngine_Module/XEngine_Verification/Verification_Define.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ extern "C" bool Verification_XAuthKey_ReadMemory(LPCXSTR lpszMsgBuffer, int nMsg
773773
意思:是否成功
774774
备注:
775775
*********************************************************************/
776-
extern "C" bool Verification_XAuthNet_TryRequest(LPCXSTR lpszURLAddr, LPCXSTR lpszPass = NULL, int* pInt_Type = NULL);
776+
extern "C" bool Verification_XAuthNet_TryRequest(LPCXSTR lpszURLAddr, LPCXSTR lpszPass = NULL, int* pInt_Type = NULL, ENUM_VERIFICATION_MODULE_HW_TYPE enHWType = ENUM_VERIFICATION_MODULE_HW_TYPE_BOARD);
777777
/********************************************************************
778778
函数名称:Verification_XAuthNet_GetDCode
779779
函数功能:获取动态码

XEngine_Module/XEngine_Verification/Verification_Error.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,5 @@
4040
#define ERROR_XENGINE_MODULE_VERIFICATION_XAUTH_CODE 0x01E2013 //服务器返回的CODE错误
4141
#define ERROR_XENGINE_MODULE_VERIFICATION_XAUTH_THREAD 0x01E2014 //创建线程失败
4242
#define ERROR_XENGINE_MODULE_VERIFICATION_XAUTH_NOTAUTH 0x01E2015 //没有验证无法继续
43-
#define ERROR_XENGINE_MODULE_VERIFICATION_XAUTH_NOLOGIN 0x01E2016 //没有登录无法继续
43+
#define ERROR_XENGINE_MODULE_VERIFICATION_XAUTH_NOLOGIN 0x01E2016 //没有登录无法继续
44+
#define ERROR_XENGINE_MODULE_VERIFICATION_XAUTH_GETSERIAL 0x01E2017 //获取硬件序列号失败

XEngine_Module/XEngine_Verification/Verification_XAuth/Verification_XAuthNet.cpp

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,17 @@ CVerification_XAuthNet::~CVerification_XAuthNet()
3838
类型:整数型指针
3939
可空:Y
4040
意思:输出验证类型
41+
参数.四:enHWType
42+
In/Out:Out
43+
类型:枚举型
44+
可空:Y
45+
意思:输入序列号类型
4146
返回值
4247
类型:逻辑型
4348
意思:是否成功
4449
备注:
4550
*********************************************************************/
46-
bool CVerification_XAuthNet::Verification_XAuthNet_TryRequest(LPCXSTR lpszURLAddr, LPCXSTR lpszPass /* = NULL */, int* pInt_Type /* = NULL */)
51+
bool CVerification_XAuthNet::Verification_XAuthNet_TryRequest(LPCXSTR lpszURLAddr, LPCXSTR lpszPass /* = NULL */, int* pInt_Type /* = NULL */, ENUM_VERIFICATION_MODULE_HW_TYPE enHWType /* = ENUM_VERIFICATION_MODULE_HW_TYPE_BOARD */)
4752
{
4853
Verification_IsErrorOccur = true;
4954

@@ -63,7 +68,34 @@ bool CVerification_XAuthNet::Verification_XAuthNet_TryRequest(LPCXSTR lpszURLAdd
6368
LPCXSTR lpszCustomHdr = _X("Content-Type: application/json\r\n");
6469

6570
SystemApi_HardWare_GetSerial(&st_SDKSerial);
66-
_xstprintf(tszJsonStr, _X("%s"), st_SDKSerial.tszBoardSerial);
71+
72+
if (ENUM_VERIFICATION_MODULE_HW_TYPE_BOARD == enHWType)
73+
{
74+
_xstprintf(tszJsonStr, _X("%s"), st_SDKSerial.tszBoardSerial);
75+
}
76+
else if (ENUM_VERIFICATION_MODULE_HW_TYPE_CPU == enHWType)
77+
{
78+
_xstprintf(tszJsonStr, _X("%s"), st_SDKSerial.tszCPUSerial);
79+
}
80+
else if (ENUM_VERIFICATION_MODULE_HW_TYPE_DISK == enHWType)
81+
{
82+
_xstprintf(tszJsonStr, _X("%s"), st_SDKSerial.tszDiskSerial);
83+
}
84+
else if (ENUM_VERIFICATION_MODULE_HW_TYPE_SYSTEM == enHWType)
85+
{
86+
_xstprintf(tszJsonStr, _X("%s"), st_SDKSerial.tszSystemSerial);
87+
}
88+
else
89+
{
90+
_xstprintf(tszJsonStr, _X("%s"), st_SDKSerial.tszBoardSerial);
91+
}
92+
93+
if (_tcsxlen(tszJsonStr) <= 0)
94+
{
95+
Verification_IsErrorOccur = true;
96+
Verification_dwErrorCode = ERROR_XENGINE_MODULE_VERIFICATION_XAUTH_GETSERIAL;
97+
return false;
98+
}
6799

68100
st_JsonObject["tszVSerial"] = tszJsonStr;
69101
st_JsonRoot["st_VERTemp"] = st_JsonObject;

XEngine_Module/XEngine_Verification/Verification_XAuth/Verification_XAuthNet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class CVerification_XAuthNet
2323
CVerification_XAuthNet();
2424
~CVerification_XAuthNet();
2525
public:
26-
bool Verification_XAuthNet_TryRequest(LPCXSTR lpszURLAddr, LPCXSTR lpszPass = NULL, int* pInt_Type = NULL);
26+
bool Verification_XAuthNet_TryRequest(LPCXSTR lpszURLAddr, LPCXSTR lpszPass = NULL, int* pInt_Type = NULL, ENUM_VERIFICATION_MODULE_HW_TYPE enHWType = ENUM_VERIFICATION_MODULE_HW_TYPE_BOARD);
2727
bool Verification_XAuthNet_GetDCode(LPCXSTR lpszURLAddr, int* pInt_DYCode, XNETHANDLE* pxhToken, int* pInt_Timeout = NULL, LPCXSTR lpszPass = NULL);
2828
public:
2929
bool Verification_XAuthNet_Connect(LPCXSTR lpszClientAddr, int nPort, LPCXSTR lpszPass = NULL);

XEngine_Module/XEngine_Verification/pch.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ extern "C" bool Verification_XAuthKey_ReadMemory(LPCXSTR lpszMsgBuffer, int nMsg
137137
{
138138
return m_XAuthKeyVerification.Verification_XAuthKey_ReadMemory(lpszMsgBuffer, nMsgLen, pSt_AuthLocal);
139139
}
140-
extern "C" bool Verification_XAuthNet_TryRequest(LPCXSTR lpszURLAddr, LPCXSTR lpszPass, int* pInt_Type)
140+
extern "C" bool Verification_XAuthNet_TryRequest(LPCXSTR lpszURLAddr, LPCXSTR lpszPass, int* pInt_Type, ENUM_VERIFICATION_MODULE_HW_TYPE enHWType)
141141
{
142-
return m_XAuthNetVerification.Verification_XAuthNet_TryRequest(lpszURLAddr, lpszPass, pInt_Type);
142+
return m_XAuthNetVerification.Verification_XAuthNet_TryRequest(lpszURLAddr, lpszPass, pInt_Type, enHWType);
143143
}
144144
extern "C" bool Verification_XAuthNet_GetDCode(LPCXSTR lpszURLAddr, int* pInt_DYCode, XNETHANDLE* pxhToken, int* pInt_Timeout, LPCXSTR lpszPass)
145145
{

0 commit comments

Comments
 (0)