diff --git a/src/protocol.cpp b/src/protocol.cpp index 335856ad93..f158ab0730 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -484,6 +484,14 @@ CONNECTION LESS MESSAGES note: does not have any data -> n = 0 + +- PROTMESSID_CLM_REQ_CHANNEL_LEVEL_LIST: Request the channel level list + + note: does not have any data -> n = 0 + + the server replies with one PROTMESSID_CLM_CHANNEL_LEVEL_LIST to the + requesting address + */ #include "protocol.h" @@ -980,6 +988,10 @@ void CProtocol::ParseConnectionLessMessageBody ( const CVector& vecbyMe case PROTMESSID_CLM_REQ_WELCOME_MESSAGE: EvaluateCLReqWelcomeMessageMes ( InetAddr ); break; + + case PROTMESSID_CLM_REQ_CHANNEL_LEVEL_LIST: + EvaluateCLReqChannelLevelListMes ( InetAddr ); + break; } } @@ -2700,6 +2712,14 @@ void CProtocol::CreateCLWelcomeMessageMes ( const CHostAddress& InetAddr, const CreateAndImmSendConLessMessage ( PROTMESSID_CLM_WELCOME_MESSAGE, vecData, InetAddr ); } +bool CProtocol::EvaluateCLReqChannelLevelListMes ( const CHostAddress& InetAddr ) +{ + // invoke message action + emit CLReqChannelLevelList ( InetAddr ); + + return false; // no error +} + /******************************************************************************\ * Message generation and parsing * \******************************************************************************/ diff --git a/src/protocol.h b/src/protocol.h index 8d4125a9ab..a86073ad9b 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -110,6 +110,7 @@ #define PROTMESSID_CLM_REQ_SERVER_FEATURES 1020 // request server features #define PROTMESSID_CLM_WELCOME_MESSAGE 1021 // server welcome message #define PROTMESSID_CLM_REQ_WELCOME_MESSAGE 1022 // request server welcome message +#define PROTMESSID_CLM_REQ_CHANNEL_LEVEL_LIST 1025 // request channel level list (connectionless) // special IDs #define PROTMESSID_SPECIAL_SPLIT_MESSAGE 2001 // a container for split messages @@ -312,6 +313,7 @@ class CProtocol : public QObject bool EvaluateCLRegisterServerResp ( const CHostAddress& InetAddr, const CVector& vecData ); bool EvaluateCLReqServerFeaturesMes ( const CHostAddress& InetAddr ); bool EvaluateCLReqWelcomeMessageMes ( const CHostAddress& InetAddr ); + bool EvaluateCLReqChannelLevelListMes ( const CHostAddress& InetAddr ); int iOldRecID; int iOldRecCnt; @@ -381,4 +383,5 @@ public slots: void CLRegisterServerResp ( CHostAddress InetAddr, ESvrRegResult eStatus ); void CLReqServerFeatures ( CHostAddress InetAddr ); void CLReqWelcomeMessage ( CHostAddress InetAddr ); + void CLReqChannelLevelList ( CHostAddress InetAddr ); }; diff --git a/src/server.cpp b/src/server.cpp index ce2669cbf7..a261192a96 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -296,6 +296,8 @@ CServer::CServer ( const int iNewMaxNumChan, QObject::connect ( &ConnLessProtocol, &CProtocol::CLReqWelcomeMessage, this, &CServer::OnCLReqWelcomeMessage ); + QObject::connect ( &ConnLessProtocol, &CProtocol::CLReqChannelLevelList, this, &CServer::OnCLReqChannelLevelList ); + QObject::connect ( &ServerListManager, &CServerListManager::SvrRegStatusChanged, this, &CServer::SvrRegStatusChanged ); QObject::connect ( &JamController, &recorder::CJamController::RestartRecorder, this, &CServer::RestartRecorder ); diff --git a/src/server.h b/src/server.h index b92f3f2656..1471eceeb2 100644 --- a/src/server.h +++ b/src/server.h @@ -405,6 +405,11 @@ public slots: void OnCLReqWelcomeMessage ( CHostAddress InetAddr ); + void OnCLReqChannelLevelList ( CHostAddress InetAddr ) + { + ConnLessProtocol.CreateCLChannelLevelListMes ( InetAddr, vecChannelLevels, GetNumberOfConnectedClients() ); + } + void OnCLDisconnection ( CHostAddress InetAddr ); void OnAboutToQuit();