NOISSUE remove use of obsolete URL constants, simplify the rest
This commit is contained in:
parent
16cc20aefd
commit
58260da861
@ -27,6 +27,7 @@
|
|||||||
#include "FileSystem.h"
|
#include "FileSystem.h"
|
||||||
#include "net/Download.h"
|
#include "net/Download.h"
|
||||||
#include "net/ChecksumValidator.h"
|
#include "net/ChecksumValidator.h"
|
||||||
|
#include "net/URLConstants.h"
|
||||||
|
|
||||||
|
|
||||||
namespace AssetsUtils
|
namespace AssetsUtils
|
||||||
@ -212,7 +213,7 @@ QString AssetObject::getLocalPath()
|
|||||||
|
|
||||||
QUrl AssetObject::getUrl()
|
QUrl AssetObject::getUrl()
|
||||||
{
|
{
|
||||||
return QUrl("https://resources.download.minecraft.net/" + getRelPath());
|
return URLConstants::RESOURCE_BASE + getRelPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString AssetObject::getRelPath()
|
QString AssetObject::getRelPath()
|
||||||
|
@ -192,7 +192,7 @@ QList< std::shared_ptr< NetAction > > Library::getDownloads(OpSys system, class
|
|||||||
|
|
||||||
if (m_repositoryURL.isEmpty())
|
if (m_repositoryURL.isEmpty())
|
||||||
{
|
{
|
||||||
return QString("https://" + URLConstants::LIBRARY_BASE) + raw_storage;
|
return URLConstants::LIBRARY_BASE + raw_storage;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_repositoryURL.endsWith('/'))
|
if(m_repositoryURL.endsWith('/'))
|
||||||
|
@ -42,7 +42,7 @@ void YggdrasilTask::executeTask()
|
|||||||
// Get the content of the request we're going to send to the server.
|
// Get the content of the request we're going to send to the server.
|
||||||
QJsonDocument doc(getRequestContent());
|
QJsonDocument doc(getRequestContent());
|
||||||
|
|
||||||
QUrl reqUrl("https://" + URLConstants::AUTH_BASE + getEndpoint());
|
QUrl reqUrl(URLConstants::AUTH_BASE + getEndpoint());
|
||||||
QNetworkRequest netRequest(reqUrl);
|
QNetworkRequest netRequest(reqUrl);
|
||||||
netRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
netRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
||||||
|
|
||||||
|
@ -63,8 +63,7 @@ void FMLLibrariesTask::executeTask()
|
|||||||
for (auto &lib : fmlLibsToProcess)
|
for (auto &lib : fmlLibsToProcess)
|
||||||
{
|
{
|
||||||
auto entry = metacache->resolveEntry("fmllibs", lib.filename);
|
auto entry = metacache->resolveEntry("fmllibs", lib.filename);
|
||||||
QString urlString = lib.ours ? URLConstants::FMLLIBS_OUR_BASE_URL + lib.filename
|
QString urlString = (lib.ours ? URLConstants::FMLLIBS_OUR_BASE_URL : URLConstants::FMLLIBS_FORGE_BASE_URL) + lib.filename;
|
||||||
: URLConstants::FMLLIBS_FORGE_BASE_URL + lib.filename;
|
|
||||||
dljob->addNetAction(Net::Download::makeCached(QUrl(urlString), entry));
|
dljob->addNetAction(Net::Download::makeCached(QUrl(urlString), entry));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ namespace URLConstants {
|
|||||||
|
|
||||||
QString getLegacyJarUrl(QString version)
|
QString getLegacyJarUrl(QString version)
|
||||||
{
|
{
|
||||||
return "https://" + AWS_DOWNLOAD_VERSIONS + getJarPath(version);
|
return AWS_DOWNLOAD_VERSIONS + getJarPath(version);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString getJarPath(QString version)
|
QString getJarPath(QString version)
|
||||||
|
@ -19,17 +19,12 @@
|
|||||||
|
|
||||||
namespace URLConstants
|
namespace URLConstants
|
||||||
{
|
{
|
||||||
const QString AWS_DOWNLOAD_VERSIONS("s3.amazonaws.com/Minecraft.Download/versions/");
|
const QString AWS_DOWNLOAD_VERSIONS("https://s3.amazonaws.com/Minecraft.Download/versions/");
|
||||||
const QString RESOURCE_BASE("resources.download.minecraft.net/");
|
const QString RESOURCE_BASE("https://resources.download.minecraft.net/");
|
||||||
const QString LIBRARY_BASE("libraries.minecraft.net/");
|
const QString LIBRARY_BASE("https://libraries.minecraft.net/");
|
||||||
//const QString SKINS_BASE("skins.minecraft.net/MinecraftSkins/");
|
const QString SKINS_BASE("https://crafatar.com/skins/");
|
||||||
const QString SKINS_BASE("crafatar.com/skins/");
|
const QString AUTH_BASE("https://authserver.mojang.com/");
|
||||||
const QString AUTH_BASE("authserver.mojang.com/");
|
|
||||||
const QString FORGE_LEGACY_URL("https://files.minecraftforge.net/minecraftforge/json");
|
|
||||||
const QString FORGE_GRADLE_URL("https://files.minecraftforge.net/maven/net/minecraftforge/forge/json");
|
|
||||||
const QString MOJANG_STATUS_URL("https://status.mojang.com/check");
|
const QString MOJANG_STATUS_URL("https://status.mojang.com/check");
|
||||||
const QString MOJANG_STATUS_NEWS_URL("https://status.mojang.com/news");
|
|
||||||
const QString LITELOADER_URL("http://dl.liteloader.com/versions/versions.json");
|
|
||||||
const QString IMGUR_BASE_URL("https://api.imgur.com/3/");
|
const QString IMGUR_BASE_URL("https://api.imgur.com/3/");
|
||||||
const QString FMLLIBS_OUR_BASE_URL("https://files.multimc.org/fmllibs/");
|
const QString FMLLIBS_OUR_BASE_URL("https://files.multimc.org/fmllibs/");
|
||||||
const QString FMLLIBS_FORGE_BASE_URL("https://files.minecraftforge.net/fmllibs/");
|
const QString FMLLIBS_FORGE_BASE_URL("https://files.minecraftforge.net/fmllibs/");
|
||||||
|
@ -758,7 +758,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new MainWindow
|
|||||||
for (auto profile : account->profiles())
|
for (auto profile : account->profiles())
|
||||||
{
|
{
|
||||||
auto meta = Env::getInstance().metacache()->resolveEntry("skins", profile.id + ".png");
|
auto meta = Env::getInstance().metacache()->resolveEntry("skins", profile.id + ".png");
|
||||||
auto action = Net::Download::makeCached(QUrl("https://" + URLConstants::SKINS_BASE + profile.id + ".png"), meta);
|
auto action = Net::Download::makeCached(QUrl(URLConstants::SKINS_BASE + profile.id + ".png"), meta);
|
||||||
skin_dls.append(action);
|
skin_dls.append(action);
|
||||||
meta->setStale(true);
|
meta->setStale(true);
|
||||||
}
|
}
|
||||||
|
@ -131,7 +131,7 @@ void AccountListPage::addAccount(const QString &errMsg)
|
|||||||
for (AccountProfile profile : account->profiles())
|
for (AccountProfile profile : account->profiles())
|
||||||
{
|
{
|
||||||
auto meta = Env::getInstance().metacache()->resolveEntry("skins", profile.id + ".png");
|
auto meta = Env::getInstance().metacache()->resolveEntry("skins", profile.id + ".png");
|
||||||
auto action = Net::Download::makeCached(QUrl("https://" + URLConstants::SKINS_BASE + profile.id + ".png"), meta);
|
auto action = Net::Download::makeCached(QUrl(URLConstants::SKINS_BASE + profile.id + ".png"), meta);
|
||||||
job->addNetAction(action);
|
job->addNetAction(action);
|
||||||
meta->setStale(true);
|
meta->setStale(true);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user