Skip to content

Commit 1d2d21f

Browse files
committed
fixed:websocket size lost
modify:verification type string from module
1 parent 58c9aec commit 1d2d21f

File tree

3 files changed

+7
-22
lines changed

3 files changed

+7
-22
lines changed

XEngine_Source/AuthorizeModule_Protocol/Protocol_Parse/Protocol_Parse.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ bool CProtocol_Parse::Protocol_Parse_WSHdr(LPCXSTR lpszMsgBuffer, int nMsgLen, X
7272
pSt_ProtocolHdr->unOperatorCode = st_JsonRoot["unOperatorCode"].asInt();
7373
pSt_ProtocolHdr->byIsReply = st_JsonRoot["byIsReply"].asInt();
7474
pSt_ProtocolHdr->wCrypto = st_JsonRoot["wCrypto"].asInt();
75+
pSt_ProtocolHdr->unPacketSize = sizeof(XENGINE_PROTOCOL_USERAUTHEX);
7576
if (!st_JsonRoot["xhToken"].isNull())
7677
{
7778
pSt_ProtocolHdr->xhToken = st_JsonRoot["xhToken"].asUInt64();
@@ -185,10 +186,6 @@ bool CProtocol_Parse::Protocol_Parse_HttpParseAuth(LPCXSTR lpszMsgBuffer, int nM
185186
{
186187
_tcsxcpy(pSt_UserAuth->tszUserPass, st_JsonProtocol["tszUserPass"].asCString());
187188
}
188-
if (!st_JsonProtocol["tszDCode"].isNull())
189-
{
190-
_tcsxcpy(pSt_UserAuth->tszDCode, st_JsonProtocol["tszDCode"].asCString());
191-
}
192189
if (!st_JsonProtocol["enClientType"].isNull())
193190
{
194191
pSt_UserAuth->enClientType = (ENUM_PROTOCOLCLIENT_TYPE)st_JsonProtocol["enClientType"].asInt();
@@ -197,6 +194,10 @@ bool CProtocol_Parse::Protocol_Parse_HttpParseAuth(LPCXSTR lpszMsgBuffer, int nM
197194
{
198195
pSt_UserAuth->enDeviceType = (ENUM_PROTOCOLDEVICE_TYPE)st_JsonProtocol["enDeviceType"].asInt();
199196
}
197+
if (!st_JsonProtocol["tszDCode"].isNull())
198+
{
199+
_tcsxcpy(pSt_UserAuth->tszDCode, st_JsonProtocol["tszDCode"].asCString());
200+
}
200201
if (!st_JsonProtocol["tszHWCode"].isNull())
201202
{
202203
_tcsxcpy(pSt_UserAuth->tszHWCode, st_JsonProtocol["tszHWCode"].asCString());

XEngine_Source/XAuth_Protocol.h

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,10 @@
4444
#define ERROR_AUTHORIZE_PROTOCOL_PERMISSION 0x116 //用户权限错误
4545
#define ERROR_AUTHORIZE_PROTOCOL_EXPIRED 0x117 //已经过期
4646
#define ERROR_AUTHORIZE_PROTOCOL_CDKEY 0x118 //CDKEY错误
47-
47+
//////////////////////////////////////////////////////////////////////////
4848
#define ERROR_AUTHORIZE_PROTOCOL_SERVER 0x201 //服务端内部错误
4949
#define ERROR_AUTHORIZE_PROTOCOL_LIMIT 0x202 //服务端内部限制,数据过大后者过小
5050
//////////////////////////////////////////////////////////////////////////
51-
// 导出的枚举型
52-
//////////////////////////////////////////////////////////////////////////
53-
#ifndef _MSC_BUILD
54-
#pragma GCC diagnostic push
55-
#pragma GCC diagnostic ignored "-Wunused-variable"
56-
#endif
57-
static LPCXSTR lpszXSerialType[5] = { "UNKNOW","SECOND","DAY","TIME","CUSTOM" };
58-
static LPCXSTR lpszXRegType[6] = { "UNKNOW","TEMP","TRY","OFFICIAL","UNLIMIT","EXPIRED" };
59-
static LPCXSTR lpszXHDType[6] = { "UNKNOW","CPU","DISK","BOARD","MAC","BIOS" };
60-
static LPCXSTR lpszXVerType[6] = { "UNKNOW","LOCAL","NETWORK" };
61-
#ifndef _MSC_BUILD
62-
#pragma GCC diagnostic pop
63-
#endif
64-
//////////////////////////////////////////////////////////////////////////
6551
// 导出的结构体
6652
//////////////////////////////////////////////////////////////////////////
6753
//充值协议

XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_WSTask.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,7 @@ bool XEngine_Client_WSTask(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int nM
7676

7777
if (XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_AUTH_REQLOGIN == st_ProtocolHdr.unOperatorCode)
7878
{
79-
XENGINE_PROTOCOL_USERAUTHEX st_UserAuth;
80-
memset(&st_UserAuth, '\0', sizeof(XENGINE_PROTOCOL_USERAUTHEX));
81-
79+
XENGINE_PROTOCOL_USERAUTHEX st_UserAuth = {};
8280
Protocol_Parse_HttpParseAuth(lpszMsgBuffer, nMsgLen, &st_UserAuth);
8381
XEngine_Client_TCPTask(lpszClientAddr, (LPCXSTR)&st_UserAuth, sizeof(XENGINE_PROTOCOL_USERAUTHEX), &st_ProtocolHdr, XENGINE_AUTH_APP_NETTYPE_WS);
8482
}

0 commit comments

Comments
 (0)