Skip to content

Commit 85cbb67

Browse files
committed
modify:dynamic code size and start code location
1 parent d04c6a7 commit 85cbb67

File tree

10 files changed

+37
-38
lines changed

10 files changed

+37
-38
lines changed

XEngine_Source/AuthorizeModule_Help/AuthHelp_Define.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ extern "C" bool AuthHelp_DynamicCode_Destory();
5858
意思:是否成功
5959
备注:
6060
*********************************************************************/
61-
extern "C" bool AuthHelp_DynamicCode_Create(XNETHANDLE* pxhToken, int* pInt_DynamicCode);
61+
extern "C" bool AuthHelp_DynamicCode_Create(XNETHANDLE* pxhToken, XSHOT* pInt_DynamicCode);
6262
/********************************************************************
6363
函数名称:AuthHelp_DynamicCode_Get
6464
函数功能:获取句柄和动态码绑定信息

XEngine_Source/AuthorizeModule_Help/AuthHelp_DynamicCode/AuthHelp_DynamicCode.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ bool CAuthHelp_DynamicCode::AuthHelp_DynamicCode_Destory()
8989
意思:是否成功
9090
备注:
9191
*********************************************************************/
92-
bool CAuthHelp_DynamicCode::AuthHelp_DynamicCode_Create(XNETHANDLE* pxhToken, int* pInt_DynamicCode)
92+
bool CAuthHelp_DynamicCode::AuthHelp_DynamicCode_Create(XNETHANDLE* pxhToken, XSHOT* pInt_DynamicCode)
9393
{
9494
Help_IsErrorOccur = false;
9595

@@ -104,7 +104,7 @@ bool CAuthHelp_DynamicCode::AuthHelp_DynamicCode_Create(XNETHANDLE* pxhToken, in
104104

105105
st_DynamicCode.nTimeStart = time(NULL);
106106
BaseLib_Handle_Create(&st_DynamicCode.xhToken);
107-
BaseLib_Handle_Create((XNETHANDLE*)&st_DynamicCode.nDynamicCode, 100001, 999999);
107+
BaseLib_Handle_Create((XNETHANDLE*)&st_DynamicCode.nDynamicCode, 10001, 65535);
108108

109109
*pxhToken = st_DynamicCode.xhToken;
110110
*pInt_DynamicCode = st_DynamicCode.nDynamicCode;

XEngine_Source/AuthorizeModule_Help/AuthHelp_DynamicCode/AuthHelp_DynamicCode.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
typedef struct
1414
{
1515
XNETHANDLE xhToken;
16-
int nDynamicCode;
16+
XSHOT nDynamicCode;
1717
time_t nTimeStart;
1818
}AUTHHELP_DYNAMICCODE;
1919

@@ -25,7 +25,7 @@ class CAuthHelp_DynamicCode
2525
public:
2626
bool AuthHelp_DynamicCode_Init(int nSecond);
2727
bool AuthHelp_DynamicCode_Destory();
28-
bool AuthHelp_DynamicCode_Create(XNETHANDLE* pxhToken, int* pInt_DynamicCode);
28+
bool AuthHelp_DynamicCode_Create(XNETHANDLE* pxhToken, XSHOT* pInt_DynamicCode);
2929
bool AuthHelp_DynamicCode_Get(XNETHANDLE xhToken, int nDynamicCode);
3030
protected:
3131
static XHTHREAD CALLBACK AuthHelp_DynamicCode_Thread(XPVOID lParam);

XEngine_Source/AuthorizeModule_Help/pch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ extern "C" bool AuthHelp_DynamicCode_Destory()
4545
{
4646
return m_HelpDynamic.AuthHelp_DynamicCode_Destory();
4747
}
48-
extern "C" bool AuthHelp_DynamicCode_Create(XNETHANDLE * pxhToken, int* pInt_DynamicCode)
48+
extern "C" bool AuthHelp_DynamicCode_Create(XNETHANDLE * pxhToken, XSHOT* pInt_DynamicCode)
4949
{
5050
return m_HelpDynamic.AuthHelp_DynamicCode_Create(pxhToken, pInt_DynamicCode);
5151
}

XEngine_Source/AuthorizeModule_Protocol/Protocol_Define.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ extern "C" bool Protocol_Packet_HttpSerialList(XCHAR* ptszMsgBuffer, int* pInt_M
277277
意思:是否成功
278278
备注:
279279
*********************************************************************/
280-
extern "C" bool Protocol_Packet_HttpToken(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, XNETHANDLE xhToken, int nTimeout, int nDCode = 0);
280+
extern "C" bool Protocol_Packet_HttpToken(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, XNETHANDLE xhToken, int nTimeout, XSHOT nDCode = 0);
281281
/********************************************************************
282282
函数名称:Protocol_Packet_HttpSwitch
283283
函数功能:打包开关功能选项

XEngine_Source/AuthorizeModule_Protocol/Protocol_Packet/Protocol_Packet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ bool CProtocol_Packet::Protocol_Packet_HttpSerialList(XCHAR* ptszMsgBuffer, int*
575575
意思:是否成功
576576
备注:
577577
*********************************************************************/
578-
bool CProtocol_Packet::Protocol_Packet_HttpToken(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, XNETHANDLE xhToken, int nTimeout, int nDCode /* = 0 */)
578+
bool CProtocol_Packet::Protocol_Packet_HttpToken(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, XNETHANDLE xhToken, int nTimeout, XSHOT nDCode /* = 0 */)
579579
{
580580
Protocol_IsErrorOccur = false;
581581

XEngine_Source/AuthorizeModule_Protocol/Protocol_Packet/Protocol_Packet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class CProtocol_Packet
2626
bool Protocol_Packet_HttpClientInfo(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, AUTHREG_USERTABLE* pSt_UserTable);
2727
bool Protocol_Packet_HttpClientList(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, AUTHSESSION_NETCLIENT*** pppSt_OnClient, int nOnCount, AUTHREG_USERTABLE*** pppSt_OffClient, int nOffCount);
2828
bool Protocol_Packet_HttpSerialList(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, AUTHREG_SERIALTABLE*** pppSt_SerialList, int nListCount);
29-
bool Protocol_Packet_HttpToken(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, XNETHANDLE xhToken, int nTimeout, int nDCode = 0);
29+
bool Protocol_Packet_HttpToken(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, XNETHANDLE xhToken, int nTimeout, XSHOT nDCode = 0);
3030
bool Protocol_Packet_HttpSwitch(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, XENGINE_FUNCTIONSWITCH* pSt_FunSwitch);
3131
bool Protocol_Packet_HttpBanned(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, AUTHREG_BANNED*** pppSt_BannedUser, int nUserCount, AUTHREG_BANNED*** pppSt_BannedAddr, int nAddrCount);
3232
bool Protocol_Packet_HttpAnnouncement(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, AUTHREG_ANNOUNCEMENT*** pppSt_Announcement, int nListCount);

XEngine_Source/AuthorizeModule_Protocol/pch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ extern "C" bool Protocol_Packet_HttpSerialList(XCHAR * ptszMsgBuffer, int* pInt_
6363
{
6464
return m_ProtocolPacket.Protocol_Packet_HttpSerialList(ptszMsgBuffer, pInt_MsgLen, pppSt_SerialList, nListCount);
6565
}
66-
extern "C" bool Protocol_Packet_HttpToken(XCHAR * ptszMsgBuffer, int* pInt_MsgLen, XNETHANDLE xhToken, int nTimeout, int nDCode)
66+
extern "C" bool Protocol_Packet_HttpToken(XCHAR * ptszMsgBuffer, int* pInt_MsgLen, XNETHANDLE xhToken, int nTimeout, XSHOT nDCode)
6767
{
6868
return m_ProtocolPacket.Protocol_Packet_HttpToken(ptszMsgBuffer, pInt_MsgLen, xhToken, nTimeout, nDCode);
6969
}

XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Get/AuthorizeHTTP_GetTask.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ bool XEngine_AuthorizeHTTP_GetTask(LPCXSTR lpszClientAddr, XCHAR** pptszList, in
5151
return false;
5252
}
5353
//http://app.xyry.org:5302/api?function=dcode
54-
int nDCode = 0;
54+
XSHOT nDCode = 0;
5555
XNETHANDLE xhToken = 0;
5656
AuthHelp_DynamicCode_Create(&xhToken, &nDCode);
5757
Protocol_Packet_HttpToken(tszSDBuffer, &nSDLen, xhToken, st_AuthConfig.st_XVerification.nDynamicTimeout, nDCode);

XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/XEngine_AuthorizeService.cpp

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -371,32 +371,7 @@ int main(int argc, char** argv)
371371
{
372372
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,加密传输设置为关闭,采用明文传输"));
373373
}
374-
//发送信息报告
375-
if (st_AuthConfig.st_XReport.bEnable && !bIsTest)
376-
{
377-
if (InfoReport_APIMachine_Send(st_AuthConfig.st_XReport.tszAPIUrl, st_AuthConfig.st_XReport.tszServiceName))
378-
{
379-
__int64x nTimeCount = 0;
380-
if (InfoReport_APIMachine_GetTime(st_AuthConfig.st_XReport.tszAPIUrl, st_AuthConfig.st_XReport.tszServiceName, &nTimeCount))
381-
{
382-
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,启动信息报告给API服务器:%s 成功,报告次数:%lld"), st_AuthConfig.st_XReport.tszAPIUrl, nTimeCount);
383-
}
384-
else
385-
{
386-
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("启动服务中,启动信息报告给API服务器:%s 成功,获取报告次数失败,错误:%lX"), st_AuthConfig.st_XReport.tszAPIUrl, InfoReport_GetLastError());
387-
}
388-
}
389-
else
390-
{
391-
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("启动服务中,启动信息报告给API服务器:%s 失败,错误:%lX"), st_AuthConfig.st_XReport.tszAPIUrl, InfoReport_GetLastError());
392-
}
393-
}
394-
else
395-
{
396-
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _X("启动服务中,信息报告给API服务器没有启用"));
397-
}
398-
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,功能开关选项,删除功能:%d,登录功能:%d,找回密码:%d,充值功能:%d,注册功能:%d,CDKey功能:%d,公告系统:%d,动态验证:%d,多端登录:%d,临时试用:%d,黑名单功能:%d,普通TOKEN:%d,硬件码登录:%d"), st_FunSwitch.bSwitchDelete, st_FunSwitch.bSwitchLogin, st_FunSwitch.bSwitchPass, st_FunSwitch.bSwitchPay, st_FunSwitch.bSwitchRegister, st_FunSwitch.bSwitchCDKey, st_FunSwitch.bSwitchNotice, st_FunSwitch.bSwitchDCode, st_FunSwitch.bSwitchMulti, st_FunSwitch.bSwitchTry, st_FunSwitch.bSwitchBanned, st_FunSwitch.bSwitchTokenLogin, st_FunSwitch.bSwitchHCLogin);
399-
374+
400375
pSt_File = _xtfopen(st_AuthConfig.st_XVerification.st_XCDKey.tszKeyFile, _X("rb"));
401376
if (NULL == pSt_File)
402377
{
@@ -438,7 +413,31 @@ int main(int argc, char** argv)
438413
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _X("启动服务中,授权文件失败,解密失败,数据不正确"));
439414
}
440415
}
441-
416+
//发送信息报告
417+
if (st_AuthConfig.st_XReport.bEnable && !bIsTest)
418+
{
419+
if (InfoReport_APIMachine_Send(st_AuthConfig.st_XReport.tszAPIUrl, st_AuthConfig.st_XReport.tszServiceName))
420+
{
421+
__int64x nTimeCount = 0;
422+
if (InfoReport_APIMachine_GetTime(st_AuthConfig.st_XReport.tszAPIUrl, st_AuthConfig.st_XReport.tszServiceName, &nTimeCount))
423+
{
424+
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,启动信息报告给API服务器:%s 成功,报告次数:%lld"), st_AuthConfig.st_XReport.tszAPIUrl, nTimeCount);
425+
}
426+
else
427+
{
428+
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("启动服务中,启动信息报告给API服务器:%s 成功,获取报告次数失败,错误:%lX"), st_AuthConfig.st_XReport.tszAPIUrl, InfoReport_GetLastError());
429+
}
430+
}
431+
else
432+
{
433+
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("启动服务中,启动信息报告给API服务器:%s 失败,错误:%lX"), st_AuthConfig.st_XReport.tszAPIUrl, InfoReport_GetLastError());
434+
}
435+
}
436+
else
437+
{
438+
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _X("启动服务中,信息报告给API服务器没有启用"));
439+
}
440+
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,功能开关选项,删除功能:%d,登录功能:%d,找回密码:%d,充值功能:%d,注册功能:%d,CDKey功能:%d,公告系统:%d,动态验证:%d,多端登录:%d,临时试用:%d,黑名单功能:%d,普通TOKEN:%d,硬件码登录:%d"), st_FunSwitch.bSwitchDelete, st_FunSwitch.bSwitchLogin, st_FunSwitch.bSwitchPass, st_FunSwitch.bSwitchPay, st_FunSwitch.bSwitchRegister, st_FunSwitch.bSwitchCDKey, st_FunSwitch.bSwitchNotice, st_FunSwitch.bSwitchDCode, st_FunSwitch.bSwitchMulti, st_FunSwitch.bSwitchTry, st_FunSwitch.bSwitchBanned, st_FunSwitch.bSwitchTokenLogin, st_FunSwitch.bSwitchHCLogin);
442441
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("所有服务成功启动,网络验证服务运行中,XEngien版本:%s%s,发行版本次数:%d,当前运行版本:%s。。。"), BaseLib_Version_XNumberStr(), BaseLib_Version_XTypeStr(), st_AuthConfig.st_XVer.pStl_ListVer->size(), st_AuthConfig.st_XVer.pStl_ListVer->front().c_str());
443442

444443
while (true)

0 commit comments

Comments
 (0)