mirror of
https://github.com/UltimMC/Launcher.git
synced 2025-12-17 01:17:15 +00:00
Get rid of QNAM (now subclassed and less needy). Basic LWJGL download and extraction.
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
*/
|
||||
|
||||
#include "MinecraftVersionList.h"
|
||||
#include <net/NetWorker.h>
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
@@ -29,8 +30,6 @@
|
||||
|
||||
#include <QtNetwork>
|
||||
|
||||
#include "netutils.h"
|
||||
|
||||
#define MCVLIST_URLBASE "http://s3.amazonaws.com/Minecraft.Download/versions/"
|
||||
#define ASSETS_URLBASE "http://assets.minecraft.net/"
|
||||
#define MCN_URLBASE "http://sonicrules.org/mcnweb.py"
|
||||
@@ -160,21 +159,18 @@ MCVListLoadTask::MCVListLoadTask(MinecraftVersionList *vlist)
|
||||
{
|
||||
m_list = vlist;
|
||||
m_currentStable = NULL;
|
||||
netMgr = nullptr;
|
||||
vlistReply = nullptr;
|
||||
}
|
||||
|
||||
MCVListLoadTask::~MCVListLoadTask()
|
||||
{
|
||||
if(netMgr)
|
||||
netMgr->deleteLater();
|
||||
}
|
||||
|
||||
void MCVListLoadTask::executeTask()
|
||||
{
|
||||
setStatus("Loading instance version list...");
|
||||
netMgr = new QNetworkAccessManager();
|
||||
vlistReply = netMgr->get(QNetworkRequest(QUrl(QString(MCVLIST_URLBASE) + "versions.json")));
|
||||
auto & worker = NetWorker::spawn();
|
||||
vlistReply = worker.get(QNetworkRequest(QUrl(QString(MCVLIST_URLBASE) + "versions.json")));
|
||||
connect(vlistReply, SIGNAL(finished()), this, SLOT(list_downloaded()));
|
||||
}
|
||||
|
||||
@@ -283,12 +279,18 @@ void MCVListLoadTask::list_downloaded()
|
||||
{
|
||||
versionType = MinecraftVersion::Snapshot;
|
||||
}
|
||||
else if(versionTypeStr == "old_beta" || versionTypeStr == "old_alpha")
|
||||
{
|
||||
versionType = MinecraftVersion::Nostalgia;
|
||||
}
|
||||
else
|
||||
{
|
||||
//FIXME: log this somewhere
|
||||
continue;
|
||||
}
|
||||
|
||||
//FIXME: detect if snapshots are old or not
|
||||
|
||||
// Get the download URL.
|
||||
QString dlUrl = QString(MCVLIST_URLBASE) + versionID + "/";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user