Skip to content

Commit 74e3347

Browse files
committed
modify:does not allow empty for register and login
1 parent 2808e7a commit 74e3347

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

XEngine_Source/XEngine_MQServiceApp/MQService_TCPTask.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,14 @@ bool MessageQueue_TCP_Handle(XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, LPCXSTR lpszC
122122
}
123123
else
124124
{
125+
if (_tcsxlen(st_UserInfo.tszUserPass) <= 0)
126+
{
127+
pSt_ProtocolHdr->wReserve = ERROR_XENGINE_MESSAGE_AUTH_USERPASS;
128+
ProtocolModule_Packet_Common(nNetType, pSt_ProtocolHdr, NULL, tszSDBuffer, &nSDLen);
129+
XEngine_MQXService_Send(lpszClientAddr, tszSDBuffer, nSDLen, nNetType);
130+
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("%s客户端:%s,请求本地验证失败,密码为空"), lpszClientType, lpszClientAddr);
131+
return false;
132+
}
125133
if (!DBModule_MQUser_UserQuery(&st_UserInfo))
126134
{
127135
pSt_ProtocolHdr->wReserve = ERROR_XENGINE_MESSAGE_AUTH_USERPASS;
@@ -210,6 +218,14 @@ bool MessageQueue_TCP_Handle(XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, LPCXSTR lpszC
210218
}
211219
else
212220
{
221+
if (_tcsxlen(st_UserInfo.tszUserPass) <= 0)
222+
{
223+
pSt_ProtocolHdr->wReserve = ERROR_XENGINE_MESSAGE_AUTH_USERPASS;
224+
ProtocolModule_Packet_Common(nNetType, pSt_ProtocolHdr, NULL, tszSDBuffer, &nSDLen);
225+
XEngine_MQXService_Send(lpszClientAddr, tszSDBuffer, nSDLen, nNetType);
226+
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("%s客户端:%s,请求本地验证失败,密码为空"), lpszClientType, lpszClientAddr);
227+
return false;
228+
}
213229
if (DBModule_MQUser_UserQuery(&st_UserInfo))
214230
{
215231
pSt_ProtocolHdr->wReserve = ERROR_XENGINE_MESSAGE_AUTH_EXISTED;

0 commit comments

Comments
 (0)