diff --git a/src/channel.cpp b/src/channel.cpp index 3e7cc22e..c9b002d0 100755 --- a/src/channel.cpp +++ b/src/channel.cpp @@ -92,11 +92,6 @@ CChannel::CChannel ( const bool bNIsServer ) : SIGNAL ( ChatTextReceived ( QString ) ), SIGNAL ( ChatTextReceived ( QString ) ) ); -// #### COMPATIBILITY OLD VERSION, TO BE REMOVED #### -QObject::connect( &Protocol, - SIGNAL ( PingReceived ( int ) ), - SIGNAL ( PingReceived ( int ) ) ); - // #### COMPATIBILITY OLD VERSION, TO BE REMOVED #### QObject::connect ( &Protocol, SIGNAL ( OpusSupported() ), diff --git a/src/channel.h b/src/channel.h index a2f9bf10..2a4d81a6 100755 --- a/src/channel.h +++ b/src/channel.h @@ -141,7 +141,6 @@ Protocol.CreateChanNameMes ( ChInfo.strName ); void CreateReqJitBufMes() { Protocol.CreateReqJitBufMes(); } void CreateReqConnClientsList() { Protocol.CreateReqConnClientsList(); } void CreateChatTextMes ( const QString& strChatText ) { Protocol.CreateChatTextMes ( strChatText ); } - void CreatePingMes ( const int iMs ) { Protocol.CreatePingMes ( iMs ); } // #### COMPATIBILITY OLD VERSION, TO BE REMOVED #### void CreateConClientListNameMes ( const CVector& vecChanInfo ) @@ -228,7 +227,6 @@ signals: void ReqChanInfo(); void OpusSupported(); void ChatTextReceived ( QString strChatText ); - void PingReceived ( int iMs ); void ReqNetTranspProps(); void Disconnected(); diff --git a/src/protocol.cpp b/src/protocol.cpp index 5d164fdb..b5d7131f 100755 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -534,11 +534,6 @@ case PROTMESSID_CHANNEL_NAME: bRet = EvaluateChatTextMes ( vecbyMesBodyData ); break; -// #### COMPATIBILITY OLD VERSION, TO BE REMOVED #### -case PROTMESSID_PING_MS: - bRet = EvaluatePingMes ( vecbyMesBodyData ); - break; - case PROTMESSID_NETW_TRANSPORT_PROPS: bRet = EvaluateNetwTranspPropsMes ( vecbyMesBodyData ); break; @@ -1187,38 +1182,6 @@ bool CProtocol::EvaluateChatTextMes ( const CVector& vecData ) return false; // no error } - -// #### COMPATIBILITY OLD VERSION, TO BE REMOVED #### -void CProtocol::CreatePingMes ( const int iMs ) -{ - int iPos = 0; // init position pointer - - // build data vector (4 bytes long) - CVector vecData ( 4 ); - - // transmit time (4 bytes) - PutValOnStream ( vecData, iPos, static_cast ( iMs ), 4 ); - - CreateAndSendMessage ( PROTMESSID_PING_MS, vecData ); -} - -bool CProtocol::EvaluatePingMes ( const CVector& vecData ) -{ - int iPos = 0; // init position pointer - - // check size - if ( vecData.Size() != 4 ) - { - return true; // return error code - } - - // invoke message action - emit PingReceived ( static_cast ( GetValFromStream ( vecData, iPos, 4 ) ) ); - - return false; // no error -} - - void CProtocol::CreateNetwTranspPropsMes ( const CNetworkTransportProps& NetTrProps ) { int iPos = 0; // init position pointer diff --git a/src/protocol.h b/src/protocol.h index e3454539..2de02493 100755 --- a/src/protocol.h +++ b/src/protocol.h @@ -97,7 +97,6 @@ public: void CreateChanInfoMes ( const CChannelCoreInfo ChanInfo ); void CreateReqChanInfoMes(); void CreateChatTextMes ( const QString strChatText ); - void CreatePingMes ( const int iMs ); void CreateNetwTranspPropsMes ( const CNetworkTransportProps& NetTrProps ); void CreateReqNetwTranspPropsMes(); void CreateOpusSupportedMes(); @@ -213,7 +212,6 @@ protected: bool EvaluateChanInfoMes ( const CVector& vecData ); bool EvaluateReqChanInfoMes(); bool EvaluateChatTextMes ( const CVector& vecData ); - bool EvaluatePingMes ( const CVector& vecData ); bool EvaluateNetwTranspPropsMes ( const CVector& vecData ); bool EvaluateReqNetwTranspPropsMes(); bool EvaluateOpusSupportedMes(); @@ -265,7 +263,6 @@ signals: void ReqChanInfo(); void OpusSupported(); void ChatTextReceived ( QString strChatText ); - void PingReceived ( int iMs ); void NetTranspPropsReceived ( CNetworkTransportProps NetworkTransportProps ); void ReqNetTranspProps(); diff --git a/src/server.cpp b/src/server.cpp index 327963bf..319cd34a 100755 --- a/src/server.cpp +++ b/src/server.cpp @@ -489,22 +489,6 @@ CServer::CServer ( const int iNewNumChan, QObject::connect ( &vecChannels[9], SIGNAL ( ServerAutoSockBufSizeChange ( int ) ), this, SLOT ( OnServerAutoSockBufSizeChangeCh9 ( int ) ) ); QObject::connect ( &vecChannels[10], SIGNAL ( ServerAutoSockBufSizeChange ( int ) ), this, SLOT ( OnServerAutoSockBufSizeChangeCh10 ( int ) ) ); QObject::connect ( &vecChannels[11], SIGNAL ( ServerAutoSockBufSizeChange ( int ) ), this, SLOT ( OnServerAutoSockBufSizeChangeCh11 ( int ) ) ); - - -// #### COMPATIBILITY OLD VERSION, TO BE REMOVED #### -QObject::connect ( &vecChannels[0], SIGNAL ( PingReceived ( int ) ), this, SLOT ( OnPingReceivedCh0 ( int ) ) ); -QObject::connect ( &vecChannels[1], SIGNAL ( PingReceived ( int ) ), this, SLOT ( OnPingReceivedCh1 ( int ) ) ); -QObject::connect ( &vecChannels[2], SIGNAL ( PingReceived ( int ) ), this, SLOT ( OnPingReceivedCh2 ( int ) ) ); -QObject::connect ( &vecChannels[3], SIGNAL ( PingReceived ( int ) ), this, SLOT ( OnPingReceivedCh3 ( int ) ) ); -QObject::connect ( &vecChannels[4], SIGNAL ( PingReceived ( int ) ), this, SLOT ( OnPingReceivedCh4 ( int ) ) ); -QObject::connect ( &vecChannels[5], SIGNAL ( PingReceived ( int ) ), this, SLOT ( OnPingReceivedCh5 ( int ) ) ); -QObject::connect ( &vecChannels[6], SIGNAL ( PingReceived ( int ) ), this, SLOT ( OnPingReceivedCh6 ( int ) ) ); -QObject::connect ( &vecChannels[7], SIGNAL ( PingReceived ( int ) ), this, SLOT ( OnPingReceivedCh7 ( int ) ) ); -QObject::connect ( &vecChannels[8], SIGNAL ( PingReceived ( int ) ), this, SLOT ( OnPingReceivedCh8 ( int ) ) ); -QObject::connect ( &vecChannels[9], SIGNAL ( PingReceived ( int ) ), this, SLOT ( OnPingReceivedCh9 ( int ) ) ); -QObject::connect ( &vecChannels[10], SIGNAL ( PingReceived ( int ) ), this, SLOT ( OnPingReceivedCh10 ( int ) ) ); -QObject::connect ( &vecChannels[11], SIGNAL ( PingReceived ( int ) ), this, SLOT ( OnPingReceivedCh11 ( int ) ) ); - } void CServer::OnSendProtMessage ( int iChID, CVector vecMessage ) diff --git a/src/server.h b/src/server.h index d60ebaa1..58cf366e 100755 --- a/src/server.h +++ b/src/server.h @@ -402,22 +402,6 @@ public slots: void OnServerAutoSockBufSizeChangeCh9 ( int iNNumFra ) { vecChannels[9].CreateJitBufMes ( iNNumFra ); } void OnServerAutoSockBufSizeChangeCh10 ( int iNNumFra ) { vecChannels[10].CreateJitBufMes ( iNNumFra ); } void OnServerAutoSockBufSizeChangeCh11 ( int iNNumFra ) { vecChannels[11].CreateJitBufMes ( iNNumFra ); } - - -// #### COMPATIBILITY OLD VERSION, TO BE REMOVED #### -void OnPingReceivedCh0 ( int iMs ) { vecChannels[0].CreatePingMes ( iMs ); } -void OnPingReceivedCh1 ( int iMs ) { vecChannels[1].CreatePingMes ( iMs ); } -void OnPingReceivedCh2 ( int iMs ) { vecChannels[2].CreatePingMes ( iMs ); } -void OnPingReceivedCh3 ( int iMs ) { vecChannels[3].CreatePingMes ( iMs ); } -void OnPingReceivedCh4 ( int iMs ) { vecChannels[4].CreatePingMes ( iMs ); } -void OnPingReceivedCh5 ( int iMs ) { vecChannels[5].CreatePingMes ( iMs ); } -void OnPingReceivedCh6 ( int iMs ) { vecChannels[6].CreatePingMes ( iMs ); } -void OnPingReceivedCh7 ( int iMs ) { vecChannels[7].CreatePingMes ( iMs ); } -void OnPingReceivedCh8 ( int iMs ) { vecChannels[8].CreatePingMes ( iMs ); } -void OnPingReceivedCh9 ( int iMs ) { vecChannels[9].CreatePingMes ( iMs ); } -void OnPingReceivedCh10 ( int iMs ) { vecChannels[10].CreatePingMes ( iMs ); } -void OnPingReceivedCh11 ( int iMs ) { vecChannels[11].CreatePingMes ( iMs ); } - }; #endif /* !defined ( SERVER_HOIHGE7LOKIH83JH8_3_43445KJIUHF1912__INCLUDED_ ) */ diff --git a/src/testbench.h b/src/testbench.h index e6b14c6a..6b17ec52 100755 --- a/src/testbench.h +++ b/src/testbench.h @@ -105,7 +105,7 @@ public slots: CChannelCoreInfo ChannelCoreInfo; // generate random protocol message - switch ( GenRandomIntInRange ( 0, 25 ) ) + switch ( GenRandomIntInRange ( 0, 24 ) ) { case 0: Protocol.CreateJitBufMes ( GenRandomIntInRange ( 0, 10 ) ); @@ -167,10 +167,6 @@ public slots: break; case 10: - Protocol.CreatePingMes ( GenRandomIntInRange ( 0, 100000 ) ); - break; - - case 11: NetTrProps.eAudioCodingType = static_cast ( GenRandomIntInRange ( 0, 2 ) ); @@ -184,30 +180,30 @@ public slots: Protocol.CreateNetwTranspPropsMes ( NetTrProps ); break; - case 12: + case 11: Protocol.CreateReqNetwTranspPropsMes(); break; - case 13: + case 12: Protocol.CreateOpusSupportedMes(); break; - case 14: + case 13: Protocol.CreateCLPingMes ( CurHostAddress, GenRandomIntInRange ( -2, 1000 ) ); break; - case 15: + case 14: Protocol.CreateCLPingWithNumClientsMes ( CurHostAddress, GenRandomIntInRange ( -2, 1000 ), GenRandomIntInRange ( -2, 1000 ) ); break; - case 16: + case 15: Protocol.CreateCLServerFullMes ( CurHostAddress ); break; - case 17: + case 16: ServerInfo.bPermanentOnline = static_cast ( GenRandomIntInRange ( 0, 1 ) ); @@ -224,11 +220,11 @@ public slots: ServerInfo ); break; - case 18: + case 17: Protocol.CreateCLUnregisterServerMes ( CurHostAddress ); break; - case 19: + case 18: vecServerInfo[0].bPermanentOnline = static_cast ( GenRandomIntInRange ( 0, 1 ) ); @@ -246,29 +242,29 @@ public slots: vecServerInfo ); break; - case 20: + case 19: Protocol.CreateCLReqServerListMes ( CurHostAddress ); break; - case 21: + case 20: Protocol.CreateCLSendEmptyMesMes ( CurHostAddress, CurHostAddress ); break; - case 22: + case 21: Protocol.CreateCLEmptyMes ( CurHostAddress ); break; - case 23: + case 22: Protocol.CreateCLDisconnection ( CurHostAddress ); break; - case 24: + case 23: Protocol.CreateAndImmSendAcknMess ( GenRandomIntInRange ( -10, 100 ), GenRandomIntInRange ( -100, 100 ) ); break; - case 25: + case 24: // arbitrary "audio" packet (with random sizes) CVector vecMessage ( GenRandomIntInRange ( 1, 1000 ) ); OnSendProtMessage ( vecMessage );