diff --git a/ChangeLog b/ChangeLog index b82b1e57..a20b3e33 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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) diff --git a/src/server.cpp b/src/server.cpp index c69c4d2d..74694d51 100755 --- a/src/server.cpp +++ b/src/server.cpp @@ -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 ) diff --git a/src/serverlogging.cpp b/src/serverlogging.cpp index cdbe4468..e9ba0b1b 100755 --- a/src/serverlogging.cpp +++ b/src/serverlogging.cpp @@ -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 diff --git a/src/serverlogging.h b/src/serverlogging.h index 71587d55..aeb46a1a 100755 --- a/src/serverlogging.h +++ b/src/serverlogging.h @@ -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();