From 076d39f6b83ca495d380d338f396bfb1fd589324 Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Wed, 17 Mar 2010 10:06:29 -0600 Subject: Allow branding to bypass server list Reviewed-by: Bernd Wachter --- src/client.cpp | 7 +++++-- src/configuration.cpp | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/client.cpp b/src/client.cpp index ad9a560b..3944215a 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -390,13 +390,15 @@ Client::Client(const Options &options): mCurrentServer.hostname = branding.getValue("defaultServer", "server.themanaworld.org").c_str(); } - if (options.serverPort == 0) + + if (mCurrentServer.port == 0) { mCurrentServer.port = (short) branding.getValue("defaultPort", DEFAULT_PORT); mCurrentServer.type = ServerInfo::parseType( branding.getValue("defaultServerType", "eathena")); } + if (loginData.username.empty() && loginData.remember) loginData.username = config.getValue("username", ""); @@ -599,7 +601,8 @@ int Client::exec() // Allow changing this using a server choice dialog // We show the dialog box only if the command-line // options weren't set. - if (mOptions.serverName.empty() && mOptions.serverPort == 0) + if (mOptions.serverName.empty() && mOptions.serverPort == 0 + && !branding.getValue("onlineServerList", "a").empty()) { // Don't allow an alpha opacity // lower than the default value diff --git a/src/configuration.cpp b/src/configuration.cpp index 60731bdb..1310d642 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -131,7 +131,7 @@ void ConfigurationObject::initFromXML(xmlNodePtr parent_node) std::string name = XML::getProperty(node, "name", std::string()); std::string value = XML::getProperty(node, "value", std::string()); - if (!name.empty() && !value.empty()) + if (!name.empty()) mOptions[name] = value; } // otherwise ignore } -- cgit v1.2.3-70-g09d2