Skip to content

Commit

Permalink
Validate in main.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
pljones committed Jul 27, 2023
1 parent 650483b commit 338959b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 7 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,13 @@ int main ( int argc, char** argv )
exit ( 1 );
}

if ( ServerOnlyOptions.contains ( "--serverinfo" ) && strServerInfo.split ( ";" ).count() < 3 )
{
qWarning() << qUtf8Printable (
QString ( "\"--serverinfo '%1'\": must contain [name];[city];[country] - value will be ignored" ).arg ( strServerInfo ) );
strServerInfo = "";
}

#ifndef HEADLESS
if ( bUseGUI )
{
Expand Down
7 changes: 0 additions & 7 deletions src/serverlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,6 @@ CServerListManager::CServerListManager ( const quint16 iNPortNum,
.arg ( slServInfoSeparateParams[2] )
.arg ( QLocale::countryToString ( ThisServerListEntry.eCountry ) ) );
}
else
{
if ( !strServerInfo.isEmpty() )
{
qWarning() << "Ignoring invalid serverinfo, please verify the parameter syntax.";
}
}

// per definition, the very first entry is this server and this entry will
// never be deleted
Expand Down

0 comments on commit 338959b

Please sign in to comment.