From c99347bf9108367c02dcbdebadec0b978a750c57 Mon Sep 17 00:00:00 2001 From: Stefan Dombrowski Date: Sat, 4 Sep 2010 23:50:20 +0200 Subject: Fixing segmentation fault if server is given on command line If server and port was given on the command line, then the server type was unknown. The command line options do work now, but only if standard ports 6901 and 9601 are used. This resolves http://bugs.manasource.org/view.php?id=177 TODO: Query the server about itself and choose the server type based on that. Reviewed-by: Jaxad0127 --- src/client.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/client.cpp') diff --git a/src/client.cpp b/src/client.cpp index b63550e6..3946d0f9 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -604,11 +604,13 @@ int Client::exec() case STATE_CHOOSE_SERVER: logger->log("State: CHOOSE SERVER"); - // 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 - && !branding.getValue("onlineServerList", "a").empty()) + // If a server was passed on the command line, or branding + // provides a server and a blank server list, we skip the + // server selection dialog. + if (mOptions.serverName.empty() || mOptions.serverPort == 0 + || !(!branding.getValue("defaultServer","").empty() && + branding.getValue("defaultPort",0) && + branding.getValue("onlineServerList", "").empty())) { // Don't allow an alpha opacity // lower than the default value -- cgit v1.2.3-70-g09d2