for server name/city/country and licence, the command line overwrites the ini-file setting

This commit is contained in:
Volker Fischer 2020-07-10 20:33:05 +02:00
parent 10abcff239
commit 51d3c95de0

View file

@ -799,6 +799,11 @@ if ( GetFlagIniSet ( IniXMLDocument, "server", "defcentservaddr", bValue ) )
strLanguage = GetIniSetting ( IniXMLDocument, "server", "language",
CLocale::FindSysLangTransFileName ( CLocale::GetAvailableTranslations() ).first );
// name/city/country (command line overwrites setting file, note that
// name/city/country are set by one single command line argument so we
// can treat them combined here and it is sufficient to just check the name)
if ( pServer->GetServerName().isEmpty() )
{
// name
pServer->SetServerName ( GetIniSetting ( IniXMLDocument, "server", "name" ) );
@ -811,6 +816,7 @@ if ( GetFlagIniSet ( IniXMLDocument, "server", "defcentservaddr", bValue ) )
{
pServer->SetServerCountry ( static_cast<QLocale::Country> ( iValue ) );
}
}
// start minimized on OS start
if ( GetFlagIniSet ( IniXMLDocument, "server", "autostartmin", bValue ) )
@ -818,12 +824,15 @@ if ( GetFlagIniSet ( IniXMLDocument, "server", "defcentservaddr", bValue ) )
pServer->SetAutoRunMinimized ( bValue );
}
// licence type
// licence type (command line overwrites setting file)
if ( pServer->GetLicenceType() == LT_NO_LICENCE )
{
if ( GetNumericIniSet ( IniXMLDocument, "server", "licencetype",
0, 1 /* LT_CREATIVECOMMONS */, iValue ) )
{
pServer->SetLicenceType ( static_cast<ELicenceType> ( iValue ) );
}
}
// welcome message (command line overwrites setting file)
if ( pServer->GetWelcomeMessage().isEmpty() )