aboutsummaryrefslogtreecommitdiff
path: root/launcher
diff options
context:
space:
mode:
Diffstat (limited to 'launcher')
-rw-r--r--launcher/CMakeLists.txt1
-rwxr-xr-xlauncher/Launcher.in18
-rw-r--r--launcher/MMCZip.cpp5
-rw-r--r--launcher/QObjectPtr.h6
-rw-r--r--launcher/java/JavaUtils.cpp70
-rw-r--r--launcher/java/JavaUtils.h1
-rw-r--r--launcher/launch/LaunchTask.cpp33
-rw-r--r--launcher/launch/LaunchTask.h4
-rw-r--r--launcher/launch/steps/PostLaunchCommand.cpp7
-rw-r--r--launcher/launch/steps/PreLaunchCommand.cpp7
-rw-r--r--launcher/minecraft/MinecraftInstance.cpp6
-rw-r--r--launcher/minecraft/auth/AccountList.cpp11
-rw-r--r--launcher/minecraft/auth/steps/LauncherLoginStep.cpp17
-rw-r--r--launcher/minecraft/auth/steps/MinecraftProfileStep.cpp17
-rw-r--r--launcher/minecraft/auth/steps/MinecraftProfileStepMojang.cpp17
-rw-r--r--launcher/minecraft/auth/steps/XboxAuthorizationStep.cpp21
-rw-r--r--launcher/minecraft/auth/steps/XboxProfileStep.cpp17
-rw-r--r--launcher/minecraft/auth/steps/XboxUserStep.cpp13
-rw-r--r--launcher/modplatform/flame/FileResolvingTask.cpp7
-rw-r--r--launcher/modplatform/flame/FileResolvingTask.h3
-rw-r--r--launcher/modplatform/flame/FlameCheckUpdate.cpp4
-rw-r--r--launcher/modplatform/modpacksch/FTBPackInstallTask.cpp279
-rw-r--r--launcher/modplatform/modpacksch/FTBPackInstallTask.h80
-rw-r--r--launcher/modplatform/modpacksch/FTBPackManifest.cpp46
-rw-r--r--launcher/modplatform/modpacksch/FTBPackManifest.h48
-rw-r--r--launcher/net/NetUtils.h44
-rw-r--r--launcher/ui/dialogs/ModUpdateDialog.cpp13
-rw-r--r--launcher/ui/dialogs/ProgressDialog.cpp4
-rw-r--r--launcher/ui/pages/instance/ExternalResourcesPage.cpp8
-rw-r--r--launcher/ui/pages/instance/ExternalResourcesPage.ui2
-rw-r--r--launcher/ui/pages/instance/InstanceSettingsPage.cpp2
-rw-r--r--launcher/ui/pages/instance/ModFolderPage.cpp15
-rw-r--r--launcher/ui/pages/modplatform/ftb/FtbPage.cpp3
33 files changed, 577 insertions, 252 deletions
diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt
index b540dcab..9c5c2ea8 100644
--- a/launcher/CMakeLists.txt
+++ b/launcher/CMakeLists.txt
@@ -117,6 +117,7 @@ set(NET_SOURCES
net/NetAction.h
net/NetJob.cpp
net/NetJob.h
+ net/NetUtils.h
net/PasteUpload.cpp
net/PasteUpload.h
net/Sink.h
diff --git a/launcher/Launcher.in b/launcher/Launcher.in
index 528e360e..68fac26a 100755
--- a/launcher/Launcher.in
+++ b/launcher/Launcher.in
@@ -18,13 +18,17 @@ LAUNCHER_NAME=@Launcher_APP_BINARY_NAME@
LAUNCHER_DIR="$(dirname "$(readlink -f "$0")")"
echo "Launcher Dir: ${LAUNCHER_DIR}"
-# Set up env - filter out input LD_ variables but pass them in under different names
-export GAME_LIBRARY_PATH=${GAME_LIBRARY_PATH-${LD_LIBRARY_PATH}}
-export GAME_PRELOAD=${GAME_PRELOAD-${LD_PRELOAD}}
-export LD_LIBRARY_PATH="${LAUNCHER_DIR}/lib@LIB_SUFFIX@":$LAUNCHER_LIBRARY_PATH
-export LD_PRELOAD=$LAUNCHER_PRELOAD
-export QT_PLUGIN_PATH="${LAUNCHER_DIR}/plugins"
-export QT_FONTPATH="${LAUNCHER_DIR}/fonts"
+# Set up env.
+# Pass our custom variables separately so that the launcher can remove them for child processes
+export LAUNCHER_LD_LIBRARY_PATH="${LAUNCHER_DIR}/lib@LIB_SUFFIX@"
+export LAUNCHER_LD_PRELOAD=""
+export LAUNCHER_QT_PLUGIN_PATH="${LAUNCHER_DIR}/plugins"
+export LAUNCHER_QT_FONTPATH="${LAUNCHER_DIR}/fonts"
+
+export LD_LIBRARY_PATH="$LAUNCHER_LD_LIBRARY_PATH:$LD_LIBRARY_PATH"
+export LD_PRELOAD="$LAUNCHER_LD_PRELOAD:$LD_PRELOAD"
+export QT_PLUGIN_PATH="$LAUNCHER_QT_PLUGIN_PATH:$QT_PLUGIN_PATH"
+export QT_FONTPATH="$LAUNCHER_QT_FONTPATH:$QT_FONTPATH"
# Detect missing dependencies...
DEPS_LIST=`ldd "${LAUNCHER_DIR}"/plugins/*/*.so 2>/dev/null | grep "not found" | sort -u | awk -vORS=", " '{ print $1 }'`
diff --git a/launcher/MMCZip.cpp b/launcher/MMCZip.cpp
index 71cca03b..04ca5094 100644
--- a/launcher/MMCZip.cpp
+++ b/launcher/MMCZip.cpp
@@ -141,9 +141,10 @@ bool MMCZip::createModdedJar(QString sourceJarPath, QString targetJarPath, const
QSet<QString> addedFiles;
// Modify the jar
- for (auto i = mods.constEnd(); i != mods.constBegin(); --i)
+ // This needs to be done in reverse-order to ensure we respect the loading order of components
+ for (auto i = mods.crbegin(); i != mods.crend(); i++)
{
- const Mod* mod = *i;
+ const auto* mod = *i;
// do not merge disabled mods.
if (!mod->enabled())
continue;
diff --git a/launcher/QObjectPtr.h b/launcher/QObjectPtr.h
index 57974939..173dc5e7 100644
--- a/launcher/QObjectPtr.h
+++ b/launcher/QObjectPtr.h
@@ -77,10 +77,12 @@ public:
{
return m_ptr;
}
- bool operator==(const shared_qobject_ptr<T>& other) {
+ template<typename U>
+ bool operator==(const shared_qobject_ptr<U>& other) const {
return m_ptr == other.m_ptr;
}
- bool operator!=(const shared_qobject_ptr<T>& other) {
+ template<typename U>
+ bool operator!=(const shared_qobject_ptr<U>& other) const {
return m_ptr != other.m_ptr;
}
diff --git a/launcher/java/JavaUtils.cpp b/launcher/java/JavaUtils.cpp
index e7013142..2b19fca0 100644
--- a/launcher/java/JavaUtils.cpp
+++ b/launcher/java/JavaUtils.cpp
@@ -52,25 +52,24 @@ JavaUtils::JavaUtils()
{
}
-#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
-static QString processLD_LIBRARY_PATH(const QString & LD_LIBRARY_PATH)
+QString stripVariableEntries(QString name, QString target, QString remove)
{
- QDir mmcBin(QCoreApplication::applicationDirPath());
- auto items = LD_LIBRARY_PATH.split(':');
- QStringList final;
- for(auto & item: items)
- {
- QDir test(item);
- if(test == mmcBin)
- {
- qDebug() << "Env:LD_LIBRARY_PATH ignoring path" << item;
- continue;
- }
- final.append(item);
+ char delimiter = ':';
+#ifdef Q_OS_WIN32
+ delimiter = ';';
+#endif
+
+ auto targetItems = target.split(delimiter);
+ auto toRemove = remove.split(delimiter);
+
+ for (QString item : toRemove) {
+ bool removed = targetItems.removeOne(item);
+ if (!removed)
+ qWarning() << "Entry" << item
+ << "could not be stripped from variable" << name;
}
- return final.join(':');
+ return targetItems.join(delimiter);
}
-#endif
QProcessEnvironment CleanEnviroment()
{
@@ -89,6 +88,16 @@ QProcessEnvironment CleanEnviroment()
"JAVA_OPTIONS",
"JAVA_TOOL_OPTIONS"
};
+
+ QStringList stripped =
+ {
+#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
+ "LD_LIBRARY_PATH",
+ "LD_PRELOAD",
+#endif
+ "QT_PLUGIN_PATH",
+ "QT_FONTPATH"
+ };
for(auto key: rawenv.keys())
{
auto value = rawenv.value(key);
@@ -98,19 +107,22 @@ QProcessEnvironment CleanEnviroment()
qDebug() << "Env: ignoring" << key << value;
continue;
}
- // filter PolyMC-related things
- if(key.startsWith("QT_"))
+
+ // These are used to strip the original variables
+ // If there is "LD_LIBRARY_PATH" and "LAUNCHER_LD_LIBRARY_PATH", we want to
+ // remove all values in "LAUNCHER_LD_LIBRARY_PATH" from "LD_LIBRARY_PATH"
+ if(key.startsWith("LAUNCHER_"))
{
qDebug() << "Env: ignoring" << key << value;
continue;
}
-#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
- // Do not pass LD_* variables to java. They were intended for PolyMC
- if(key.startsWith("LD_"))
+ if(stripped.contains(key))
{
- qDebug() << "Env: ignoring" << key << value;
- continue;
+ QString newValue = stripVariableEntries(key, value, rawenv.value("LAUNCHER_" + key));
+
+ qDebug() << "Env: stripped" << key << value << "to" << newValue;
}
+#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
// Strip IBus
// IBus is a Linux IME framework. For some reason, it breaks MC?
if (key == "XMODIFIERS" && value.contains(IBUS))
@@ -119,22 +131,12 @@ QProcessEnvironment CleanEnviroment()
value.replace(IBUS, "");
qDebug() << "Env: stripped" << IBUS << "from" << save << ":" << value;
}
- if(key == "GAME_PRELOAD")
- {
- env.insert("LD_PRELOAD", value);
- continue;
- }
- if(key == "GAME_LIBRARY_PATH")
- {
- env.insert("LD_LIBRARY_PATH", processLD_LIBRARY_PATH(value));
- continue;
- }
#endif
// qDebug() << "Env: " << key << value;
env.insert(key, value);
}
#ifdef Q_OS_LINUX
- // HACK: Workaround for QTBUG42500
+ // HACK: Workaround for QTBUG-42500
if(!env.contains("LD_LIBRARY_PATH"))
{
env.insert("LD_LIBRARY_PATH", "");
diff --git a/launcher/java/JavaUtils.h b/launcher/java/JavaUtils.h
index 26d8003b..9b69b516 100644
--- a/launcher/java/JavaUtils.h
+++ b/launcher/java/JavaUtils.h
@@ -24,6 +24,7 @@
#include <windows.h>
#endif
+QString stripVariableEntries(QString name, QString target, QString remove);
QProcessEnvironment CleanEnviroment();
class JavaUtils : public QObject
diff --git a/launcher/launch/LaunchTask.cpp b/launcher/launch/LaunchTask.cpp
index 3aa95052..28fcc4f4 100644
--- a/launcher/launch/LaunchTask.cpp
+++ b/launcher/launch/LaunchTask.cpp
@@ -282,35 +282,22 @@ void LaunchTask::emitFailed(QString reason)
Task::emitFailed(reason);
}
-void LaunchTask::substituteVariables(const QStringList &args) const
+void LaunchTask::substituteVariables(QStringList &args) const
{
- auto variables = m_instance->getVariables();
- auto envVariables = QProcessEnvironment::systemEnvironment();
+ auto env = m_instance->createEnvironment();
- for (auto arg : args) {
- for (auto key : variables)
- {
- arg.replace("$" + key, variables.value(key));
- }
- for (auto env : envVariables.keys())
- {
- arg.replace("$" + env, envVariables.value(env));
- }
+ for (auto key : env.keys())
+ {
+ args.replaceInStrings("$" + key, env.value(key));
}
}
-QString LaunchTask::substituteVariables(const QString &cmd) const
+void LaunchTask::substituteVariables(QString &cmd) const
{
- QString out = cmd;
- auto variables = m_instance->getVariables();
- for (auto it = variables.begin(); it != variables.end(); ++it)
- {
- out.replace("$" + it.key(), it.value());
- }
- auto env = QProcessEnvironment::systemEnvironment();
- for (auto var : env.keys())
+ auto env = m_instance->createEnvironment();
+
+ for (auto key : env.keys())
{
- out.replace("$" + var, env.value(var));
+ cmd.replace("$" + key, env.value(key));
}
- return out;
}
diff --git a/launcher/launch/LaunchTask.h b/launcher/launch/LaunchTask.h
index 2efe1fa2..9c72b23f 100644
--- a/launcher/launch/LaunchTask.h
+++ b/launcher/launch/LaunchTask.h
@@ -105,8 +105,8 @@ public: /* methods */
shared_qobject_ptr<LogModel> getLogModel();
public:
- void substituteVariables(const QStringList &args) const;
- QString substituteVariables(const QString &cmd) const;
+ void substituteVariables(QStringList &args) const;
+ void substituteVariables(QString &cmd) const;
QString censorPrivateInfo(QString in);
protected: /* methods */
diff --git a/launcher/launch/steps/PostLaunchCommand.cpp b/launcher/launch/steps/PostLaunchCommand.cpp
index cf765bc0..ccf07f22 100644
--- a/launcher/launch/steps/PostLaunchCommand.cpp
+++ b/launcher/launch/steps/PostLaunchCommand.cpp
@@ -56,9 +56,10 @@ void PostLaunchCommand::executeTask()
const QString program = args.takeFirst();
m_process.start(program, args);
#else
- QString postlaunch_cmd = m_parent->substituteVariables(m_command);
- emit logLine(tr("Running Post-Launch command: %1").arg(postlaunch_cmd), MessageLevel::Launcher);
- m_process.start(postlaunch_cmd);
+ m_parent->substituteVariables(m_command);
+
+ emit logLine(tr("Running Post-Launch command: %1").arg(m_command), MessageLevel::Launcher);
+ m_process.start(m_command);
#endif
}
diff --git a/launcher/launch/steps/PreLaunchCommand.cpp b/launcher/launch/steps/PreLaunchCommand.cpp
index bf7d27eb..0b0392cb 100644
--- a/launcher/launch/steps/PreLaunchCommand.cpp
+++ b/launcher/launch/steps/PreLaunchCommand.cpp
@@ -56,9 +56,10 @@ void PreLaunchCommand::executeTask()
const QString program = args.takeFirst();
m_process.start(program, args);
#else
- QString prelaunch_cmd = m_parent->substituteVariables(m_command);
- emit logLine(tr("Running Pre-Launch command: %1").arg(prelaunch_cmd), MessageLevel::Launcher);
- m_process.start(prelaunch_cmd);
+ m_parent->substituteVariables(m_command);
+
+ emit logLine(tr("Running Pre-Launch command: %1").arg(m_command), MessageLevel::Launcher);
+ m_process.start(m_command);
#endif
}
diff --git a/launcher/minecraft/MinecraftInstance.cpp b/launcher/minecraft/MinecraftInstance.cpp
index 360e754d..5a6f8de0 100644
--- a/launcher/minecraft/MinecraftInstance.cpp
+++ b/launcher/minecraft/MinecraftInstance.cpp
@@ -709,15 +709,15 @@ QStringList MinecraftInstance::verboseDescription(AuthSessionPtr session, Minecr
{
if(mod->type() == Mod::MOD_FOLDER)
{
- out << u8" [📁] " + mod->fileinfo().completeBaseName() + " (folder)";
+ out << u8" [🖿] " + mod->fileinfo().completeBaseName() + " (folder)";
continue;
}
if(mod->enabled()) {
- out << u8" [✔️]" + mod->fileinfo().completeBaseName();
+ out << u8" [✔] " + mod->fileinfo().completeBaseName();
}
else {
- out << u8" [❌] " + mod->fileinfo().completeBaseName() + " (disabled)";
+ out << u8" [✘] " + mod->fileinfo().completeBaseName() + " (disabled)";
}
}
diff --git a/launcher/minecraft/auth/AccountList.cpp b/launcher/minecraft/auth/AccountList.cpp
index 2b851e18..b3b57c74 100644
--- a/launcher/minecraft/auth/AccountList.cpp
+++ b/launcher/minecraft/auth/AccountList.cpp
@@ -109,8 +109,10 @@ QStringList AccountList::profileNames() const {
void AccountList::addAccount(const MinecraftAccountPtr account)
{
- // NOTE: Do not allow adding something that's already there
- if(m_accounts.contains(account)) {
+ // NOTE: Do not allow adding something that's already there. We shouldn't let it continue
+ // because of the signal / slot connections after this.
+ if (m_accounts.contains(account)) {
+ qDebug() << "Tried to add account that's already on the accounts list!";
return;
}
@@ -123,6 +125,8 @@ void AccountList::addAccount(const MinecraftAccountPtr account)
if(profileId.size()) {
auto existingAccount = findAccountByProfileId(profileId);
if(existingAccount != -1) {
+ qDebug() << "Replacing old account with a new one with the same profile ID!";
+
MinecraftAccountPtr existingAccountPtr = m_accounts[existingAccount];
m_accounts[existingAccount] = account;
if(m_defaultAccount == existingAccountPtr) {
@@ -138,9 +142,12 @@ void AccountList::addAccount(const MinecraftAccountPtr account)
// if we don't have this profileId yet, add the account to the end
int row = m_accounts.count();
+ qDebug() << "Inserting account at index" << row;
+
beginInsertRows(QModelIndex(), row, row);
m_accounts.append(account);
endInsertRows();
+
onListChanged();
}
diff --git a/launcher/minecraft/auth/steps/LauncherLoginStep.cpp b/launcher/minecraft/auth/steps/LauncherLoginStep.cpp
index f5697223..8c53f037 100644
--- a/launcher/minecraft/auth/steps/LauncherLoginStep.cpp
+++ b/launcher/minecraft/auth/steps/LauncherLoginStep.cpp
@@ -5,6 +5,7 @@
#include "minecraft/auth/AuthRequest.h"
#include "minecraft/auth/Parsers.h"
#include "minecraft/auth/AccountTask.h"
+#include "net/NetUtils.h"
LauncherLoginStep::LauncherLoginStep(AccountData* data) : AuthStep(data) {
@@ -58,10 +59,18 @@ void LauncherLoginStep::onRequestDone(
#ifndef NDEBUG
qDebug() << data;
#endif
- emit finished(
- AccountTaskState::STATE_FAILED_SOFT,
- tr("Failed to get Minecraft access token: %1").arg(requestor->errorString_)
- );
+ if (Net::isApplicationError(error)) {
+ emit finished(
+ AccountTaskState::STATE_FAILED_SOFT,
+ tr("Failed to get Minecraft access token: %1").arg(requestor->errorString_)
+ );
+ }
+ else {
+ emit finished(
+ AccountTaskState::STATE_OFFLINE,
+ tr("Failed to get Minecraft access token: %1").arg(requestor->errorString_)
+ );
+ }
return;
}
diff --git a/launcher/minecraft/auth/steps/MinecraftProfileStep.cpp b/launcher/minecraft/auth/steps/MinecraftProfileStep.cpp
index add91659..b39b9326 100644
--- a/launcher/minecraft/auth/steps/MinecraftProfileStep.cpp
+++ b/launcher/minecraft/auth/steps/MinecraftProfileStep.cpp
@@ -4,6 +4,7 @@
#include "minecraft/auth/AuthRequest.h"
#include "minecraft/auth/Parsers.h"
+#include "net/NetUtils.h"
MinecraftProfileStep::MinecraftProfileStep(AccountData* data) : AuthStep(data) {
@@ -64,10 +65,18 @@ void MinecraftProfileStep::onRequestDone(
qWarning() << " Response:";
qWarning() << QString::fromUtf8(data);
- emit finished(
- AccountTaskState::STATE_FAILED_SOFT,
- tr("Minecraft Java profile acquisition failed.")
- );
+ if (Net::isApplicationError(error)) {
+ emit finished(
+ AccountTaskState::STATE_FAILED_SOFT,
+ tr("Minecraft Java profile acquisition failed: %1").arg(requestor->errorString_)
+ );
+ }
+ else {
+ emit finished(
+ AccountTaskState::STATE_OFFLINE,
+ tr("Minecraft Java profile acquisition failed: %1").arg(requestor->errorString_)
+ );
+ }
return;
}
if(!Parsers::parseMinecraftProfile(data, m_data->minecraftProfile)) {
diff --git a/launcher/minecraft/auth/steps/MinecraftProfileStepMojang.cpp b/launcher/minecraft/auth/steps/MinecraftProfileStepMojang.cpp
index d3035272..6a1eb7a0 100644
--- a/launcher/minecraft/auth/steps/MinecraftProfileStepMojang.cpp
+++ b/launcher/minecraft/auth/steps/MinecraftProfileStepMojang.cpp
@@ -4,6 +4,7 @@
#include "minecraft/auth/AuthRequest.h"
#include "minecraft/auth/Parsers.h"
+#include "net/NetUtils.h"
MinecraftProfileStepMojang::MinecraftProfileStepMojang(AccountData* data) : AuthStep(data) {
@@ -67,10 +68,18 @@ void MinecraftProfileStepMojang::onRequestDone(
qWarning() << " Response:";
qWarning() << QString::fromUtf8(data);
- emit finished(
- AccountTaskState::STATE_FAILED_SOFT,
- tr("Minecraft Java profile acquisition failed.")
- );
+ if (Net::isApplicationError(error)) {
+ emit finished(
+ AccountTaskState::STATE_FAILED_SOFT,
+ tr("Minecraft Java profile acquisition failed: %1").arg(requestor->errorString_)
+ );
+ }
+ else {
+ emit finished(
+ AccountTaskState::STATE_OFFLINE,
+ tr("Minecraft Java profile acquisition failed: %1").arg(requestor->errorString_)
+ );
+ }
return;
}
if(!Parsers::parseMinecraftProfileMojang(data, m_data->minecraftProfile)) {
diff --git a/launcher/minecraft/auth/steps/XboxAuthorizationStep.cpp b/launcher/minecraft/auth/steps/XboxAuthorizationStep.cpp
index 589768e3..14bde47e 100644
--- a/launcher/minecraft/auth/steps/XboxAuthorizationStep.cpp
+++ b/launcher/minecraft/auth/steps/XboxAuthorizationStep.cpp
@@ -6,6 +6,7 @@
#include "minecraft/auth/AuthRequest.h"
#include "minecraft/auth/Parsers.h"
+#include "net/NetUtils.h"
XboxAuthorizationStep::XboxAuthorizationStep(AccountData* data, Katabasis::Token *token, QString relyingParty, QString authorizationKind):
AuthStep(data),
@@ -62,10 +63,24 @@ void XboxAuthorizationStep::onRequestDone(
#endif
if (error != QNetworkReply::NoError) {
qWarning() << "Reply error:" << error;
- if(!processSTSError(error, data, headers)) {
+ if (Net::isApplicationError(error)) {
+ if(!processSTSError(error, data, headers)) {
+ emit finished(
+ AccountTaskState::STATE_FAILED_SOFT,
+ tr("Failed to get authorization for %1 services. Error %2.").arg(m_authorizationKind, error)
+ );
+ }
+ else {
+ emit finished(
+ AccountTaskState::STATE_FAILED_SOFT,
+ tr("Unknown STS error for %1 services: %2").arg(m_authorizationKind, requestor->errorString_)
+ );
+ }
+ }
+ else {
emit finished(
- AccountTaskState::STATE_FAILED_SOFT,
- tr("Failed to get authorization for %1 services. Error %2.").arg(m_authorizationKind, error)
+ AccountTaskState::STATE_OFFLINE,
+ tr("Failed to get authorization for %1 services: %2").arg(m_authorizationKind, requestor->errorString_)
);
}
return;
diff --git a/launcher/minecraft/auth/steps/XboxProfileStep.cpp b/launcher/minecraft/auth/steps/XboxProfileStep.cpp
index 9f50138e..738fe1db 100644
--- a/launcher/minecraft/auth/steps/XboxProfileStep.cpp
+++ b/launcher/minecraft/auth/steps/XboxProfileStep.cpp
@@ -6,6 +6,7 @@
#include "minecraft/auth/AuthRequest.h"
#include "minecraft/auth/Parsers.h"
+#include "net/NetUtils.h"
XboxProfileStep::XboxProfileStep(AccountData* data) : AuthStep(data) {
@@ -58,10 +59,18 @@ void XboxProfileStep::onRequestDone(
#ifndef NDEBUG
qDebug() << data;
#endif
- finished(
- AccountTaskState::STATE_FAILED_SOFT,
- tr("Failed to retrieve the Xbox profile.")
- );
+ if (Net::isApplicationError(error)) {
+ emit finished(
+ AccountTaskState::STATE_FAILED_SOFT,
+ tr("Failed to retrieve the Xbox profile: %1").arg(requestor->errorString_)
+ );
+ }
+ else {
+ emit finished(
+ AccountTaskState::STATE_OFFLINE,
+ tr("Failed to retrieve the Xbox profile: %1").arg(requestor->errorString_)
+ );
+ }
return;
}
diff --git a/launcher/minecraft/auth/steps/XboxUserStep.cpp b/launcher/minecraft/auth/steps/XboxUserStep.cpp
index a38a28e4..53069597 100644
--- a/launcher/minecraft/auth/steps/XboxUserStep.cpp
+++ b/launcher/minecraft/auth/steps/XboxUserStep.cpp
@@ -4,6 +4,7 @@
#include "minecraft/auth/AuthRequest.h"
#include "minecraft/auth/Parsers.h"
+#include "net/NetUtils.h"
XboxUserStep::XboxUserStep(AccountData* data) : AuthStep(data) {
@@ -53,7 +54,17 @@ void XboxUserStep::onRequestDone(
if (error != QNetworkReply::NoError) {
qWarning() << "Reply error:" << error;
- emit finished(AccountTaskState::STATE_FAILED_SOFT, tr("XBox user authentication failed."));
+ if (Net::isApplicationError(error)) {
+ emit finished(AccountTaskState::STATE_FAILED_SOFT,
+ tr("XBox user authentication failed: %1").arg(requestor->errorString_)
+ );
+ }
+ else {
+ emit finished(
+ AccountTaskState::STATE_OFFLINE,
+ tr("XBox user authentication failed: %1").arg(requestor->errorString_)
+ );
+ }
return;
}
diff --git a/launcher/modplatform/flame/FileResolvingTask.cpp b/launcher/modplatform/flame/FileResolvingTask.cpp
index c1f56658..058d2471 100644
--- a/launcher/modplatform/flame/FileResolvingTask.cpp
+++ b/launcher/modplatform/flame/FileResolvingTask.cpp
@@ -7,6 +7,13 @@ Flame::FileResolvingTask::FileResolvingTask(const shared_qobject_ptr<QNetworkAcc
: m_network(network), m_toProcess(toProcess)
{}
+bool Flame::FileResolvingTask::abort()
+{
+ if (m_dljob)
+ return m_dljob->abort();
+ return true;
+}
+
void Flame::FileResolvingTask::executeTask()
{
setStatus(tr("Resolving mod IDs..."));
diff --git a/launcher/modplatform/flame/FileResolvingTask.h b/launcher/modplatform/flame/FileResolvingTask.h
index 87981f0a..f71b87ce 100644
--- a/launcher/modplatform/flame/FileResolvingTask.h
+++ b/launcher/modplatform/flame/FileResolvingTask.h
@@ -13,6 +13,9 @@ public:
explicit FileResolvingTask(const shared_qobject_ptr<QNetworkAccessManager>& network, Flame::Manifest &toProcess);
virtual ~FileResolvingTask() {};
+ bool canAbort() const override { return true; }
+ bool abort() override;
+
const Flame::Manifest &getResults() const
{
return m_toProcess;
diff --git a/launcher/modplatform/flame/FlameCheckUpdate.cpp b/launcher/modplatform/flame/FlameCheckUpdate.cpp
index 68a4589b..8dd3a846 100644
--- a/launcher/modplatform/flame/FlameCheckUpdate.cpp
+++ b/launcher/modplatform/flame/FlameCheckUpdate.cpp
@@ -123,7 +123,7 @@ void FlameCheckUpdate::executeTask()
continue;
}
- setStatus(tr("Getting API response from CurseForge for '%1'").arg(mod->name()));
+ setStatus(tr("Getting API response from CurseForge for '%1'...").arg(mod->name()));
setProgress(i++, m_mods.size());
auto latest_ver = api.getLatestVersion({ mod->metadata()->project_id.toString(), m_game_versions, m_loaders });
@@ -145,7 +145,7 @@ void FlameCheckUpdate::executeTask()
if (latest_ver.downloadUrl.isEmpty() && latest_ver.fileId != mod->metadata()->file_id) {
auto pack = getProjectInfo(latest_ver);
auto recover_url = QString("%1/download/%2").arg(pack.websiteUrl, latest_ver.fileId.toString());
- emit checkFailed(mod, tr("Mod has a new update available, but is opted-out on CurseForge"), recover_url);
+ emit checkFailed(mod, tr("Mod has a new update available, but is not downloadable using CurseForge."), recover_url);
continue;
}
diff --git a/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp b/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp
index cac432cd..16013070 100644
--- a/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp
+++ b/