Skip to content

Commit 3df7b9e

Browse files
committed
added:hardware login switch supported
1 parent ad324f6 commit 3df7b9e

File tree

13 files changed

+41
-5
lines changed

13 files changed

+41
-5
lines changed

XEngine_Release/XEngine_Config/XEngine_SwitchConfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
"bSwitchMulti":true,
1212
"bSwitchTry":true,
1313
"bSwitchBanned":true,
14-
"bSwitchTokenLogin":true
14+
"bSwitchTokenLogin":true,
15+
"bSwitchHCLogin":true
1516
}

XEngine_Source/AuthorizeModule_Client/AuthClient_HTTPVer/AuthClient_HTTPVer.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ bool CAuthClient_HTTPVer::AuthClient_HTTPVer_TryRequest(LPCXSTR lpszURLAddr, LPC
4949
return false;
5050
}
5151
#if (1 == _XAUTH_BUILD_SWITCH_CLIENT_HTTP)
52-
5352
int nHTTPCode = 0;
5453
XCHAR tszJsonStr[MAX_PATH] = {};
5554
Json::Value st_JsonRoot;

XEngine_Source/AuthorizeModule_Configure/Config_Define.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ typedef struct
132132
bool bSwitchTry; //临时验证
133133
bool bSwitchBanned; //黑名单
134134
bool bSwitchTokenLogin; //TOKEN开关
135+
bool bSwitchHCLogin; //硬件码登录
135136
}XENGINE_FUNCTIONSWITCH;
136137
//////////////////////////////////////////////////////////////////////////
137138
// 导出的函数

XEngine_Source/AuthorizeModule_Configure/ModuleConfigure_Json/ModuleConfigure_Json.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,5 +349,6 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_Switch(LPCXSTR lpszConfigFile,
349349
pSt_ServerConfig->bSwitchTry = st_JsonRoot["bSwitchTry"].asBool();
350350
pSt_ServerConfig->bSwitchBanned = st_JsonRoot["bSwitchBanned"].asBool();
351351
pSt_ServerConfig->bSwitchTokenLogin = st_JsonRoot["bSwitchTokenLogin"].asBool();
352+
pSt_ServerConfig->bSwitchHCLogin = st_JsonRoot["bSwitchHCLogin"].asBool();
352353
return true;
353354
}

XEngine_Source/AuthorizeModule_Protocol/Protocol_Packet/Protocol_Packet.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,7 @@ bool CProtocol_Packet::Protocol_Packet_HttpSwitch(XCHAR* ptszMsgBuffer, int* pIn
663663
st_JsonRoot["bSwitchTry"] = pSt_FunSwitch->bSwitchTry;
664664
st_JsonRoot["bSwitchBanned"] = pSt_FunSwitch->bSwitchBanned;
665665
st_JsonRoot["bSwitchTokenLogin"] = pSt_FunSwitch->bSwitchTokenLogin;
666+
st_JsonRoot["bSwitchHCLogin"] = pSt_FunSwitch->bSwitchHCLogin;
666667

667668
*pInt_MsgLen = st_JsonRoot.toStyledString().length();
668669
memcpy(ptszMsgBuffer, st_JsonRoot.toStyledString().c_str(), *pInt_MsgLen);

XEngine_Source/AuthorizeModule_Protocol/Protocol_Parse/Protocol_Parse.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,7 @@ bool CProtocol_Parse::Protocol_Parse_HttpParseSwitch(LPCXSTR lpszMsgBuffer, int
846846
pSt_FunSwitch->bSwitchTry = st_JsonObject["bSwitchTry"].asBool();
847847
pSt_FunSwitch->bSwitchBanned = st_JsonObject["bSwitchBanned"].asBool();
848848
pSt_FunSwitch->bSwitchTokenLogin = st_JsonObject["bSwitchTokenLogin"].asBool();
849+
pSt_FunSwitch->bSwitchHCLogin = st_JsonObject["bSwitchHCLogin"].asBool();
849850
return true;
850851
}
851852
/********************************************************************

XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Switch.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ void CDialog_Switch::DoDataExchange(CDataExchange* pDX)
5050
DDX_Control(pDX, IDC_RADIO22, m_RadioBlackClose);
5151
DDX_Control(pDX, IDC_RADIO23, m_RadioTokenOPen);
5252
DDX_Control(pDX, IDC_RADIO24, m_RadioTokenClose);
53+
DDX_Control(pDX, IDC_RADIO25, m_RadioHCLoginOPen);
54+
DDX_Control(pDX, IDC_RADIO26, m_RadioHCLoginClose);
5355
}
5456

5557

@@ -257,6 +259,16 @@ void CDialog_Switch::OnBnClickedButton1()
257259
m_RadioTokenOPen.SetCheck(BST_UNCHECKED);
258260
m_RadioTokenClose.SetCheck(BST_CHECKED);
259261
}
262+
if (st_JsonRoot["bSwitchHCLogin"].asBool())
263+
{
264+
m_RadioHCLoginOPen.SetCheck(BST_CHECKED);
265+
m_RadioHCLoginClose.SetCheck(BST_UNCHECKED);
266+
}
267+
else
268+
{
269+
m_RadioHCLoginOPen.SetCheck(BST_UNCHECKED);
270+
m_RadioHCLoginClose.SetCheck(BST_CHECKED);
271+
}
260272
m_BtnSetConfigure.EnableWindow(true);
261273
}
262274
else
@@ -391,6 +403,14 @@ void CDialog_Switch::OnBnClickedButton2()
391403
{
392404
st_JsonObject["bSwitchTokenLogin"] = false;
393405
}
406+
if (BST_CHECKED == m_RadioHCLoginOPen.GetCheck())
407+
{
408+
st_JsonObject["bSwitchHCLogin"] = true;
409+
}
410+
else
411+
{
412+
st_JsonObject["bSwitchHCLogin"] = false;
413+
}
394414
st_JsonRoot["st_SwitchInfo"] = st_JsonObject;
395415
st_JsonRoot["xhToken"] = _ttoll(m_StrToken.GetBuffer());
396416

XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Switch.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,6 @@ class CDialog_Switch : public CDialogEx
5151
CButton m_RadioBlackClose;
5252
CButton m_RadioTokenOPen;
5353
CButton m_RadioTokenClose;
54+
CButton m_RadioHCLoginOPen;
55+
CButton m_RadioHCLoginClose;
5456
};
Binary file not shown.

XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/resource.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@
9494
#define IDC_RADIO22 1036
9595
#define IDC_RADIO23 1037
9696
#define IDC_RADIO24 1038
97+
#define IDC_RADIO25 1039
98+
#define IDC_RADIO26 1040
9799

98100
// Next default values for new objects
99101
//

0 commit comments

Comments
 (0)