Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -980,6 +988,10 @@ void CProtocol::ParseConnectionLessMessageBody ( const CVector<uint8_t>& vecbyMe
case PROTMESSID_CLM_REQ_WELCOME_MESSAGE:
EvaluateCLReqWelcomeMessageMes ( InetAddr );
break;

case PROTMESSID_CLM_REQ_CHANNEL_LEVEL_LIST:
EvaluateCLReqChannelLevelListMes ( InetAddr );
break;
}
}

Expand Down Expand Up @@ -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 *
\******************************************************************************/
Expand Down
3 changes: 3 additions & 0 deletions src/protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -312,6 +313,7 @@ class CProtocol : public QObject
bool EvaluateCLRegisterServerResp ( const CHostAddress& InetAddr, const CVector<uint8_t>& vecData );
bool EvaluateCLReqServerFeaturesMes ( const CHostAddress& InetAddr );
bool EvaluateCLReqWelcomeMessageMes ( const CHostAddress& InetAddr );
bool EvaluateCLReqChannelLevelListMes ( const CHostAddress& InetAddr );

int iOldRecID;
int iOldRecCnt;
Expand Down Expand Up @@ -381,4 +383,5 @@ public slots:
void CLRegisterServerResp ( CHostAddress InetAddr, ESvrRegResult eStatus );
void CLReqServerFeatures ( CHostAddress InetAddr );
void CLReqWelcomeMessage ( CHostAddress InetAddr );
void CLReqChannelLevelList ( CHostAddress InetAddr );
};
2 changes: 2 additions & 0 deletions src/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
5 changes: 5 additions & 0 deletions src/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Loading