summaryrefslogtreecommitdiff
path: root/src/gui/serverdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/serverdialog.cpp')
-rw-r--r--src/gui/serverdialog.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp
index 25725a80..ad8ab3c8 100644
--- a/src/gui/serverdialog.cpp
+++ b/src/gui/serverdialog.cpp
@@ -26,6 +26,7 @@
#include "configuration.h"
#include "gui.h"
#include "log.h"
+#include "main.h"
#include "gui/okdialog.h"
#include "gui/sdlinput.h"
@@ -527,6 +528,15 @@ void ServerDialog::loadServers()
std::string type = XML::getProperty(serverNode, "type", "unknown");
server.type = ServerInfo::parseType(type);
+
+ // Ignore unknown server types
+ if (server.type == ServerInfo::UNKNOWN)
+ {
+ logger->log("Ignoring server entry with unknown type: %s",
+ type.c_str());
+ continue;
+ }
+
server.name = XML::getProperty(serverNode, "name", std::string());
std::string version = XML::getProperty(serverNode, "minimumVersion",
@@ -538,15 +548,11 @@ void ServerDialog::loadServers()
// For display in the list
if (meetsMinimumVersion)
version.clear();
+ else if (version.empty())
+ version = _("requires a newer version");
else
version = strprintf(_("requires v%s"), version.c_str());
- if (server.type == ServerInfo::UNKNOWN)
- {
- logger->log("Unknown server type: %s", type.c_str());
- continue;
- }
-
for_each_xml_child_node(subNode, serverNode)
{
if (xmlStrEqual(subNode->name, BAD_CAST "connection"))