Clean up authlib-injector merge, mostly clang-format
Signed-off-by: Evan Goode <mail@evangoo.de>
This commit is contained in:
parent
afe33b9de5
commit
a980b4d537
@ -38,10 +38,10 @@
|
|||||||
#include <tools/BaseProfiler.h>
|
#include <tools/BaseProfiler.h>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
#include "minecraft/auth/MinecraftAccount.h"
|
|
||||||
#include "minecraft/launch/MinecraftServerTarget.h"
|
|
||||||
#include "minecraft/MinecraftInstance.h"
|
#include "minecraft/MinecraftInstance.h"
|
||||||
#include "minecraft/PackProfile.h"
|
#include "minecraft/PackProfile.h"
|
||||||
|
#include "minecraft/auth/MinecraftAccount.h"
|
||||||
|
#include "minecraft/launch/MinecraftServerTarget.h"
|
||||||
|
|
||||||
class InstanceWindow;
|
class InstanceWindow;
|
||||||
class LaunchController : public Task {
|
class LaunchController : public Task {
|
||||||
|
@ -533,18 +533,15 @@ QString MinecraftInstance::getLauncher()
|
|||||||
QStringList MinecraftInstance::processAuthArgs(AuthSessionPtr session) const
|
QStringList MinecraftInstance::processAuthArgs(AuthSessionPtr session) const
|
||||||
{
|
{
|
||||||
QStringList args;
|
QStringList args;
|
||||||
if(session->uses_custom_api_servers)
|
if (session->uses_custom_api_servers) {
|
||||||
{
|
|
||||||
args << "-Dminecraft.api.env=custom";
|
args << "-Dminecraft.api.env=custom";
|
||||||
args << "-Dminecraft.api.auth.host=" + session->auth_server_url;
|
args << "-Dminecraft.api.auth.host=" + session->auth_server_url;
|
||||||
args << "-Dminecraft.api.account.host=" + session->account_server_url;
|
args << "-Dminecraft.api.account.host=" + session->account_server_url;
|
||||||
args << "-Dminecraft.api.session.host=" + session->session_server_url;
|
args << "-Dminecraft.api.session.host=" + session->session_server_url;
|
||||||
args << "-Dminecraft.api.services.host=" + session->services_server_url;
|
args << "-Dminecraft.api.services.host=" + session->services_server_url;
|
||||||
auto agents = m_components->getProfile()->getAgents();
|
auto agents = m_components->getProfile()->getAgents();
|
||||||
for (auto agent : agents)
|
for (auto agent : agents) {
|
||||||
{
|
if (agent->library()->artifactPrefix() == "moe.yushi:authlibinjector") {
|
||||||
if (agent->library()->artifactPrefix() == "moe.yushi:authlibinjector")
|
|
||||||
{
|
|
||||||
QStringList jar, temp1, temp2, temp3;
|
QStringList jar, temp1, temp2, temp3;
|
||||||
agent->library()->getApplicableFiles(runtimeContext(), jar, temp1, temp2, temp3, getLocalLibraryPath());
|
agent->library()->getApplicableFiles(runtimeContext(), jar, temp1, temp2, temp3, getLocalLibraryPath());
|
||||||
QString argument{ agent->argument() };
|
QString argument{ agent->argument() };
|
||||||
@ -558,7 +555,6 @@ QStringList MinecraftInstance::processAuthArgs(AuthSessionPtr session) const
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return args;
|
return args;
|
||||||
}
|
}
|
||||||
|
@ -35,10 +35,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <unordered_set>
|
|
||||||
#include <java/JavaVersion.h>
|
#include <java/JavaVersion.h>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
|
#include <unordered_set>
|
||||||
#include "BaseInstance.h"
|
#include "BaseInstance.h"
|
||||||
#include "minecraft/launch/MinecraftServerTarget.h"
|
#include "minecraft/launch/MinecraftServerTarget.h"
|
||||||
#include "minecraft/mod/Mod.h"
|
#include "minecraft/mod/Mod.h"
|
||||||
|
@ -86,10 +86,7 @@ class MinecraftAccount : public QObject, public Usable {
|
|||||||
explicit MinecraftAccount(QObject* parent = 0);
|
explicit MinecraftAccount(QObject* parent = 0);
|
||||||
|
|
||||||
static MinecraftAccountPtr createFromUsername(const QString& username);
|
static MinecraftAccountPtr createFromUsername(const QString& username);
|
||||||
static MinecraftAccountPtr createFromUsernameAuthlibInjector(
|
static MinecraftAccountPtr createFromUsernameAuthlibInjector(const QString& username, const QString& authlibInjectorUrl);
|
||||||
const QString& username,
|
|
||||||
const QString& authlibInjectorUrl
|
|
||||||
);
|
|
||||||
|
|
||||||
static MinecraftAccountPtr createBlankMSA();
|
static MinecraftAccountPtr createBlankMSA();
|
||||||
|
|
||||||
@ -123,29 +120,17 @@ class MinecraftAccount : public QObject, public Usable {
|
|||||||
public: /* queries */
|
public: /* queries */
|
||||||
QString internalId() const { return data.internalId; }
|
QString internalId() const { return data.internalId; }
|
||||||
|
|
||||||
QString authlibInjectorUrl() const {
|
QString authlibInjectorUrl() const { return data.authlibInjectorUrl; }
|
||||||
return data.authlibInjectorUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString authServerUrl() const {
|
QString authServerUrl() const { return data.authServerUrl(); }
|
||||||
return data.authServerUrl();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString accountServerUrl() const {
|
QString accountServerUrl() const { return data.accountServerUrl(); }
|
||||||
return data.accountServerUrl();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString sessionServerUrl() const {
|
QString sessionServerUrl() const { return data.sessionServerUrl(); }
|
||||||
return data.sessionServerUrl();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString servicesServerUrl() const {
|
QString servicesServerUrl() const { return data.servicesServerUrl(); }
|
||||||
return data.servicesServerUrl();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool usesCustomApiServers() const {
|
bool usesCustomApiServers() const { return data.usesCustomApiServers(); }
|
||||||
return data.usesCustomApiServers();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString accountDisplayString() const { return data.accountDisplayString(); }
|
QString accountDisplayString() const { return data.accountDisplayString(); }
|
||||||
|
|
||||||
|
@ -25,8 +25,8 @@
|
|||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
#include "BuildConfig.h"
|
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
|
#include "BuildConfig.h"
|
||||||
|
|
||||||
Yggdrasil::Yggdrasil(AccountData* data, QObject* parent) : AccountTask(data, parent)
|
Yggdrasil::Yggdrasil(AccountData* data, QObject* parent) : AccountTask(data, parent)
|
||||||
{
|
{
|
||||||
|
@ -1,25 +1,21 @@
|
|||||||
#include "AuthlibInjector.h"
|
#include "AuthlibInjector.h"
|
||||||
|
|
||||||
#include "minecraft/auth/steps/YggdrasilStep.h"
|
|
||||||
#include "minecraft/auth/steps/MinecraftProfileStepMojang.h"
|
|
||||||
#include "minecraft/auth/steps/GetSkinStep.h"
|
|
||||||
#include "minecraft/auth/steps/AuthlibInjectorMetadataStep.h"
|
#include "minecraft/auth/steps/AuthlibInjectorMetadataStep.h"
|
||||||
|
#include "minecraft/auth/steps/GetSkinStep.h"
|
||||||
|
#include "minecraft/auth/steps/MinecraftProfileStepMojang.h"
|
||||||
|
#include "minecraft/auth/steps/YggdrasilStep.h"
|
||||||
|
|
||||||
AuthlibInjectorRefresh::AuthlibInjectorRefresh(
|
AuthlibInjectorRefresh::AuthlibInjectorRefresh(AccountData* data, QObject* parent) : AuthFlow(data, parent)
|
||||||
AccountData *data,
|
{
|
||||||
QObject *parent
|
|
||||||
) : AuthFlow(data, parent) {
|
|
||||||
m_steps.append(makeShared<YggdrasilStep>(m_data, QString()));
|
m_steps.append(makeShared<YggdrasilStep>(m_data, QString()));
|
||||||
m_steps.append(makeShared<MinecraftProfileStepMojang>(m_data));
|
m_steps.append(makeShared<MinecraftProfileStepMojang>(m_data));
|
||||||
m_steps.append(makeShared<AuthlibInjectorMetadataStep>(m_data));
|
m_steps.append(makeShared<AuthlibInjectorMetadataStep>(m_data));
|
||||||
m_steps.append(makeShared<GetSkinStep>(m_data));
|
m_steps.append(makeShared<GetSkinStep>(m_data));
|
||||||
}
|
}
|
||||||
|
|
||||||
AuthlibInjectorLogin::AuthlibInjectorLogin(
|
AuthlibInjectorLogin::AuthlibInjectorLogin(AccountData* data, QString password, QObject* parent)
|
||||||
AccountData *data,
|
: AuthFlow(data, parent), m_password(password)
|
||||||
QString password,
|
{
|
||||||
QObject *parent
|
|
||||||
): AuthFlow(data, parent), m_password(password) {
|
|
||||||
m_steps.append(makeShared<YggdrasilStep>(m_data, m_password));
|
m_steps.append(makeShared<YggdrasilStep>(m_data, m_password));
|
||||||
m_steps.append(makeShared<MinecraftProfileStepMojang>(m_data));
|
m_steps.append(makeShared<MinecraftProfileStepMojang>(m_data));
|
||||||
m_steps.append(makeShared<AuthlibInjectorMetadataStep>(m_data));
|
m_steps.append(makeShared<AuthlibInjectorMetadataStep>(m_data));
|
||||||
|
@ -1,25 +1,16 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "AuthFlow.h"
|
#include "AuthFlow.h"
|
||||||
|
|
||||||
class AuthlibInjectorRefresh : public AuthFlow
|
class AuthlibInjectorRefresh : public AuthFlow {
|
||||||
{
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit AuthlibInjectorRefresh(
|
explicit AuthlibInjectorRefresh(AccountData* data, QObject* parent = 0);
|
||||||
AccountData *data,
|
|
||||||
QObject *parent = 0
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class AuthlibInjectorLogin : public AuthFlow
|
class AuthlibInjectorLogin : public AuthFlow {
|
||||||
{
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit AuthlibInjectorLogin(
|
explicit AuthlibInjectorLogin(AccountData* data, QString password, QObject* parent = 0);
|
||||||
AccountData *data,
|
|
||||||
QString password,
|
|
||||||
QObject *parent = 0
|
|
||||||
);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_password;
|
QString m_password;
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
#include "QObjectPtr.h"
|
#include "QObjectPtr.h"
|
||||||
#include "minecraft/auth/AuthStep.h"
|
#include "minecraft/auth/AuthStep.h"
|
||||||
|
|
||||||
|
|
||||||
class AuthlibInjectorMetadataStep : public AuthStep {
|
class AuthlibInjectorMetadataStep : public AuthStep {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <minecraft/auth/MinecraftAccount.h>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QtNetwork/QtNetwork>
|
#include <QtNetwork/QtNetwork>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include "QObjectPtr.h"
|
#include "QObjectPtr.h"
|
||||||
#include "tasks/Task.h"
|
#include "tasks/Task.h"
|
||||||
#include <minecraft/auth/MinecraftAccount.h>
|
|
||||||
|
|
||||||
class CapeChange : public Task {
|
class CapeChange : public Task {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <minecraft/auth/MinecraftAccount.h>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QtNetwork/QtNetwork>
|
#include <QtNetwork/QtNetwork>
|
||||||
#include "tasks/Task.h"
|
#include "tasks/Task.h"
|
||||||
#include <minecraft/auth/MinecraftAccount.h>
|
|
||||||
|
|
||||||
typedef shared_qobject_ptr<class SkinDelete> SkinDeletePtr;
|
typedef shared_qobject_ptr<class SkinDelete> SkinDeletePtr;
|
||||||
|
|
||||||
|
@ -381,12 +381,7 @@ void VersionPage::on_actionChange_version_triggered()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto uid = list->uid();
|
auto uid = list->uid();
|
||||||
// FIXME: this is a horrible HACK. Get version filtering information from the actual metadata...
|
|
||||||
// unsure if the above comment still applies
|
|
||||||
if (uid == "moe.yushi.authlibinjector") {
|
|
||||||
on_actionInstall_AuthlibInjector_triggered();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
VersionSelectDialog vselect(list.get(), tr("Change %1 version").arg(name), this);
|
VersionSelectDialog vselect(list.get(), tr("Change %1 version").arg(name), this);
|
||||||
if (uid == "net.fabricmc.intermediary" || uid == "org.quiltmc.hashed") {
|
if (uid == "net.fabricmc.intermediary" || uid == "org.quiltmc.hashed") {
|
||||||
vselect.setEmptyString(tr("No intermediary mappings versions are currently available."));
|
vselect.setEmptyString(tr("No intermediary mappings versions are currently available."));
|
||||||
@ -428,8 +423,7 @@ void VersionPage::on_actionDownload_All_triggered()
|
|||||||
void VersionPage::openInstallAuthlibInjector()
|
void VersionPage::openInstallAuthlibInjector()
|
||||||
{
|
{
|
||||||
auto vlist = APPLICATION->metadataIndex()->get("moe.yushi.authlibinjector");
|
auto vlist = APPLICATION->metadataIndex()->get("moe.yushi.authlibinjector");
|
||||||
if(!vlist)
|
if (!vlist) {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
VersionSelectDialog vselect(vlist.get(), tr("Select authlib-injector version"), this);
|
VersionSelectDialog vselect(vlist.get(), tr("Select authlib-injector version"), this);
|
||||||
@ -437,13 +431,11 @@ void VersionPage::openInstallAuthlibInjector()
|
|||||||
vselect.setEmptyErrorString(tr("Couldn't load or download the authlib-injector version lists!"));
|
vselect.setEmptyErrorString(tr("Couldn't load or download the authlib-injector version lists!"));
|
||||||
|
|
||||||
auto currentVersion = m_profile->getComponentVersion("moe.yushi.authlibinjector");
|
auto currentVersion = m_profile->getComponentVersion("moe.yushi.authlibinjector");
|
||||||
if(!currentVersion.isEmpty())
|
if (!currentVersion.isEmpty()) {
|
||||||
{
|
|
||||||
vselect.setCurrentVersion(currentVersion);
|
vselect.setCurrentVersion(currentVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vselect.exec() && vselect.selectedVersion())
|
if (vselect.exec() && vselect.selectedVersion()) {
|
||||||
{
|
|
||||||
auto vsn = vselect.selectedVersion();
|
auto vsn = vselect.selectedVersion();
|
||||||
m_profile->setComponentVersion("moe.yushi.authlibinjector", vsn->descriptor());
|
m_profile->setComponentVersion("moe.yushi.authlibinjector", vsn->descriptor());
|
||||||
m_profile->resolve(Net::Mode::Online);
|
m_profile->resolve(Net::Mode::Online);
|
||||||
|
Loading…
Reference in New Issue
Block a user