Skip to content

Commit 174eb50

Browse files
committed
Create CLM_TCP_SUPPORTED and related methods
1 parent 4e513ce commit 174eb50

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

src/protocol.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,12 @@ CONNECTION LESS MESSAGES
432432
five times for one registration request at 500ms intervals.
433433
Beyond this, it should "ping" every 15 minutes
434434
(standard re-registration timeout).
435+
436+
437+
- PROTMESSID_CLM_TCP_SUPPORTED: TCP supported message
438+
439+
note: does not have any data -> n = 0
440+
435441
*/
436442

437443
#include "protocol.h"
@@ -922,6 +928,10 @@ void CProtocol::ParseConnectionLessMessageBody ( const CVector<uint8_t>& vecbyMe
922928
case PROTMESSID_CLM_REGISTER_SERVER_RESP:
923929
EvaluateCLRegisterServerResp ( InetAddr, vecbyMesBodyData );
924930
break;
931+
932+
case PROTMESSID_CLM_TCP_SUPPORTED:
933+
EvaluateCLTcpSupportedMes ( InetAddr );
934+
break;
925935
}
926936
}
927937

@@ -2585,6 +2595,19 @@ bool CProtocol::EvaluateCLRegisterServerResp ( const CHostAddress& InetAddr, con
25852595
return false; // no error
25862596
}
25872597

2598+
void CProtocol::CreateCLTcpSupportedMes ( const CHostAddress& InetAddr )
2599+
{
2600+
CreateAndImmSendConLessMessage ( PROTMESSID_CLM_TCP_SUPPORTED, CVector<uint8_t> ( 0 ), InetAddr );
2601+
}
2602+
2603+
bool CProtocol::EvaluateCLTcpSupportedMes ( const CHostAddress& InetAddr )
2604+
{
2605+
// invoke message action
2606+
emit CLTcpSupported ( InetAddr );
2607+
2608+
return false; // no error
2609+
}
2610+
25882611
/******************************************************************************\
25892612
* Message generation and parsing *
25902613
\******************************************************************************/

src/protocol.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
#define PROTMESSID_CLM_REGISTER_SERVER_RESP 1016 // status of server registration request
8585
#define PROTMESSID_CLM_REGISTER_SERVER_EX 1017 // register server with extended information
8686
#define PROTMESSID_CLM_RED_SERVER_LIST 1018 // reduced server list
87+
#define PROTMESSID_CLM_TCP_SUPPORTED 1019 // TCP is supported
8788

8889
// special IDs
8990
#define PROTMESSID_SPECIAL_SPLIT_MESSAGE 2001 // a container for split messages
@@ -154,6 +155,7 @@ class CProtocol : public QObject
154155
void CreateCLReqConnClientsListMes ( const CHostAddress& InetAddr );
155156
void CreateCLChannelLevelListMes ( const CHostAddress& InetAddr, const CVector<uint16_t>& vecLevelList, const int iNumClients );
156157
void CreateCLRegisterServerResp ( const CHostAddress& InetAddr, const ESvrRegResult eResult );
158+
void CreateCLTcpSupportedMes ( const CHostAddress& InetAddr );
157159

158160
static int GetBodyLength ( const CVector<uint8_t>& vecbyData );
159161

@@ -288,6 +290,7 @@ class CProtocol : public QObject
288290
bool EvaluateCLReqConnClientsListMes ( const CHostAddress& InetAddr, CTcpConnection* pTcpConnection );
289291
bool EvaluateCLChannelLevelListMes ( const CHostAddress& InetAddr, const CVector<uint8_t>& vecData );
290292
bool EvaluateCLRegisterServerResp ( const CHostAddress& InetAddr, const CVector<uint8_t>& vecData );
293+
bool EvaluateCLTcpSupportedMes ( const CHostAddress& InetAddr );
291294

292295
int iOldRecID;
293296
int iOldRecCnt;
@@ -354,4 +357,5 @@ public slots:
354357
void CLReqConnClientsList ( CHostAddress InetAddr, CTcpConnection* pTcpConnection );
355358
void CLChannelLevelListReceived ( CHostAddress InetAddr, CVector<uint16_t> vecLevelList );
356359
void CLRegisterServerResp ( CHostAddress InetAddr, ESvrRegResult eStatus );
360+
void CLTcpSupported ( CHostAddress InetAddr );
357361
};

0 commit comments

Comments
 (0)