support for querying the server version and OS type for debugging purpose (not in the regular version available)
This commit is contained in:
parent
d080c568a3
commit
388664e48e
13 changed files with 274 additions and 34 deletions
|
@ -199,6 +199,9 @@ QObject::connect ( &Channel, SIGNAL ( OpusSupported() ),
|
||||||
SIGNAL ( CLPingWithNumClientsReceived ( CHostAddress, int, int ) ),
|
SIGNAL ( CLPingWithNumClientsReceived ( CHostAddress, int, int ) ),
|
||||||
this, SLOT ( OnCLPingWithNumClientsReceived ( CHostAddress, int, int ) ) );
|
this, SLOT ( OnCLPingWithNumClientsReceived ( CHostAddress, int, int ) ) );
|
||||||
|
|
||||||
|
QObject::connect ( &ConnLessProtocol,
|
||||||
|
SIGNAL ( CLVersionAndOSReceived ( CHostAddress, COSUtil::EOpSystemType, QString ) ),
|
||||||
|
SIGNAL ( CLVersionAndOSReceived ( CHostAddress, COSUtil::EOpSystemType, QString ) ) );
|
||||||
|
|
||||||
// other
|
// other
|
||||||
QObject::connect ( &Sound, SIGNAL ( ReinitRequest ( int ) ),
|
QObject::connect ( &Sound, SIGNAL ( ReinitRequest ( int ) ),
|
||||||
|
|
10
src/client.h
10
src/client.h
|
@ -260,6 +260,11 @@ public:
|
||||||
0 /* dummy */ );
|
0 /* dummy */ );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CreateCLServerListReqVerAndOSMes ( const CHostAddress& InetAddr )
|
||||||
|
{
|
||||||
|
ConnLessProtocol.CreateCLReqVersionAndOSMes ( InetAddr );
|
||||||
|
}
|
||||||
|
|
||||||
void CreateCLReqServerListMes ( const CHostAddress& InetAddr )
|
void CreateCLReqServerListMes ( const CHostAddress& InetAddr )
|
||||||
{ ConnLessProtocol.CreateCLReqServerListMes ( InetAddr ); }
|
{ ConnLessProtocol.CreateCLReqServerListMes ( InetAddr ); }
|
||||||
|
|
||||||
|
@ -410,6 +415,11 @@ signals:
|
||||||
void CLPingTimeWithNumClientsReceived ( CHostAddress InetAddr,
|
void CLPingTimeWithNumClientsReceived ( CHostAddress InetAddr,
|
||||||
int iPingTime,
|
int iPingTime,
|
||||||
int iNumClients );
|
int iNumClients );
|
||||||
|
|
||||||
|
void CLVersionAndOSReceived ( CHostAddress InetAddr,
|
||||||
|
COSUtil::EOpSystemType eOSType,
|
||||||
|
QString strVersion );
|
||||||
|
|
||||||
void Disconnected();
|
void Disconnected();
|
||||||
|
|
||||||
// #### COMPATIBILITY OLD VERSION, TO BE REMOVED ####
|
// #### COMPATIBILITY OLD VERSION, TO BE REMOVED ####
|
||||||
|
|
|
@ -495,6 +495,10 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
|
||||||
SIGNAL ( CLPingTimeWithNumClientsReceived ( CHostAddress, int, int ) ),
|
SIGNAL ( CLPingTimeWithNumClientsReceived ( CHostAddress, int, int ) ),
|
||||||
this, SLOT ( OnCLPingTimeWithNumClientsReceived ( CHostAddress, int, int ) ) );
|
this, SLOT ( OnCLPingTimeWithNumClientsReceived ( CHostAddress, int, int ) ) );
|
||||||
|
|
||||||
|
QObject::connect ( pClient,
|
||||||
|
SIGNAL ( CLVersionAndOSReceived ( CHostAddress, COSUtil::EOpSystemType, QString ) ),
|
||||||
|
this, SLOT ( OnCLVersionAndOSReceived ( CHostAddress, COSUtil::EOpSystemType, QString ) ) );
|
||||||
|
|
||||||
QObject::connect ( pClient,
|
QObject::connect ( pClient,
|
||||||
SIGNAL ( UpstreamRateChanged() ),
|
SIGNAL ( UpstreamRateChanged() ),
|
||||||
this, SLOT ( OnUpstreamRateChanged() ) );
|
this, SLOT ( OnUpstreamRateChanged() ) );
|
||||||
|
@ -523,6 +527,9 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
|
||||||
QObject::connect ( &ConnectDlg, SIGNAL ( CreateCLServerListPingMes ( CHostAddress ) ),
|
QObject::connect ( &ConnectDlg, SIGNAL ( CreateCLServerListPingMes ( CHostAddress ) ),
|
||||||
this, SLOT ( OnCreateCLServerListPingMes ( CHostAddress ) ) );
|
this, SLOT ( OnCreateCLServerListPingMes ( CHostAddress ) ) );
|
||||||
|
|
||||||
|
QObject::connect ( &ConnectDlg, SIGNAL ( CreateCLServerListReqVerAndOSMes ( CHostAddress ) ),
|
||||||
|
this, SLOT ( OnCreateCLServerListReqVerAndOSMes ( CHostAddress ) ) );
|
||||||
|
|
||||||
QObject::connect ( &ConnectDlg, SIGNAL ( accepted() ),
|
QObject::connect ( &ConnectDlg, SIGNAL ( accepted() ),
|
||||||
this, SLOT ( OnConnectDlgAccepted() ) );
|
this, SLOT ( OnConnectDlgAccepted() ) );
|
||||||
|
|
||||||
|
|
|
@ -129,6 +129,11 @@ public slots:
|
||||||
int iPingTime,
|
int iPingTime,
|
||||||
int iNumClients );
|
int iNumClients );
|
||||||
|
|
||||||
|
void OnCLVersionAndOSReceived ( CHostAddress InetAddr,
|
||||||
|
COSUtil::EOpSystemType eOSType,
|
||||||
|
QString strVersion )
|
||||||
|
{ ConnectDlg.SetVersionAndOSType ( InetAddr, eOSType, strVersion ); }
|
||||||
|
|
||||||
void OnOpenConnectionSetupDialog() { ShowConnectionSetupDialog(); }
|
void OnOpenConnectionSetupDialog() { ShowConnectionSetupDialog(); }
|
||||||
void OnOpenGeneralSettings() { ShowGeneralSettings(); }
|
void OnOpenGeneralSettings() { ShowGeneralSettings(); }
|
||||||
void OnOpenChatDialog() { ShowChatWindow(); }
|
void OnOpenChatDialog() { ShowChatWindow(); }
|
||||||
|
@ -166,6 +171,9 @@ public slots:
|
||||||
void OnCreateCLServerListPingMes ( CHostAddress InetAddr )
|
void OnCreateCLServerListPingMes ( CHostAddress InetAddr )
|
||||||
{ pClient->CreateCLServerListPingMes ( InetAddr ); }
|
{ pClient->CreateCLServerListPingMes ( InetAddr ); }
|
||||||
|
|
||||||
|
void OnCreateCLServerListReqVerAndOSMes ( CHostAddress InetAddr )
|
||||||
|
{ pClient->CreateCLServerListReqVerAndOSMes ( InetAddr ); }
|
||||||
|
|
||||||
void OnCLServerListReceived ( CHostAddress InetAddr,
|
void OnCLServerListReceived ( CHostAddress InetAddr,
|
||||||
CVector<CServerInfo> vecServerInfo )
|
CVector<CServerInfo> vecServerInfo )
|
||||||
{ ConnectDlg.SetServerList ( InetAddr, vecServerInfo ); }
|
{ ConnectDlg.SetServerList ( InetAddr, vecServerInfo ); }
|
||||||
|
|
|
@ -385,7 +385,17 @@ void CConnectDlg::OnTimerPing()
|
||||||
CurServerAddress ) )
|
CurServerAddress ) )
|
||||||
{
|
{
|
||||||
// if address is valid, send ping
|
// if address is valid, send ping
|
||||||
|
|
||||||
|
// TEST send request for version and OS instead of ping message
|
||||||
|
const bool bEnableVerOSDebugging = false; // if this is set the "false", we have to regular version
|
||||||
|
if ( bEnableVerOSDebugging )
|
||||||
|
{
|
||||||
|
emit CreateCLServerListReqVerAndOSMes ( CurServerAddress );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
emit CreateCLServerListPingMes ( CurServerAddress );
|
emit CreateCLServerListPingMes ( CurServerAddress );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -468,3 +478,33 @@ void CConnectDlg::SetPingTimeAndNumClientsResult ( CHostAddress&
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CConnectDlg::SetVersionAndOSType ( CHostAddress InetAddr,
|
||||||
|
COSUtil::EOpSystemType eOSType,
|
||||||
|
QString strVersion )
|
||||||
|
{
|
||||||
|
// apply the received version and OS type to the correct server list entry
|
||||||
|
const int iServerListLen = lvwServers->topLevelItemCount();
|
||||||
|
|
||||||
|
for ( int iIdx = 0; iIdx < iServerListLen; iIdx++ )
|
||||||
|
{
|
||||||
|
// compare the received address with the user data string of the
|
||||||
|
// host address by a string compare
|
||||||
|
if ( !lvwServers->topLevelItem ( iIdx )->
|
||||||
|
data ( 0, Qt::UserRole ).toString().
|
||||||
|
compare ( InetAddr.toString() ) )
|
||||||
|
{
|
||||||
|
// TEST since this is just a debug info, we just reuse the ping column (note
|
||||||
|
// the we have to replace the ping message emit with the version and OS request
|
||||||
|
// so that this works, see above code)
|
||||||
|
lvwServers->topLevelItem ( iIdx )->
|
||||||
|
setText ( 1, strVersion + "/" + COSUtil::GetOperatingSystemString ( eOSType ) );
|
||||||
|
|
||||||
|
// a version and OS type was received, set item to visible
|
||||||
|
if ( lvwServers->topLevelItem ( iIdx )->isHidden() )
|
||||||
|
{
|
||||||
|
lvwServers->topLevelItem ( iIdx )->setHidden ( false );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -62,6 +62,10 @@ public:
|
||||||
const CMultiColorLED::ELightColor ePingTimeLEDColor,
|
const CMultiColorLED::ELightColor ePingTimeLEDColor,
|
||||||
const int iNumClients );
|
const int iNumClients );
|
||||||
|
|
||||||
|
void SetVersionAndOSType ( CHostAddress InetAddr,
|
||||||
|
COSUtil::EOpSystemType eOSType,
|
||||||
|
QString strVersion );
|
||||||
|
|
||||||
bool GetServerListItemWasChosen() const { return bServerListItemWasChosen; }
|
bool GetServerListItemWasChosen() const { return bServerListItemWasChosen; }
|
||||||
QString GetSelectedAddress() const { return strSelectedAddress; }
|
QString GetSelectedAddress() const { return strSelectedAddress; }
|
||||||
QString GetSelectedServerName() const { return strSelectedServerName; }
|
QString GetSelectedServerName() const { return strSelectedServerName; }
|
||||||
|
@ -92,4 +96,5 @@ public slots:
|
||||||
signals:
|
signals:
|
||||||
void ReqServerListQuery ( CHostAddress InetAddr );
|
void ReqServerListQuery ( CHostAddress InetAddr );
|
||||||
void CreateCLServerListPingMes ( CHostAddress InetAddr );
|
void CreateCLServerListPingMes ( CHostAddress InetAddr );
|
||||||
|
void CreateCLServerListReqVerAndOSMes ( CHostAddress InetAddr );
|
||||||
};
|
};
|
||||||
|
|
|
@ -213,6 +213,7 @@ LED bar: lbr
|
||||||
#define MAX_LEN_SERVER_NAME 20
|
#define MAX_LEN_SERVER_NAME 20
|
||||||
#define MAX_LEN_SERVER_TOPIC 32
|
#define MAX_LEN_SERVER_TOPIC 32
|
||||||
#define MAX_LEN_SERVER_CITY 20
|
#define MAX_LEN_SERVER_CITY 20
|
||||||
|
#define MAX_LEN_VERSION_TEXT 20
|
||||||
|
|
||||||
// common tool tip bottom line text
|
// common tool tip bottom line text
|
||||||
#define TOOLTIP_COM_END_TEXT tr ( \
|
#define TOOLTIP_COM_END_TEXT tr ( \
|
||||||
|
|
102
src/protocol.cpp
102
src/protocol.cpp
|
@ -263,6 +263,17 @@ CONNECTION LESS MESSAGES
|
||||||
note: does not have any data -> n = 0
|
note: does not have any data -> n = 0
|
||||||
|
|
||||||
|
|
||||||
|
- PROTMESSID_CLM_VERSION_AND_OS: Version number and operating system
|
||||||
|
|
||||||
|
+-------------------------+------------------+------------------------------+
|
||||||
|
| 1 byte operating system | 2 bytes number n | n bytes UTF-8 string version |
|
||||||
|
+-------------------------+------------------+------------------------------+
|
||||||
|
|
||||||
|
|
||||||
|
- PROTMESSID_CLM_REQ_VERSION_AND_OS: Request version number and operating system
|
||||||
|
|
||||||
|
note: does not have any data -> n = 0
|
||||||
|
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
|
@ -615,6 +626,14 @@ if ( rand() < ( RAND_MAX / 2 ) ) return false;
|
||||||
case PROTMESSID_CLM_DISCONNECTION:
|
case PROTMESSID_CLM_DISCONNECTION:
|
||||||
bRet = EvaluateCLDisconnectionMes ( InetAddr );
|
bRet = EvaluateCLDisconnectionMes ( InetAddr );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PROTMESSID_CLM_VERSION_AND_OS:
|
||||||
|
bRet = EvaluateCLVersionAndOSMes ( InetAddr, vecbyMesBodyData );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PROTMESSID_CLM_REQ_VERSION_AND_OS:
|
||||||
|
bRet = EvaluateCLReqVersionAndOSMes ( InetAddr );
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1784,6 +1803,89 @@ bool CProtocol::EvaluateCLDisconnectionMes ( const CHostAddress& InetAddr )
|
||||||
return false; // no error
|
return false; // no error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CProtocol::CreateCLVersionAndOSMes ( const CHostAddress& InetAddr )
|
||||||
|
{
|
||||||
|
int iPos = 0; // init position pointer
|
||||||
|
|
||||||
|
// get the version number string
|
||||||
|
const QString strVerion = VERSION;
|
||||||
|
|
||||||
|
// convert version string to utf-8
|
||||||
|
const QByteArray strUTF8Version = strVerion.toUtf8();
|
||||||
|
|
||||||
|
// size of current message body
|
||||||
|
const int iEntrLen =
|
||||||
|
1 /* operating system */ +
|
||||||
|
2 /* version utf-8 string size */ + strUTF8Version.size();
|
||||||
|
|
||||||
|
// build data vector
|
||||||
|
CVector<uint8_t> vecData ( iEntrLen );
|
||||||
|
|
||||||
|
// operating system (1 byte)
|
||||||
|
PutValOnStream ( vecData, iPos,
|
||||||
|
static_cast<uint32_t> ( COSUtil::GetOperatingSystem() ), 1 );
|
||||||
|
|
||||||
|
// version
|
||||||
|
PutStringUTF8OnStream ( vecData, iPos, strUTF8Version );
|
||||||
|
|
||||||
|
CreateAndImmSendConLessMessage ( PROTMESSID_CLM_VERSION_AND_OS,
|
||||||
|
vecData,
|
||||||
|
InetAddr );
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CProtocol::EvaluateCLVersionAndOSMes ( const CHostAddress& InetAddr,
|
||||||
|
const CVector<uint8_t>& vecData )
|
||||||
|
{
|
||||||
|
int iPos = 0; // init position pointer
|
||||||
|
const int iDataLen = vecData.Size();
|
||||||
|
|
||||||
|
// check size (the first 1 byte)
|
||||||
|
if ( iDataLen < 1 )
|
||||||
|
{
|
||||||
|
return true; // return error code
|
||||||
|
}
|
||||||
|
|
||||||
|
// operating system (1 byte)
|
||||||
|
const COSUtil::EOpSystemType eOSType =
|
||||||
|
static_cast<COSUtil::EOpSystemType> ( GetValFromStream ( vecData, iPos, 1 ) );
|
||||||
|
|
||||||
|
// version text
|
||||||
|
QString strVersion;
|
||||||
|
if ( GetStringFromStream ( vecData,
|
||||||
|
iPos,
|
||||||
|
MAX_LEN_VERSION_TEXT,
|
||||||
|
strVersion ) )
|
||||||
|
{
|
||||||
|
return true; // return error code
|
||||||
|
}
|
||||||
|
|
||||||
|
// check size: all data is read, the position must now be at the end
|
||||||
|
if ( iPos != iDataLen )
|
||||||
|
{
|
||||||
|
return true; // return error code
|
||||||
|
}
|
||||||
|
|
||||||
|
// invoke message action
|
||||||
|
emit CLVersionAndOSReceived ( InetAddr, eOSType, strVersion );
|
||||||
|
|
||||||
|
return false; // no error
|
||||||
|
}
|
||||||
|
|
||||||
|
void CProtocol::CreateCLReqVersionAndOSMes ( const CHostAddress& InetAddr )
|
||||||
|
{
|
||||||
|
CreateAndImmSendConLessMessage ( PROTMESSID_CLM_REQ_VERSION_AND_OS,
|
||||||
|
CVector<uint8_t> ( 0 ),
|
||||||
|
InetAddr );
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CProtocol::EvaluateCLReqVersionAndOSMes ( const CHostAddress& InetAddr )
|
||||||
|
{
|
||||||
|
// invoke message action
|
||||||
|
emit CLReqVersionAndOS ( InetAddr );
|
||||||
|
|
||||||
|
return false; // no error
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************\
|
/******************************************************************************\
|
||||||
* Message generation and parsing *
|
* Message generation and parsing *
|
||||||
|
|
|
@ -67,10 +67,8 @@
|
||||||
#define PROTMESSID_CLM_SEND_EMPTY_MESSAGE 1008 // an empty message shall be send
|
#define PROTMESSID_CLM_SEND_EMPTY_MESSAGE 1008 // an empty message shall be send
|
||||||
#define PROTMESSID_CLM_EMPTY_MESSAGE 1009 // empty message
|
#define PROTMESSID_CLM_EMPTY_MESSAGE 1009 // empty message
|
||||||
#define PROTMESSID_CLM_DISCONNECTION 1010 // disconnection
|
#define PROTMESSID_CLM_DISCONNECTION 1010 // disconnection
|
||||||
|
#define PROTMESSID_CLM_VERSION_AND_OS 1011 // version number and operating system
|
||||||
|
#define PROTMESSID_CLM_REQ_VERSION_AND_OS 1012 // request version number and operating system
|
||||||
// TODO implement message for querying the version and operating system of the server
|
|
||||||
|
|
||||||
|
|
||||||
// lengths of message as defined in protocol.cpp file
|
// lengths of message as defined in protocol.cpp file
|
||||||
#define MESS_HEADER_LENGTH_BYTE 7 // TAG (2), ID (2), cnt (1), length (2)
|
#define MESS_HEADER_LENGTH_BYTE 7 // TAG (2), ID (2), cnt (1), length (2)
|
||||||
|
@ -104,21 +102,23 @@ public:
|
||||||
void CreateReqNetwTranspPropsMes();
|
void CreateReqNetwTranspPropsMes();
|
||||||
void CreateOpusSupportedMes();
|
void CreateOpusSupportedMes();
|
||||||
|
|
||||||
void CreateCLPingMes ( const CHostAddress& InetAddr, const int iMs );
|
void CreateCLPingMes ( const CHostAddress& InetAddr, const int iMs );
|
||||||
void CreateCLPingWithNumClientsMes ( const CHostAddress& InetAddr,
|
void CreateCLPingWithNumClientsMes ( const CHostAddress& InetAddr,
|
||||||
const int iMs,
|
const int iMs,
|
||||||
const int iNumClients );
|
const int iNumClients );
|
||||||
void CreateCLServerFullMes ( const CHostAddress& InetAddr );
|
void CreateCLServerFullMes ( const CHostAddress& InetAddr );
|
||||||
void CreateCLRegisterServerMes ( const CHostAddress& InetAddr,
|
void CreateCLRegisterServerMes ( const CHostAddress& InetAddr,
|
||||||
const CServerCoreInfo& ServerInfo );
|
const CServerCoreInfo& ServerInfo );
|
||||||
void CreateCLUnregisterServerMes ( const CHostAddress& InetAddr );
|
void CreateCLUnregisterServerMes ( const CHostAddress& InetAddr );
|
||||||
void CreateCLServerListMes ( const CHostAddress& InetAddr,
|
void CreateCLServerListMes ( const CHostAddress& InetAddr,
|
||||||
const CVector<CServerInfo> vecServerInfo );
|
const CVector<CServerInfo> vecServerInfo );
|
||||||
void CreateCLReqServerListMes ( const CHostAddress& InetAddr );
|
void CreateCLReqServerListMes ( const CHostAddress& InetAddr );
|
||||||
void CreateCLSendEmptyMesMes ( const CHostAddress& InetAddr,
|
void CreateCLSendEmptyMesMes ( const CHostAddress& InetAddr,
|
||||||
const CHostAddress& TargetInetAddr );
|
const CHostAddress& TargetInetAddr );
|
||||||
void CreateCLEmptyMes ( const CHostAddress& InetAddr );
|
void CreateCLEmptyMes ( const CHostAddress& InetAddr );
|
||||||
void CreateCLDisconnection ( const CHostAddress& InetAddr );
|
void CreateCLDisconnection ( const CHostAddress& InetAddr );
|
||||||
|
void CreateCLVersionAndOSMes ( const CHostAddress& InetAddr );
|
||||||
|
void CreateCLReqVersionAndOSMes ( const CHostAddress& InetAddr );
|
||||||
|
|
||||||
static bool ParseMessageFrame ( const CVector<uint8_t>& vecbyData,
|
static bool ParseMessageFrame ( const CVector<uint8_t>& vecbyData,
|
||||||
const int iNumBytesIn,
|
const int iNumBytesIn,
|
||||||
|
@ -228,6 +228,9 @@ protected:
|
||||||
bool EvaluateCLReqServerListMes ( const CHostAddress& InetAddr );
|
bool EvaluateCLReqServerListMes ( const CHostAddress& InetAddr );
|
||||||
bool EvaluateCLSendEmptyMesMes ( const CVector<uint8_t>& vecData );
|
bool EvaluateCLSendEmptyMesMes ( const CVector<uint8_t>& vecData );
|
||||||
bool EvaluateCLDisconnectionMes ( const CHostAddress& InetAddr );
|
bool EvaluateCLDisconnectionMes ( const CHostAddress& InetAddr );
|
||||||
|
bool EvaluateCLVersionAndOSMes ( const CHostAddress& InetAddr,
|
||||||
|
const CVector<uint8_t>& vecData );
|
||||||
|
bool EvaluateCLReqVersionAndOSMes ( const CHostAddress& InetAddr );
|
||||||
|
|
||||||
int iOldRecID;
|
int iOldRecID;
|
||||||
int iOldRecCnt;
|
int iOldRecCnt;
|
||||||
|
@ -265,19 +268,23 @@ signals:
|
||||||
void NetTranspPropsReceived ( CNetworkTransportProps NetworkTransportProps );
|
void NetTranspPropsReceived ( CNetworkTransportProps NetworkTransportProps );
|
||||||
void ReqNetTranspProps();
|
void ReqNetTranspProps();
|
||||||
|
|
||||||
void CLPingReceived ( CHostAddress InetAddr,
|
void CLPingReceived ( CHostAddress InetAddr,
|
||||||
int iMs );
|
int iMs );
|
||||||
void CLPingWithNumClientsReceived ( CHostAddress InetAddr,
|
void CLPingWithNumClientsReceived ( CHostAddress InetAddr,
|
||||||
int iMs,
|
int iMs,
|
||||||
int iNumClients );
|
int iNumClients );
|
||||||
void CLRegisterServerReceived ( CHostAddress InetAddr,
|
void CLRegisterServerReceived ( CHostAddress InetAddr,
|
||||||
CServerCoreInfo ServerInfo );
|
CServerCoreInfo ServerInfo );
|
||||||
void CLUnregisterServerReceived ( CHostAddress InetAddr );
|
void CLUnregisterServerReceived ( CHostAddress InetAddr );
|
||||||
void CLServerListReceived ( CHostAddress InetAddr,
|
void CLServerListReceived ( CHostAddress InetAddr,
|
||||||
CVector<CServerInfo> vecServerInfo );
|
CVector<CServerInfo> vecServerInfo );
|
||||||
void CLReqServerList ( CHostAddress InetAddr );
|
void CLReqServerList ( CHostAddress InetAddr );
|
||||||
void CLSendEmptyMes ( CHostAddress TargetInetAddr );
|
void CLSendEmptyMes ( CHostAddress TargetInetAddr );
|
||||||
void CLDisconnection ( CHostAddress InetAddr );
|
void CLDisconnection ( CHostAddress InetAddr );
|
||||||
|
void CLVersionAndOSReceived ( CHostAddress InetAddr,
|
||||||
|
COSUtil::EOpSystemType eOSType,
|
||||||
|
QString strVersion );
|
||||||
|
void CLReqVersionAndOS ( CHostAddress InetAddr );
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* !defined ( PROTOCOL_H__3B123453_4344_BB2392354455IUHF1912__INCLUDED_ ) */
|
#endif /* !defined ( PROTOCOL_H__3B123453_4344_BB2392354455IUHF1912__INCLUDED_ ) */
|
||||||
|
|
|
@ -422,6 +422,9 @@ CServer::CServer ( const int iNewMaxNumChan,
|
||||||
SIGNAL ( CLDisconnection ( CHostAddress ) ),
|
SIGNAL ( CLDisconnection ( CHostAddress ) ),
|
||||||
this, SLOT ( OnCLDisconnection ( CHostAddress ) ) );
|
this, SLOT ( OnCLDisconnection ( CHostAddress ) ) );
|
||||||
|
|
||||||
|
QObject::connect ( &ConnLessProtocol,
|
||||||
|
SIGNAL ( CLReqVersionAndOS ( CHostAddress ) ),
|
||||||
|
this, SLOT ( OnCLReqVersionAndOS ( CHostAddress ) ) );
|
||||||
|
|
||||||
// CODE TAG: MAX_NUM_CHANNELS_TAG
|
// CODE TAG: MAX_NUM_CHANNELS_TAG
|
||||||
// make sure we have MAX_NUM_CHANNELS connections!!!
|
// make sure we have MAX_NUM_CHANNELS connections!!!
|
||||||
|
|
|
@ -317,6 +317,9 @@ public slots:
|
||||||
void OnCLReqServerList ( CHostAddress InetAddr )
|
void OnCLReqServerList ( CHostAddress InetAddr )
|
||||||
{ ServerListManager.CentralServerQueryServerList ( InetAddr ); }
|
{ ServerListManager.CentralServerQueryServerList ( InetAddr ); }
|
||||||
|
|
||||||
|
void OnCLReqVersionAndOS ( CHostAddress InetAddr )
|
||||||
|
{ ConnLessProtocol.CreateCLVersionAndOSMes ( InetAddr ); }
|
||||||
|
|
||||||
void OnCLRegisterServerReceived ( CHostAddress InetAddr,
|
void OnCLRegisterServerReceived ( CHostAddress InetAddr,
|
||||||
CServerCoreInfo ServerInfo )
|
CServerCoreInfo ServerInfo )
|
||||||
{
|
{
|
||||||
|
|
|
@ -106,7 +106,7 @@ public slots:
|
||||||
CChannelCoreInfo ChannelCoreInfo;
|
CChannelCoreInfo ChannelCoreInfo;
|
||||||
|
|
||||||
// generate random protocol message
|
// generate random protocol message
|
||||||
switch ( GenRandomIntInRange ( 0, 24 ) )
|
switch ( GenRandomIntInRange ( 0, 26 ) )
|
||||||
{
|
{
|
||||||
case 0: // PROTMESSID_JITT_BUF_SIZE
|
case 0: // PROTMESSID_JITT_BUF_SIZE
|
||||||
Protocol.CreateJitBufMes ( GenRandomIntInRange ( 0, 10 ) );
|
Protocol.CreateJitBufMes ( GenRandomIntInRange ( 0, 10 ) );
|
||||||
|
@ -260,12 +260,20 @@ public slots:
|
||||||
Protocol.CreateCLDisconnection ( CurHostAddress );
|
Protocol.CreateCLDisconnection ( CurHostAddress );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 23: // PROTMESSID_ACKN
|
case 23: // PROTMESSID_CLM_VERSION_AND_OS
|
||||||
Protocol.CreateAndImmSendAcknMess ( GenRandomIntInRange ( -10, 100 ),
|
Protocol.CreateCLVersionAndOSMes ( CurHostAddress );
|
||||||
GenRandomIntInRange ( -100, 100 ) );
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 24:
|
case 24: // PROTMESSID_CLM_REQ_VERSION_AND_OS
|
||||||
|
Protocol.CreateCLReqVersionAndOSMes ( CurHostAddress );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 25: // PROTMESSID_ACKN
|
||||||
|
Protocol.CreateAndImmSendAcknMess ( GenRandomIntInRange ( -10, 100 ),
|
||||||
|
GenRandomIntInRange ( -100, 100 ) );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 26:
|
||||||
// arbitrary "audio" packet (with random sizes)
|
// arbitrary "audio" packet (with random sizes)
|
||||||
CVector<uint8_t> vecMessage ( GenRandomIntInRange ( 1, 1000 ) );
|
CVector<uint8_t> vecMessage ( GenRandomIntInRange ( 1, 1000 ) );
|
||||||
OnSendProtMessage ( vecMessage );
|
OnSendProtMessage ( vecMessage );
|
||||||
|
|
43
src/util.h
43
src/util.h
|
@ -861,6 +861,49 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Operating system utility functions ------------------------------------------
|
||||||
|
class COSUtil
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
enum EOpSystemType
|
||||||
|
{
|
||||||
|
// used for protocol -> enum values must be fixed!
|
||||||
|
OT_WINDOWS = 0,
|
||||||
|
OT_MAC_OS = 1,
|
||||||
|
OT_LINUX = 2,
|
||||||
|
OT_ANDROID = 3,
|
||||||
|
OT_I_OS = 4,
|
||||||
|
OT_UNIX = 5
|
||||||
|
};
|
||||||
|
|
||||||
|
static QString GetOperatingSystemString ( const EOpSystemType eOSType )
|
||||||
|
{
|
||||||
|
switch ( eOSType )
|
||||||
|
{
|
||||||
|
case OT_WINDOWS: return "Windows"; break;
|
||||||
|
case OT_MAC_OS: return "MacOS"; break;
|
||||||
|
case OT_LINUX: return "Linux"; break;
|
||||||
|
case OT_ANDROID: return "Android"; break;
|
||||||
|
case OT_I_OS: return "iOS"; break;
|
||||||
|
case OT_UNIX: return "Unix"; break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static EOpSystemType GetOperatingSystem()
|
||||||
|
{
|
||||||
|
#ifdef _WIN32
|
||||||
|
return OT_WINDOWS;
|
||||||
|
#elif defined ( __APPLE__ ) || defined ( __MACOSX )
|
||||||
|
return OT_MAC_OS;
|
||||||
|
#elif definded ( ANDROID )
|
||||||
|
return OT_ANDROID;
|
||||||
|
#else
|
||||||
|
return OT_LINUX;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// Audio reverbration ----------------------------------------------------------
|
// Audio reverbration ----------------------------------------------------------
|
||||||
class CAudioReverb
|
class CAudioReverb
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue