Replace one line. Get downloading of 1.6 jars working. Yay.

This commit is contained in:
Petr Mrázek 2013-07-09 22:46:33 +02:00
parent dd86061f0f
commit c96ac24605
2 changed files with 28 additions and 1 deletions

View File

@ -98,6 +98,9 @@ private slots:
void versionFileFinished();
void versionFileFailed();
void jarlibFinished();
void jarlibFailed();
signals:
/*!
* \brief Signal emitted when the game update is complete.

View File

@ -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);
}