提交 4d584bc6 编写于 作者: xengine-qyt's avatar xengine-qyt

fixed:configure read is incorrent

fixed:mulit login merge time is incorrent
上级 3d951ac6
......@@ -116,7 +116,7 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE
pSt_ServerConfig->st_XVerification.nTryTime = st_JsonXVerification["nTryTime"].asInt();
pSt_ServerConfig->st_XVerification.nTryMode = st_JsonXVerification["nTryMode"].asInt();
//登录配置
if (st_JsonRoot["XLogin"].empty() || (6 != st_JsonRoot["XLogin"].size()))
if (st_JsonRoot["XLogin"].empty() || (7 != st_JsonRoot["XLogin"].size()))
{
Config_IsErrorOccur = true;
Config_dwErrorCode = ERROR_AUTHORIZE_MODULE_CONFIGURE_XVER;
......@@ -127,6 +127,7 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE
pSt_ServerConfig->st_XLogin.bHTTPAuth = st_JsonXLogin["bHTTPAuth"].asBool();
pSt_ServerConfig->st_XLogin.bPassAuth = st_JsonXLogin["bPassAuth"].asBool();
pSt_ServerConfig->st_XLogin.nHTTPAuthTime = st_JsonXLogin["nHTTPAuthTime"].asInt();
pSt_ServerConfig->st_XLogin.nMultiMode = st_JsonXLogin["nMultiMode"].asInt();
Json::Value st_JsonXLoginUrl = st_JsonXLogin["st_PassUrl"];
_tcsxcpy(pSt_ServerConfig->st_XLogin.st_PassUrl.tszPassLogin, st_JsonXLoginUrl["tszPassLogin"].asCString());
......
......@@ -481,10 +481,13 @@ XHTHREAD CSession_Authorize::Session_Authorize_ActiveThread(XPVOID lParam)
{
if (ENUM_HELPCOMPONENTS_AUTHORIZE_SERIAL_TYPE_MINUTE == stl_ListIterator->st_UserTable.enSerialType)
{
//通告结束
if (nTimeCount > stl_ListIterator->nLeftTime)
for (auto stl_ListNotifyIterator = stl_ListNotify.begin(); stl_ListNotifyIterator != stl_ListNotify.end(); stl_ListNotifyIterator++)
{
stl_ListIterator->nLeftTime = 0;
if (0 == _tcsxnicmp(stl_ListNotifyIterator->tszUserAddr, stl_ListIterator->tszClientAddr, _tcsxlen(stl_ListNotifyIterator->tszUserAddr)))
{
stl_ListNotifyIterator->nTimeLeft -= nTimeCount;
break;
}
}
}
}
......
......@@ -80,9 +80,7 @@ bool XEngine_CloseClient(LPCXSTR lpszClientAddr)
NetCore_TCPXCore_CloseForClientEx(xhWSSocket, lpszClientAddr);
NetCore_TCPXCore_CloseForClientEx(xhHttpSocket, lpszClientAddr);
XCHAR tszClientUser[64];
AUTHSESSION_NETCLIENT st_NETClient;
memset(tszClientUser, '\0', sizeof(tszClientUser));
memset(&st_NETClient, '\0', sizeof(AUTHSESSION_NETCLIENT));
if (Session_Authorize_GetUserForAddr(lpszClientAddr, &st_NETClient))
......@@ -93,7 +91,7 @@ bool XEngine_CloseClient(LPCXSTR lpszClientAddr)
st_AuthTime.nTimeLeft = st_NETClient.nLeftTime;
st_AuthTime.nTimeONLine = st_NETClient.nOnlineTime;
st_AuthTime.enSerialType = st_NETClient.st_UserTable.enSerialType;
_tcsxcpy(st_AuthTime.tszUserName, tszClientUser);
_tcsxcpy(st_AuthTime.tszUserName, st_NETClient.st_UserTable.st_UserInfo.tszUserName);
_tcsxcpy(st_AuthTime.tszLeftTime, st_NETClient.tszLeftTime);
_tcsxcpy(st_AuthTime.tszUserAddr, st_NETClient.tszClientAddr);
......@@ -107,7 +105,7 @@ bool XEngine_CloseClient(LPCXSTR lpszClientAddr)
APIClient_Http_Request(_X("POST"), st_AuthConfig.st_XLogin.st_PassUrl.tszPassLogout, tszSDBuffer);
}
Session_Authorize_CloseAddr(lpszClientAddr);
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("客户端:%s,用户名:%s,离开服务器,在线时长:%d"), lpszClientAddr, tszClientUser, st_AuthTime.nTimeONLine);
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("客户端:%s,用户名:%s,离开服务器,在线时长:%d"), lpszClientAddr, st_NETClient.st_UserTable.st_UserInfo.tszUserName, st_AuthTime.nTimeONLine);
}
else
{
......
......@@ -162,7 +162,12 @@ bool XEngine_Client_TCPTask(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int n
//找到客户端,支持的模式
if (0 == st_AuthConfig.st_XLogin.nMultiMode)
{
if (ppSt_ListClient[i]->st_UserTable.enDeviceType == st_AuthProtocol.enDeviceType)
int nSourceType = 0;
int nDestType = 0;
AuthHelp_MultiLogin_GetRange(ppSt_ListClient[i]->st_UserTable.enDeviceType, &nSourceType);
AuthHelp_MultiLogin_GetRange(st_AuthProtocol.enDeviceType, &nDestType);
if (nSourceType == nDestType)
{
bLogin = true;
break;
......@@ -170,12 +175,7 @@ bool XEngine_Client_TCPTask(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int n
}
else
{
int nSourceType = 0;
int nDestType = 0;
AuthHelp_MultiLogin_GetRange(ppSt_ListClient[i]->st_UserTable.enDeviceType, &nSourceType);
AuthHelp_MultiLogin_GetRange(st_AuthProtocol.enDeviceType, &nDestType);
if (nSourceType == nDestType)
if (ppSt_ListClient[i]->st_UserTable.enDeviceType == st_AuthProtocol.enDeviceType)
{
bLogin = true;
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册