~ubuntu-branches/ubuntu/saucy/manaplus/saucy-proposed

« back to all changes in this revision

Viewing changes to src/net/ea/network.cpp

  • Committer: Package Import Robot
  • Author(s): Patrick Matthäi, Andrei Karas, Patrick Matthäi
  • Date: 2013-06-10 10:53:26 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20130610105326-c3xqk5ebcgy3jxmb
Tags: 1.3.6.9-1
[ Andrei Karas ]
* Add new files to copyright file.

[ Patrick Matthäi ]
* New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
105
105
        server.hostname.c_str(), server.port);
106
106
 
107
107
    mServer.hostname = server.hostname;
 
108
    mServer.althostname = server.althostname;
108
109
    mServer.port = server.port;
109
110
 
110
111
    // Reset to sane values
190
191
    if (TcpNet::resolveHost(&ipAddress, mServer.hostname.c_str(),
191
192
        mServer.port) == -1)
192
193
    {
193
 
        const std::string errorMessage = std::string(
194
 
            // TRANSLATORS: error message
195
 
            _("Unable to resolve host \"")).append(
196
 
            mServer.hostname).append("\"");
197
 
        setError(errorMessage);
198
 
        logger->log("TcpNet::ResolveHost: %s", errorMessage.c_str());
199
 
        return false;
 
194
        if (mServer.althostname.empty() || TcpNet::resolveHost(&ipAddress,
 
195
            mServer.althostname.c_str(), mServer.port) == -1)
 
196
        {
 
197
            const std::string errorMessage = std::string(
 
198
                // TRANSLATORS: error message
 
199
                _("Unable to resolve host \"")).append(
 
200
                mServer.hostname).append("\"");
 
201
            setError(errorMessage);
 
202
            logger->log("TcpNet::ResolveHost: %s", errorMessage.c_str());
 
203
            return false;
 
204
        }
 
205
        logger->log("using alt host name: %s", mServer.althostname.c_str());
200
206
    }
201
207
 
202
208
    mState = CONNECTING;