@@ -470,6 +470,8 @@ void CServer::OnNewConnection ( int iChID, int iTotChans, CHostAddress RecHostAd
470470
471471 // logging of new connected channel
472472 Logging.AddNewConnection ( RecHostAddr.InetAddr , iTotChans );
473+
474+ emit ClientConnected ( iChID, RecHostAddr.InetAddr , iTotChans );
473475}
474476
475477void CServer::OnServerFull ( CHostAddress RecHostAddr )
@@ -876,6 +878,8 @@ void CServer::DecodeReceiveData ( const int iChanCnt, const int iNumClients )
876878 {
877879 emit ClientDisconnected ( iCurChanID ); // TODO do this outside the mutex lock?
878880 }
881+ // notify RPC server of disconnection
882+ emit ClientDisconnectedRPC ( iCurChanID );
879883
880884 FreeChannel ( iCurChanID ); // note that the channel is now not in use
881885
@@ -1306,6 +1310,22 @@ void CServer::CreateAndSendChatTextForAllConChannels ( const int iCurChanID, con
13061310 vecChannels[i].CreateChatTextMes ( strActualMessageText );
13071311 }
13081312 }
1313+ emit receivedChatMessage ( strActualMessageText );
1314+ }
1315+
1316+ // external chat
1317+ void CServer::CreateAndSendChatTextForAllConChannels ( const QString& strChatText )
1318+ {
1319+ // Send chat text to all connected clients ---------------------------------
1320+ for ( int i = 0 ; i < iMaxNumChannels; i++ )
1321+ {
1322+ if ( vecChannels[i].IsConnected () )
1323+ {
1324+ // send message
1325+ vecChannels[i].CreateChatTextMes ( strChatText );
1326+ }
1327+ }
1328+ emit receivedChatMessage ( strChatText );
13091329}
13101330
13111331void CServer::CreateAndSendRecorderStateForAllConChannels ()
@@ -1571,6 +1591,68 @@ void CServer::SetWelcomeMessage ( const QString& strNWelcMess )
15711591 strWelcomeMessage = strWelcomeMessage.left ( MAX_LEN_CHAT_TEXT );
15721592}
15731593
1594+ void CServer::GetCompleteClientInfos ( CVector<CHostAddress>& vecHostAddresses,
1595+ CVector<QString>& vecsName,
1596+ CVector<QString>& vecsCity,
1597+ CVector<QString>& vecsCountry,
1598+ CVector<QString>& vecsInstr,
1599+ CVector<QString>& vecsInstrPic,
1600+ CVector<QString>& vecsSkill,
1601+ CVector<int >& veciJitBufNumFrames,
1602+ CVector<int >& veciNetwFrameSizeFact )
1603+ {
1604+ // init return values
1605+ vecHostAddresses.Init ( iMaxNumChannels );
1606+ vecsName.Init ( iMaxNumChannels );
1607+ vecsCity.Init ( iMaxNumChannels );
1608+ vecsCountry.Init ( iMaxNumChannels );
1609+ vecsInstr.Init ( iMaxNumChannels );
1610+ vecsInstrPic.Init ( iMaxNumChannels );
1611+ vecsSkill.Init ( iMaxNumChannels );
1612+ veciJitBufNumFrames.Init ( iMaxNumChannels );
1613+ veciNetwFrameSizeFact.Init ( iMaxNumChannels );
1614+
1615+ // check all possible channels
1616+ for ( int i = 0 ; i < iMaxNumChannels; i++ )
1617+ {
1618+ if ( vecChannels[i].IsConnected () )
1619+ {
1620+ // get requested data
1621+ vecHostAddresses[i] = vecChannels[i].GetAddress ();
1622+ vecsName[i] = vecChannels[i].GetName ();
1623+ vecsCity[i] = vecChannels[i].GetChanInfo ().strCity ;
1624+ vecsCountry[i] = QLocale::countryToString ( vecChannels[i].GetChanInfo ().eCountry );
1625+ vecsInstr[i] = CInstPictures::GetName ( vecChannels[i].GetChanInfo ().iInstrument );
1626+ vecsInstrPic[i] = CInstPictures::GetResourceReference ( vecChannels[i].GetChanInfo ().iInstrument );
1627+ vecsSkill[i] = " " ;
1628+ veciJitBufNumFrames[i] = vecChannels[i].GetSockBufNumFrames ();
1629+ veciNetwFrameSizeFact[i] = vecChannels[i].GetNetwFrameSizeFact ();
1630+ switch ( vecChannels[i].GetChanInfo ().eSkillLevel )
1631+ {
1632+ case SL_BEGINNER :
1633+ vecsSkill[i] = " \" Beginner\" " ;
1634+ break ;
1635+
1636+ case SL_INTERMEDIATE :
1637+ vecsSkill[i] = " \" Intermediate\" " ;
1638+ break ;
1639+
1640+ case SL_PROFESSIONAL :
1641+ vecsSkill[i] = " \" Expert\" " ;
1642+ break ;
1643+
1644+ case SL_NOT_SET :
1645+ vecsSkill[i] = " " ;
1646+ break ;
1647+
1648+ default :
1649+ vecsSkill[i] = " " ;
1650+ break ;
1651+ }
1652+ }
1653+ }
1654+ }
1655+
15741656void CServer::customEvent ( QEvent* pEvent )
15751657{
15761658 if ( pEvent->type () == QEvent::User + 11 )
0 commit comments