summaryrefslogtreecommitdiffstats
path: root/libmultimc
diff options
context:
space:
mode:
Diffstat (limited to 'libmultimc')
-rw-r--r--libmultimc/include/gameupdatetask.h3
-rw-r--r--libmultimc/src/gameupdatetask.cpp26
2 files changed, 28 insertions, 1 deletions
diff --git a/libmultimc/include/gameupdatetask.h b/libmultimc/include/gameupdatetask.h
index f607db6b..b56c448b 100644
--- a/libmultimc/include/gameupdatetask.h
+++ b/libmultimc/include/gameupdatetask.h
@@ -98,6 +98,9 @@ private slots:
void versionFileFinished();
void versionFileFailed();
+ void jarlibFinished();
+ void jarlibFailed();
+
signals:
/*!
* \brief Signal emitted when the game update is complete.
diff --git a/libmultimc/src/gameupdatetask.cpp b/libmultimc/src/gameupdatetask.cpp
index 54e47410..a8abb0b6 100644
--- a/libmultimc/src/gameupdatetask.cpp
+++ b/libmultimc/src/gameupdatetask.cpp
@@ -131,8 +131,32 @@ void GameUpdateTask::versionFileFinished()
vfile2.close();
// download the right jar, save it in versions/$version/$version.jar
- // determine and download all the libraries, save them in libraries/whatever...
+ QString urlstr("http://s3.amazonaws.com/Minecraft.Download/versions/");
+ urlstr += targetVersion->descriptor() + "/" + targetVersion->descriptor() + ".jar";
+ QString targetstr ("versions/");
+ targetstr += targetVersion->descriptor() + "/" + targetVersion->descriptor() + ".jar";
+ auto dljob = DownloadJob::create(QUrl(urlstr), targetstr);
+ jarlibDownloadJob.reset(new JobList());
+ jarlibDownloadJob->add(dljob);
+ connect(jarlibDownloadJob.data(), SIGNAL(finished()), SLOT(jarlibFinished()));
+ connect(jarlibDownloadJob.data(), SIGNAL(failed()), SLOT(jarlibFailed()));
+ connect(jarlibDownloadJob.data(), SIGNAL(progress(qint64,qint64)), SLOT(updateDownloadProgress(qint64,qint64)));
+ // determine and download all the libraries, save them in libraries/whatever...
+ download_queue.enqueue(jarlibDownloadJob);
+}
+
+void GameUpdateTask::jarlibFinished()
+{
+ exit(1);
+ // YAYAYAYAYYAYAAUAYAYYAYYY!!!!
+ // WEE DID IT!
+ // YESSSSS!
+}
+
+void GameUpdateTask::jarlibFailed()
+{
+ error("Failed to download the binary garbage. Try again. Maybe. IF YOU DARE");
exit(0);
}