Skip to content
Merged
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
30 changes: 14 additions & 16 deletions src/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -829,32 +829,21 @@ directoryAddress = GetIniSetting ( IniXMLDocument, "server", "centralservaddr",

// directory type
// CServerListManager defaults to AT_NONE
// Server GUI defaults to AT_DEFAULT
// Because type could be AT_CUSTOM, it has to be set after the address to avoid multiple registrations
EDirectoryType directoryType = AT_DEFAULT;
EDirectoryType directoryType = AT_NONE;

// if command line is set, use it
// if a command line Directory server address is set, set the Directory Type (genre) to AT_CUSTOM so it's used
if ( CommandLineOptions.contains ( "--centralserver" ) || CommandLineOptions.contains ( "--directoryserver" ) )
{
directoryType = AT_CUSTOM;
}
else
{
// clang-format off
Comment thread
softins marked this conversation as resolved.
// TODO compatibility to old version < 3.8.2
// if "servlistenabled" exists and is false, set directory type to AT_NONE
if ( GetFlagIniSet ( IniXMLDocument, "server", "servlistenabled", bValue ) && !bValue )
{
directoryType = AT_NONE;
}
// clang-format on

// clang-format off
// TODO compatibility to old version < ?????
// only the case that manual was set in old ini must be considered
if ( GetFlagIniSet ( IniXMLDocument, "server", "defcentservaddr", bValue ) && !bValue )
// TODO compatibility to old version < 3.4.7
if ( GetFlagIniSet ( IniXMLDocument, "server", "defcentservaddr", bValue ) )
{
directoryType = AT_CUSTOM;
directoryType = bValue ? AT_DEFAULT : AT_CUSTOM;
}
else
// clang-format on
Expand All @@ -877,6 +866,15 @@ else
{
directoryType = static_cast<EDirectoryType> ( iValue );
}

// clang-format off
// TODO compatibility to old version < 3.9.0
// override type to AT_NONE if servlistenabled exists and is false
if ( GetFlagIniSet ( IniXMLDocument, "server", "servlistenabled", bValue ) && !bValue )
{
directoryType = AT_NONE;
}
// clang-format on
}

pServer->SetDirectoryType ( directoryType );
Expand Down