diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-05-15 12:35:24 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-05-15 12:35:24 +0300 |
commit | 324a3df386950a6f262f2382caa33177f085c03f (patch) | |
tree | 3818d593a87f69f29e9ec7bcdff67cce3a29443a /src/gui/windows | |
parent | f3ece7309f38275dc0615422294831fd79830798 (diff) | |
download | manaverse-324a3df386950a6f262f2382caa33177f085c03f.tar.gz manaverse-324a3df386950a6f262f2382caa33177f085c03f.tar.bz2 manaverse-324a3df386950a6f262f2382caa33177f085c03f.tar.xz manaverse-324a3df386950a6f262f2382caa33177f085c03f.zip |
Add support for mirrors in generic manaplus downloads.
Diffstat (limited to 'src/gui/windows')
-rw-r--r-- | src/gui/windows/updaterwindow.cpp | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp index 1f7b8f18d..40b8014e2 100644 --- a/src/gui/windows/updaterwindow.cpp +++ b/src/gui/windows/updaterwindow.cpp @@ -60,6 +60,10 @@ const std::string xmlUpdateFile("resources.xml"); const std::string txtUpdateFile("resources2.txt"); const std::string updateServer2 ("http://download.evolonline.org/manaplus/updates/"); +const std::string updateServer3 + ("http://download.manaplus.org/manaplus/updates/"); +const std::string updateServer4 + ("http://download2.manaplus.org/manaplus/updates/"); /** * Load the given file into a vector of updateFiles. @@ -537,7 +541,10 @@ void UpdaterWindow::download() "http://manaplus.org/update/" + mCurrentFile, &updateProgress, true, false, mValidateXml); - mDownload->addMirror("http://www.manaplus.org/update/" + mCurrentFile); + mDownload->addMirror("http://www.manaplus.org/update/" + + mCurrentFile); + mDownload->addMirror("http://www2.manaplus.org/update/" + + mCurrentFile); } else { @@ -546,11 +553,22 @@ void UpdaterWindow::download() &updateProgress, false, false, mValidateXml); - const std::vector<std::string> &mirrors = client->getMirrors(); - FOR_EACH (std::vector<std::string>::const_iterator, it, mirrors) + if (mDownloadStatus == UPDATE_LIST2 + || mDownloadStatus == UPDATE_RESOURCES2) { - mDownload->addMirror(std::string(*it).append( - "/").append(mCurrentFile)); + mDownload->addMirror(updateServer3 + mUpdateServerPath + + "/" + mCurrentFile); + mDownload->addMirror(updateServer4 + mUpdateServerPath + + "/" + mCurrentFile); + } + else + { + const std::vector<std::string> &mirrors = client->getMirrors(); + FOR_EACH (std::vector<std::string>::const_iterator, it, mirrors) + { + mDownload->addMirror(std::string(*it).append( + "/").append(mCurrentFile)); + } } } |