summaryrefslogtreecommitdiffstats
path: root/logic/OneSixUpdate.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-11-17 11:44:18 +0100
committerPetr Mrázek <peterix@gmail.com>2013-11-17 11:44:18 +0100
commit210629e274a08c592d8f38f7b382c1c5a05a7ab1 (patch)
treea32ac2426cf6c45c061c05b347f95f2a68439d5a /logic/OneSixUpdate.cpp
parent2a45302dfc8d63c627fd1164ef84f434f40bd917 (diff)
downloadMultiMC-210629e274a08c592d8f38f7b382c1c5a05a7ab1.tar
MultiMC-210629e274a08c592d8f38f7b382c1c5a05a7ab1.tar.gz
MultiMC-210629e274a08c592d8f38f7b382c1c5a05a7ab1.tar.lz
MultiMC-210629e274a08c592d8f38f7b382c1c5a05a7ab1.tar.xz
MultiMC-210629e274a08c592d8f38f7b382c1c5a05a7ab1.zip
Use the forge mirrors for downloading forge libraries
Let's hope we never, ever see a forge download error again.
Diffstat (limited to 'logic/OneSixUpdate.cpp')
-rw-r--r--logic/OneSixUpdate.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/logic/OneSixUpdate.cpp b/logic/OneSixUpdate.cpp
index 2d8a167c..62d95ee6 100644
--- a/logic/OneSixUpdate.cpp
+++ b/logic/OneSixUpdate.cpp
@@ -28,6 +28,7 @@
#include "OneSixVersion.h"
#include "OneSixLibrary.h"
#include "OneSixInstance.h"
+#include "net/ForgeMirrors.h"
#include "pathutils.h"
@@ -163,20 +164,33 @@ void OneSixUpdate::jarlibStart()
libs.append(version->getActiveNormalLibs());
auto metacache = MMC->metacache();
+ QList<ForgeXzDownloadPtr> ForgeLibs;
+ bool already_forge_xz = false;
for (auto lib : libs)
{
if (lib->hint() == "local")
continue;
- QString download_path = lib->downloadUrl();
auto entry = metacache->resolveEntry("libraries", lib->storagePath());
if (entry->stale)
{
if (lib->hint() == "forge-pack-xz")
- jarlibDownloadJob->addNetAction(ForgeXzDownload::make(download_path, entry));
+ {
+ ForgeLibs.append(ForgeXzDownload::make(lib->storagePath(), entry));
+ }
else
- jarlibDownloadJob->addNetAction(CacheDownload::make(download_path, entry));
+ {
+ jarlibDownloadJob->addNetAction(CacheDownload::make(lib->downloadUrl(), entry));
+ }
}
}
+ // TODO: think about how to propagate this from the original json file... or IF AT ALL
+ QString forgeMirrorList = "http://files.minecraftforge.net/mirror-brand.list";
+ if (!ForgeLibs.empty())
+ {
+ jarlibDownloadJob->addNetAction(
+ ForgeMirrors::make(ForgeLibs, jarlibDownloadJob, forgeMirrorList));
+ }
+
connect(jarlibDownloadJob.get(), SIGNAL(succeeded()), SLOT(jarlibFinished()));
connect(jarlibDownloadJob.get(), SIGNAL(failed()), SLOT(jarlibFailed()));
connect(jarlibDownloadJob.get(), SIGNAL(progress(qint64, qint64)),