mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-06-12 05:07:46 +02:00
GH-3234 Add support for custom meta URLs at build time
This is not particularly interesting for non-developers. Also includes some internal restructuring of URL constants in general.
This commit is contained in:
@ -27,7 +27,7 @@
|
||||
#include "FileSystem.h"
|
||||
#include "net/Download.h"
|
||||
#include "net/ChecksumValidator.h"
|
||||
#include "net/URLConstants.h"
|
||||
#include "BuildConfig.h"
|
||||
|
||||
namespace {
|
||||
QSet<QString> collectPathsFromDir(QString dirPath)
|
||||
@ -308,7 +308,7 @@ QString AssetObject::getLocalPath()
|
||||
|
||||
QUrl AssetObject::getUrl()
|
||||
{
|
||||
return URLConstants::RESOURCE_BASE + getRelPath();
|
||||
return BuildConfig.RESOURCE_BASE + getRelPath();
|
||||
}
|
||||
|
||||
QString AssetObject::getRelPath()
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <net/ChecksumValidator.h>
|
||||
#include <Env.h>
|
||||
#include <FileSystem.h>
|
||||
#include <BuildConfig.h>
|
||||
|
||||
|
||||
void Library::getApplicableFiles(OpSys system, QStringList& jar, QStringList& native, QStringList& native32,
|
||||
@ -171,7 +172,7 @@ QList< std::shared_ptr< NetAction > > Library::getDownloads(
|
||||
|
||||
if (m_repositoryURL.isEmpty())
|
||||
{
|
||||
return URLConstants::LIBRARY_BASE + raw_storage;
|
||||
return BuildConfig.LIBRARY_BASE + raw_storage;
|
||||
}
|
||||
|
||||
if(m_repositoryURL.endsWith('/'))
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "Rule.h"
|
||||
#include "minecraft/OpSys.h"
|
||||
#include "GradleSpecifier.h"
|
||||
#include "net/URLConstants.h"
|
||||
#include "MojangDownloadInfo.h"
|
||||
|
||||
#include "multimc_logic_export.h"
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include "BaseInstance.h"
|
||||
#include "minecraft/PackProfile.h"
|
||||
#include "minecraft/Library.h"
|
||||
#include "net/URLConstants.h"
|
||||
#include <FileSystem.h>
|
||||
|
||||
#include "update/FoldersTask.h"
|
||||
|
@ -198,7 +198,10 @@ VersionFilePtr OneSixVersionFormat::versionFileFromJson(const QJsonDocument &doc
|
||||
// FIXME: this will eventually break...
|
||||
else
|
||||
{
|
||||
lib->setAbsoluteUrl(URLConstants::getLegacyJarUrl(out->minecraftVersion));
|
||||
out->addProblem(
|
||||
ProblemSeverity::Error,
|
||||
QObject::tr("URL for the main jar could not be determined - Mojang removed the server that we used as fallback.")
|
||||
);
|
||||
}
|
||||
out->mainJar = lib;
|
||||
}
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
#include <Env.h>
|
||||
|
||||
#include <net/URLConstants.h>
|
||||
#include <BuildConfig.h>
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
@ -42,7 +42,7 @@ void YggdrasilTask::executeTask()
|
||||
// Get the content of the request we're going to send to the server.
|
||||
QJsonDocument doc(getRequestContent());
|
||||
|
||||
QUrl reqUrl(URLConstants::AUTH_BASE + getEndpoint());
|
||||
QUrl reqUrl(BuildConfig.AUTH_BASE + getEndpoint());
|
||||
QNetworkRequest netRequest(reqUrl);
|
||||
netRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include "FMLLibrariesTask.h"
|
||||
#include "minecraft/MinecraftInstance.h"
|
||||
#include "minecraft/PackProfile.h"
|
||||
#include "BuildConfig.h"
|
||||
|
||||
FMLLibrariesTask::FMLLibrariesTask(MinecraftInstance * inst)
|
||||
{
|
||||
@ -63,7 +64,7 @@ void FMLLibrariesTask::executeTask()
|
||||
for (auto &lib : fmlLibsToProcess)
|
||||
{
|
||||
auto entry = metacache->resolveEntry("fmllibs", lib.filename);
|
||||
QString urlString = (lib.ours ? URLConstants::FMLLIBS_OUR_BASE_URL : URLConstants::FMLLIBS_FORGE_BASE_URL) + lib.filename;
|
||||
QString urlString = (lib.ours ? BuildConfig.FMLLIBS_OUR_BASE_URL : BuildConfig.FMLLIBS_FORGE_BASE_URL) + lib.filename;
|
||||
dljob->addNetAction(Net::Download::makeCached(QUrl(urlString), entry));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user