From 3353d1a87fbfe2e6830a4b77470d9a5a1cdac593 Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Sat, 5 Dec 2009 00:12:04 -0700 Subject: Add a type member to ServerInfo and code for it Some of the code is waiting for ifdef removal. --- src/gui/serverdialog.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/gui') diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp index ec2b0cf4..39c2792f 100644 --- a/src/gui/serverdialog.cpp +++ b/src/gui/serverdialog.cpp @@ -355,8 +355,8 @@ void ServerDialog::loadServers() { // check wether the build matches (remove with last instances // if _SUPPORT ifdefs) - if (compareStrI(XML::getProperty(server, "type", "unknown"), - SERVER_BUILD)) + std::string type = XML::getProperty(server, "type", "unknown"); + if (compareStrI(type, SERVER_BUILD)) { continue; } @@ -368,6 +368,18 @@ void ServerDialog::loadServers() { if (xmlStrEqual(subnode->name, BAD_CAST "connection")) { + if (compareStrI(type, "manaserv")) + { + currentServer.type = ServerInfo::MANASERV; + } + else if (compareStrI(type, "eathena")) + { + currentServer.type = ServerInfo::EATHENA; + } + else + { + currentServer.type = ServerInfo::UNKNOWN; + } currentServer.hostname = XML::getProperty(subnode, "hostname", std::string()); currentServer.port = XML::getProperty(subnode, "port", DEFAULT_PORT); } -- cgit v1.2.3-70-g09d2