log the number of connected clients on each new connection (#277)

This commit is contained in:
Volker Fischer 2020-07-18 08:56:52 +02:00
parent 7181546359
commit 4707501060
4 changed files with 9 additions and 4 deletions

View File

@ -26,6 +26,8 @@
- show maximum number of clients for servers in the serverlist, coded by dingodoppelt (#451)
- log the number of connected clients on each new connection (#277)
- move the Mute Myself button up to prevent accidentally disconnecting
- bug fix: grouping faders in the client should be proportional (see discussion in #202, #419)

View File

@ -660,7 +660,7 @@ void CServer::OnNewConnection ( int iChID,
DoubleFrameSizeConvBufOut[iChID].Reset();
// logging of new connected channel
Logging.AddNewConnection ( RecHostAddr.InetAddr );
Logging.AddNewConnection ( RecHostAddr.InetAddr, GetNumberOfConnectedClients() );
}
void CServer::OnServerFull ( CHostAddress RecHostAddr )

View File

@ -59,11 +59,12 @@ void CServerLogging::EnableHistory ( const QString& strHistoryFileName )
}
}
void CServerLogging::AddNewConnection ( const QHostAddress& ClientInetAddr )
void CServerLogging::AddNewConnection ( const QHostAddress& ClientInetAddr,
const int iNumberOfConnectedClients )
{
// logging of new connected channel
const QString strLogStr = CurTimeDatetoLogString() + ", " +
ClientInetAddr.toString() + ", connected";
ClientInetAddr.toString() + ", connected (" + QString::number ( iNumberOfConnectedClients ) + ")";
QTextStream& tsConsoleStream = *( ( new ConsoleWriterFactory() )->get() );
tsConsoleStream << strLogStr << endl; // on console

View File

@ -50,10 +50,12 @@ public:
void Start ( const QString& strLoggingFileName );
void EnableHistory ( const QString& strHistoryFileName );
void AddNewConnection ( const QHostAddress& ClientInetAddr );
void AddServerStopped();
void ParseLogFile ( const QString& strFileName );
void AddNewConnection ( const QHostAddress& ClientInetAddr,
const int iNumberOfConnectedClients );
protected:
void operator<< ( const QString& sNewStr );
QString CurTimeDatetoLogString();