Skip to content

Commit 7add6d2

Browse files
committed
modify:adjust st_XToken location
1 parent 82ce149 commit 7add6d2

File tree

4 files changed

+18
-19
lines changed

4 files changed

+18
-19
lines changed

XEngine_Release/XEngine_Config/XEngine_Config.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,12 @@
2424
"tszKeyPass":"123123qa"
2525
},
2626
"st_PassCrypto":{
27-
"bEnable":false,
27+
"bEnable":true,
2828
"nCodec":2
29+
},
30+
"st_XToken":{
31+
"bAutoRenewal":false,
32+
"nRenewalTime":-1
2933
}
3034
},
3135
"XLogin":{
@@ -42,10 +46,6 @@
4246
"bTime":true,
4347
"bDay":false,
4448
"bCustom":false
45-
},
46-
"st_XToken":{
47-
"bAutoRenewal":false,
48-
"nRenewalTime":-1
4949
}
5050
},
5151
"XCrypto":{

XEngine_Source/AuthorizeModule_Configure/Config_Define.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ typedef struct
4343
bool bEnable; //是否启用
4444
int nCodec; //加密方法:ENUM_XENGINE_OPENSSL_DIGEST
4545
}st_PassCrypto;
46+
struct
47+
{
48+
bool bAutoRenewal; //自动续期
49+
int nRenewalTime; //续期次数
50+
}st_XToken;
4651
int nCheckTimeNumber; //检测次数
4752
int nCheckTimeout; //超时时间
4853
int nTokenTimeout; //TOKEN登录超时时间
@@ -71,11 +76,6 @@ typedef struct
7176
bool bTime;
7277
bool bCustom;
7378
}st_MulitLogin;
74-
struct
75-
{
76-
bool bAutoRenewal;
77-
int nRenewalTime;
78-
}st_XToken;
7979
}st_XLogin;
8080
struct
8181
{

XEngine_Source/AuthorizeModule_Configure/ModuleConfigure_Json/ModuleConfigure_Json.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE
8787
pSt_ServerConfig->bDeamon = st_JsonRoot["bDeamon"].asBool();
8888
pSt_ServerConfig->bTimeNotify = st_JsonRoot["bTimeNotify"].asBool();
8989
//最大配置
90-
if (st_JsonRoot["XMax"].empty() || (6 != st_JsonRoot["XMax"].size()))
90+
if (st_JsonRoot["XMax"].empty() || (7 != st_JsonRoot["XMax"].size()))
9191
{
9292
Config_IsErrorOccur = true;
9393
Config_dwErrorCode = ERROR_AUTHORIZE_MODULE_CONFIGURE_XMAX;
@@ -120,8 +120,11 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE
120120

121121
pSt_ServerConfig->st_XVerification.st_PassCrypto.bEnable = st_JsonXVerification["st_PassCrypto"]["bEnable"].asBool();
122122
pSt_ServerConfig->st_XVerification.st_PassCrypto.nCodec = st_JsonXVerification["st_PassCrypto"]["nCodec"].asInt();
123+
124+
pSt_ServerConfig->st_XVerification.st_XToken.bAutoRenewal = st_JsonXVerification["st_XToken"]["bAutoRenewal"].asBool();
125+
pSt_ServerConfig->st_XVerification.st_XToken.nRenewalTime = st_JsonXVerification["st_XToken"]["nRenewalTime"].asInt();
123126
//登录配置
124-
if (st_JsonRoot["XLogin"].empty() || (6 != st_JsonRoot["XLogin"].size()))
127+
if (st_JsonRoot["XLogin"].empty() || (5 != st_JsonRoot["XLogin"].size()))
125128
{
126129
Config_IsErrorOccur = true;
127130
Config_dwErrorCode = ERROR_AUTHORIZE_MODULE_CONFIGURE_XVER;
@@ -142,10 +145,6 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE
142145
pSt_ServerConfig->st_XLogin.st_MulitLogin.bDay = st_JsonMulitLogin["bDay"].asBool();
143146
pSt_ServerConfig->st_XLogin.st_MulitLogin.bSecond = st_JsonMulitLogin["bSecond"].asBool();
144147
pSt_ServerConfig->st_XLogin.st_MulitLogin.bTime = st_JsonMulitLogin["bTime"].asBool();
145-
146-
Json::Value st_JsonXToken = st_JsonXLogin["st_XToken"];
147-
pSt_ServerConfig->st_XLogin.st_XToken.bAutoRenewal = st_JsonXToken["bAutoRenewal"].asBool();
148-
pSt_ServerConfig->st_XLogin.st_XToken.nRenewalTime = st_JsonXToken["nRenewalTime"].asInt();
149148
//加密配置
150149
if (st_JsonRoot["XCrypto"].empty() || (2 != st_JsonRoot["XCrypto"].size()))
151150
{

XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_Task.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,18 @@ void CALLBACK XEngine_TaskEvent_Token(XNETHANDLE xhToken, XPVOID lParam)
6969

7070
Session_Token_Get(xhToken, &st_UserTable);
7171
//自动续期?
72-
if (st_AuthConfig.st_XLogin.st_XToken.bAutoRenewal)
72+
if (st_AuthConfig.st_XVerification.st_XToken.bAutoRenewal)
7373
{
7474
int nRenewalTime = 0;
7575
Session_Token_RenewalTime(xhToken, &nRenewalTime);
7676

77-
if (-1 == st_AuthConfig.st_XLogin.st_XToken.nRenewalTime)
77+
if (-1 == st_AuthConfig.st_XVerification.st_XToken.nRenewalTime)
7878
{
7979
bRemove = false;
8080
}
8181
else
8282
{
83-
if (nRenewalTime <= st_AuthConfig.st_XLogin.st_XToken.nRenewalTime)
83+
if (nRenewalTime <= st_AuthConfig.st_XVerification.st_XToken.nRenewalTime)
8484
{
8585
bRemove = false;
8686
}

0 commit comments

Comments
 (0)