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) - 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 - 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) - 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(); DoubleFrameSizeConvBufOut[iChID].Reset();
// logging of new connected channel // logging of new connected channel
Logging.AddNewConnection ( RecHostAddr.InetAddr ); Logging.AddNewConnection ( RecHostAddr.InetAddr, GetNumberOfConnectedClients() );
} }
void CServer::OnServerFull ( CHostAddress RecHostAddr ) 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 // logging of new connected channel
const QString strLogStr = CurTimeDatetoLogString() + ", " + const QString strLogStr = CurTimeDatetoLogString() + ", " +
ClientInetAddr.toString() + ", connected"; ClientInetAddr.toString() + ", connected (" + QString::number ( iNumberOfConnectedClients ) + ")";
QTextStream& tsConsoleStream = *( ( new ConsoleWriterFactory() )->get() ); QTextStream& tsConsoleStream = *( ( new ConsoleWriterFactory() )->get() );
tsConsoleStream << strLogStr << endl; // on console tsConsoleStream << strLogStr << endl; // on console

View file

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