removed unneccessary protocol message
This commit is contained in:
parent
e664b5769c
commit
5bc9a2ea0c
4 changed files with 10 additions and 66 deletions
|
@ -115,14 +115,6 @@ public:
|
|||
void CreateChatTextMes ( const QString& strChatText ) { Protocol.CreateChatTextMes ( strChatText ); }
|
||||
void CreatePingMes ( const int iMs ) { Protocol.CreatePingMes ( iMs ); }
|
||||
|
||||
void CreateNetwBlSiFactMes ( const int iNetwBlSiFact )
|
||||
{
|
||||
if ( ProtocolIsEnabled() )
|
||||
{
|
||||
Protocol.CreateNetwBlSiFactMes ( iNetwBlSiFact );
|
||||
}
|
||||
}
|
||||
|
||||
void CreateConClientListMes ( const CVector<CChannelShortInfo>& vecChanInfo )
|
||||
{
|
||||
Protocol.CreateConClientListMes ( vecChanInfo );
|
||||
|
|
|
@ -60,15 +60,6 @@ MESSAGES
|
|||
note: does not have any data -> n = 0
|
||||
|
||||
|
||||
- Network buffer block size factor: PROTMESSID_NET_BLSI_FACTOR
|
||||
|
||||
note: size, relative to minimum block size
|
||||
|
||||
+----------------+
|
||||
| 2 bytes factor |
|
||||
+----------------+
|
||||
|
||||
|
||||
- Gain of channel: PROTMESSID_CHANNEL_GAIN
|
||||
|
||||
+-------------------+--------------+
|
||||
|
@ -378,10 +369,6 @@ if ( rand() < ( RAND_MAX / 2 ) ) return false;
|
|||
bRet = EvaluateServerFullMes ( vecData );
|
||||
break;
|
||||
|
||||
case PROTMESSID_NET_BLSI_FACTOR:
|
||||
bRet = EvaluateNetwBlSiFactMes ( vecData );
|
||||
break;
|
||||
|
||||
case PROTMESSID_CHANNEL_GAIN:
|
||||
bRet = EvaluateChanGainMes ( vecData );
|
||||
break;
|
||||
|
@ -496,36 +483,6 @@ bool CProtocol::EvaluateServerFullMes ( const CVector<uint8_t>& vecData )
|
|||
return false; // no error
|
||||
}
|
||||
|
||||
void CProtocol::CreateNetwBlSiFactMes ( const int iNetwBlSiFact )
|
||||
{
|
||||
CVector<uint8_t> vecData ( 2 ); // 2 bytes of data
|
||||
unsigned int iPos = 0; // init position pointer
|
||||
|
||||
// build data vector
|
||||
PutValOnStream ( vecData, iPos, static_cast<uint32_t> ( iNetwBlSiFact ), 2 );
|
||||
|
||||
CreateAndSendMessage ( PROTMESSID_NET_BLSI_FACTOR, vecData );
|
||||
}
|
||||
|
||||
bool CProtocol::EvaluateNetwBlSiFactMes ( const CVector<uint8_t>& vecData )
|
||||
{
|
||||
unsigned int iPos = 0; // init position pointer
|
||||
|
||||
// check size
|
||||
if ( vecData.Size() != 2 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
const int iData =
|
||||
static_cast<int> ( GetValFromStream ( vecData, iPos, 2 ) );
|
||||
|
||||
// invoke message action
|
||||
emit ChangeNetwBlSiFact ( iData );
|
||||
|
||||
return false; // no error
|
||||
}
|
||||
|
||||
void CProtocol::CreateChanGainMes ( const int iChanID, const double dGain )
|
||||
{
|
||||
CVector<uint8_t> vecData ( 3 ); // 3 bytes of data
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
#define PROTMESSID_ACKN 1 // acknowledge
|
||||
#define PROTMESSID_JITT_BUF_SIZE 10 // jitter buffer size
|
||||
#define PROTMESSID_REQ_JITT_BUF_SIZE 11 // request jitter buffer size
|
||||
#define PROTMESSID_NET_BLSI_FACTOR 12 // network buffer size factor
|
||||
#define PROTMESSID_NET_BLSI_FACTOR 12 // OLD (not used anymore)
|
||||
#define PROTMESSID_CHANNEL_GAIN 13 // set channel gain for mix
|
||||
#define PROTMESSID_CONN_CLIENTS_LIST 14 // connected client list
|
||||
#define PROTMESSID_SERVER_FULL 15 // server full message
|
||||
|
@ -143,7 +143,6 @@ protected:
|
|||
|
||||
bool EvaluateJitBufMes ( const CVector<uint8_t>& vecData );
|
||||
bool EvaluateReqJitBufMes ( const CVector<uint8_t>& vecData );
|
||||
bool EvaluateNetwBlSiFactMes ( const CVector<uint8_t>& vecData );
|
||||
bool EvaluateChanGainMes ( const CVector<uint8_t>& vecData );
|
||||
bool EvaluateConClientListMes ( const CVector<uint8_t>& vecData );
|
||||
bool EvaluateServerFullMes ( const CVector<uint8_t>& vecData );
|
||||
|
|
|
@ -74,7 +74,7 @@ public slots:
|
|||
void OnTimer()
|
||||
{
|
||||
// generate random protocol message
|
||||
switch ( GenRandomIntInRange ( 0, 11 ) )
|
||||
switch ( GenRandomIntInRange ( 0, 10 ) )
|
||||
{
|
||||
case 0:
|
||||
Protocol.CreateJitBufMes ( GenRandomIntInRange ( 0, 10 ) );
|
||||
|
@ -85,46 +85,42 @@ public slots:
|
|||
break;
|
||||
|
||||
case 2:
|
||||
Protocol.CreateNetwBlSiFactMes ( GenRandomIntInRange ( 0, 10 ) );
|
||||
break;
|
||||
|
||||
case 3:
|
||||
Protocol.CreateChanGainMes ( GenRandomIntInRange ( 0, 20 ),
|
||||
GenRandomIntInRange ( -100, 100 ) );
|
||||
break;
|
||||
|
||||
case 4:
|
||||
case 3:
|
||||
Protocol.CreateServerFullMes();
|
||||
break;
|
||||
|
||||
case 5:
|
||||
case 4:
|
||||
Protocol.CreateReqConnClientsList();
|
||||
break;
|
||||
|
||||
case 6:
|
||||
case 5:
|
||||
Protocol.CreateChanNameMes ( QString ( "test%1" ).arg (
|
||||
GenRandomIntInRange ( 0, 1000 ) ) );
|
||||
break;
|
||||
|
||||
case 7:
|
||||
case 6:
|
||||
Protocol.CreateChatTextMes ( QString ( "test%1" ).arg (
|
||||
GenRandomIntInRange ( 0, 1000 ) ) );
|
||||
break;
|
||||
|
||||
case 8:
|
||||
case 7:
|
||||
Protocol.CreatePingMes ( GenRandomIntInRange ( 0, 100000 ) );
|
||||
break;
|
||||
|
||||
case 9:
|
||||
case 8:
|
||||
Protocol.CreateReqNetwTranspPropsMes();
|
||||
break;
|
||||
|
||||
case 10:
|
||||
case 9:
|
||||
Protocol.CreateAndImmSendAcknMess ( GenRandomIntInRange ( -10, 100 ),
|
||||
GenRandomIntInRange ( -100, 100 ) );
|
||||
break;
|
||||
|
||||
case 11:
|
||||
case 10:
|
||||
// arbitrary "audio" packet (with random sizes)
|
||||
CVector<uint8_t> vecMessage ( GenRandomIntInRange ( 1, 1000 ) );
|
||||
OnSendProtMessage ( vecMessage );
|
||||
|
|
Loading…
Reference in a new issue