Skip to content

Commit dce534f

Browse files
committed
fixed:cdkey parament process is incorrent
added:Authorize cdkey modify:create not encrypto
1 parent 1b1ab31 commit dce534f

File tree

2 files changed

+29
-7
lines changed

2 files changed

+29
-7
lines changed

XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HTTPTask.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ BOOL XEngine_HTTPTask_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCTSTR
163163
return FALSE;
164164
}
165165
int nOPType = _ttoi(tszValue);
166-
if (2 == nListCount)
166+
if (3 == nListCount)
167167
{
168168
memset(tszKey, '\0', sizeof(tszKey));
169169
memset(tszValue, '\0', sizeof(tszValue));

XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HTTPTask/HTTPTask_CDKey.cpp

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,31 @@ BOOL XEngine_HTTPTask_CDKey(LPCTSTR lpszClientAddr, LPCTSTR lpszMsgBuffer, int n
2828
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _T("客户端:%s,请求创建CDKEY协议失败,服务器内部错误:%lX"), lpszClientAddr, Authorize_GetLastError());
2929
return FALSE;
3030
}
31+
RfcComponents_HttpServer_SendMsgEx(xhHTTPPacket, tszSDBuffer, &nSDLen, &st_HDRParam, tszRVBuffer, nRVLen);
32+
XEngine_Network_Send(lpszClientAddr, tszSDBuffer, nSDLen);
33+
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _T("客户端:%s,请求创建CDKEY成功,APP名:%s,APP版本:%s"), lpszClientAddr, st_Authorize.st_AuthAppInfo.tszAppName, st_Authorize.st_AuthAppInfo.tszAppVer);
34+
}
35+
else if (1 == unOperatorCode)
36+
{
37+
XENGINE_AUTHORIZE_LOCAL st_Authorize;
38+
memset(&st_Authorize, '\0', sizeof(XENGINE_AUTHORIZE_LOCAL));
39+
40+
Authorize_Local_ReadMemory(lpszMsgBuffer, nMsgLen, &st_Authorize);
41+
//授权
42+
if (ENUM_HELPCOMPONENTS_AUTHORIZE_SERIAL_TYPE_CUSTOM == st_Authorize.st_AuthRegInfo.enSerialType)
43+
{
44+
XENGINE_LIBTIMER st_LibTime;
45+
memset(&st_LibTime, '\0', sizeof(XENGINE_LIBTIMER));
46+
47+
BaseLib_OperatorTime_StrToTime(st_Authorize.st_AuthRegInfo.tszLeftTime, &st_LibTime);
48+
Authorize_Local_BuildKeyTime(&st_Authorize, NULL, &st_LibTime);
49+
}
50+
else
51+
{
52+
Authorize_Local_BuildKeyTime(&st_Authorize, _ttoi64(st_Authorize.st_AuthRegInfo.tszLeftTime));
53+
}
54+
Authorize_Local_WriteMemory(tszRVBuffer, &nRVLen, &st_Authorize);
55+
//加密
3156
if (NULL == lpszPass)
3257
{
3358
RfcComponents_HttpServer_SendMsgEx(xhHTTPPacket, tszSDBuffer, &nSDLen, &st_HDRParam, tszRVBuffer, nRVLen);
@@ -37,14 +62,11 @@ BOOL XEngine_HTTPTask_CDKey(LPCTSTR lpszClientAddr, LPCTSTR lpszMsgBuffer, int n
3762
UCHAR tszCodecBuffer[4096];
3863
memset(tszCodecBuffer, '\0', sizeof(tszCodecBuffer));
3964

40-
OPenSsl_XCrypto_Encoder(tszRVBuffer, &nMsgLen, tszCodecBuffer, lpszPass);
41-
RfcComponents_HttpServer_SendMsgEx(xhHTTPPacket, tszSDBuffer, &nSDLen, &st_HDRParam, (LPCTSTR)tszCodecBuffer, nMsgLen);
65+
OPenSsl_XCrypto_Encoder(tszRVBuffer, &nRVLen, tszCodecBuffer, lpszPass);
66+
RfcComponents_HttpServer_SendMsgEx(xhHTTPPacket, tszSDBuffer, &nSDLen, &st_HDRParam, (LPCTSTR)tszCodecBuffer, nRVLen);
4267
}
4368
XEngine_Network_Send(lpszClientAddr, tszSDBuffer, nSDLen);
44-
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _T("客户端:%s,请求创建CDKEY成功,APP名:%s,APP版本:%s"), lpszClientAddr, st_Authorize.st_AuthAppInfo.tszAppName, st_Authorize.st_AuthAppInfo.tszAppVer);
45-
}
46-
else if (1 == unOperatorCode)
47-
{
69+
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _T("客户端:%s,请求授权CDKEY成功,APP名:%s,APP版本:%s,授权期限:%s"), lpszClientAddr, st_Authorize.st_AuthAppInfo.tszAppName, st_Authorize.st_AuthAppInfo.tszAppVer, st_Authorize.st_AuthRegInfo.tszLeftTime);
4870
}
4971
else
5072
{

0 commit comments

Comments
 (0)