Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ int main ( int argc, char** argv )
ELicenceType eLicenceType = LT_NO_LICENCE;
QString strConnOnStartupAddress = "";
QString strIniFileName = "";
QString strHTMLStatusFileName = "";
QString strLoggingFileName = "";
QString strRecordingDirName = "";
QString strDirectoryAddress = "";
Expand Down Expand Up @@ -343,19 +342,6 @@ int main ( int argc, char** argv )
continue;
}

// HTML status file ----------------------------------------------------
if ( GetStringArgument ( argc, argv, i, "-m", "--htmlstatus", strArgument ) )
{
qWarning() << qUtf8Printable (
QString ( "- The HTML status file option (\"--htmlstatus\" or \"-m\") is deprecated and will be removed soon. Please use JSON-RPC "
"instead. See https://github.com/jamulussoftware/jamulus/blob/main/docs/JSON-RPC.md" ) );
strHTMLStatusFileName = strArgument;
qInfo() << qUtf8Printable ( QString ( "- HTML status file name: %1" ).arg ( strHTMLStatusFileName ) );
CommandLineOptions << "--htmlstatus";
ServerOnlyOptions << "--htmlstatus";
continue;
}

// Server info ---------------------------------------------------------
if ( GetStringArgument ( argc, argv, i, "-o", "--serverinfo", strArgument ) )
{
Expand Down Expand Up @@ -993,7 +979,6 @@ int main ( int argc, char** argv )
strServerBindIP,
iPortNumber,
iQosNumber,
strHTMLStatusFileName,
strDirectoryAddress,
strServerListFileName,
strServerInfo,
Expand Down Expand Up @@ -1121,7 +1106,6 @@ QString UsageArguments ( char** argv )
" -F, --fastupdate use 64 samples frame size mode\n"
" -l, --log enable logging, set file name\n"
" -L, --licence show an agreement window before users can connect\n"
" -m, --htmlstatus deprecated, please use JSON-RPC instead\n"
" -o, --serverinfo registration info for this Server. Format:\n"
" [name];[city];[country as two-letter ISO country code or Qt5 QLocale ID]\n"
" --serverpublicip public IP address for this Server. Needed when\n"
Expand Down
70 changes: 0 additions & 70 deletions src/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ CServer::CServer ( const int iNewMaxNumChan,
const QString& strServerBindIP,
const quint16 iPortNumber,
const quint16 iQosNumber,
const QString& strHTMLStatusFileName,
const QString& strDirectoryAddress,
const QString& strServerListFileName,
const QString& strServerInfo,
Expand All @@ -54,8 +53,6 @@ CServer::CServer ( const int iNewMaxNumChan,
Socket ( this, iPortNumber, iQosNumber, strServerBindIP, bNEnableIPv6 ),
Logging(),
iFrameCount ( 0 ),
bWriteStatusHTMLFile ( false ),
strServerHTMLFileListName ( strHTMLStatusFileName ),
HighPrecisionTimer ( bNUseDoubleSystemFrameSize ),
ServerListManager ( iPortNumber,
strDirectoryAddress,
Expand Down Expand Up @@ -193,14 +190,6 @@ CServer::CServer ( const int iNewMaxNumChan,
Logging.Start ( strLoggingFileName );
}

// HTML status file writing
if ( !strServerHTMLFileListName.isEmpty() )
{
// activate HTML file writing and write initial file
bWriteStatusHTMLFile = true;
WriteHTMLChannelList();
}

// manage welcome message: if the welcome message is a valid link to a local
// file, the content of that file is used as the welcome message (#361)
SetWelcomeMessage ( strNewWelcomeMessage ); // first use given text, may be overwritten
Expand Down Expand Up @@ -504,11 +493,6 @@ void CServer::OnAboutToQuit()
}

Stop();

if ( bWriteStatusHTMLFile )
{
WriteHTMLServerQuit();
}
}

void CServer::OnHandledSignal ( int sigNum )
Expand Down Expand Up @@ -1267,12 +1251,6 @@ void CServer::CreateAndSendChanListForAllConChannels()
vecChannels[i].CreateConClientListMes ( vecChanInfo );
}
}

// create status HTML file if enabled
if ( bWriteStatusHTMLFile )
{
WriteHTMLChannelList();
}
}

void CServer::CreateAndSendChanListForThisChan ( const int iCurChanID )
Expand Down Expand Up @@ -1571,54 +1549,6 @@ void CServer::SetWelcomeMessage ( const QString& strNWelcMess )
strWelcomeMessage = strWelcomeMessage.left ( MAX_LEN_CHAT_TEXT );
}

void CServer::WriteHTMLChannelList()
{
// prepare file and stream
QFile serverFileListFile ( strServerHTMLFileListName );

if ( serverFileListFile.open ( QIODevice::WriteOnly | QIODevice::Text ) )
{
QTextStream streamFileOut ( &serverFileListFile );

// depending on number of connected clients write list
if ( GetNumberOfConnectedClients() == 0 )
{
// no clients are connected -> empty server
streamFileOut << " No client connected\n";
}
else
{
streamFileOut << "<ul>\n";

// write entry for each connected client
for ( int i = 0; i < iMaxNumChannels; i++ )
{
if ( vecChannels[i].IsConnected() )
{
streamFileOut << " <li>" << vecChannels[i].GetName().toHtmlEscaped() << "</li>\n";
}
}

streamFileOut << "</ul>\n";
}
}
}

void CServer::WriteHTMLServerQuit()
{
// prepare file and stream
QFile serverFileListFile ( strServerHTMLFileListName );

if ( !serverFileListFile.open ( QIODevice::WriteOnly | QIODevice::Text ) )
{
return;
}

QTextStream streamFileOut ( &serverFileListFile );
streamFileOut << " Server terminated\n";
serverFileListFile.close();
}

void CServer::customEvent ( QEvent* pEvent )
{
if ( pEvent->type() == QEvent::User + 11 )
Expand Down
8 changes: 0 additions & 8 deletions src/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ class CServer : public QObject, public CServerSlots<MAX_NUM_CHANNELS>
const QString& strServerBindIP,
const quint16 iPortNumber,
const quint16 iQosNumber,
const QString& strHTMLStatusFileName,
const QString& strDirectoryAddress,
const QString& strServerListFileName,
const QString& strServerInfo,
Expand Down Expand Up @@ -194,9 +193,6 @@ class CServer : public QObject, public CServerSlots<MAX_NUM_CHANNELS>
template<unsigned int slotId>
inline void connectChannelSignalsToServerSlots();

void WriteHTMLChannelList();
void WriteHTMLServerQuit();

static void DecodeReceiveDataBlocks ( CServer* pServer, const int iStartChanCnt, const int iStopChanCnt, const int iNumClients );

static void MixEncodeTransmitDataBlocks ( CServer* pServer, const int iStartChanCnt, const int iStopChanCnt, const int iNumClients );
Expand Down Expand Up @@ -281,10 +277,6 @@ class CServer : public QObject, public CServerSlots<MAX_NUM_CHANNELS>
// channel level update frame interval counter
int iFrameCount;

// HTML file server status
bool bWriteStatusHTMLFile;
QString strServerHTMLFileListName;

CHighPrecisionTimer HighPrecisionTimer;

// server list
Expand Down
Loading