@@ -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