mirror of
https://github.com/UltimMC/Launcher.git
synced 2025-12-24 04:22:39 +00:00
UltimMC: Add our changes
This commit is contained in:
60
launcher/minecraft/launch/InjectAuthlib.h
Normal file
60
launcher/minecraft/launch/InjectAuthlib.h
Normal file
@@ -0,0 +1,60 @@
|
||||
#pragma once
|
||||
|
||||
#include <launch/LaunchStep.h>
|
||||
#include <QObjectPtr.h>
|
||||
#include <LoggedProcess.h>
|
||||
#include <java/JavaChecker.h>
|
||||
#include <net/Mode.h>
|
||||
#include <net/NetJob.h>
|
||||
|
||||
struct AuthlibInjector
|
||||
{
|
||||
QString javaArg;
|
||||
|
||||
AuthlibInjector(const QString arg)
|
||||
{
|
||||
javaArg = std::move(arg);
|
||||
qDebug() << "NEW INJECTOR" << javaArg;
|
||||
}
|
||||
};
|
||||
|
||||
typedef std::shared_ptr<AuthlibInjector> AuthlibInjectorPtr;
|
||||
|
||||
// FIXME: stupid. should be defined by the instance type? or even completely abstracted away...
|
||||
class InjectAuthlib : public LaunchStep
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
InjectAuthlib(LaunchTask *parent, AuthlibInjectorPtr *injector);
|
||||
virtual ~InjectAuthlib(){};
|
||||
|
||||
void executeTask() override;
|
||||
bool canAbort() const override;
|
||||
void proceed() override;
|
||||
|
||||
void setAuthServer(QString server)
|
||||
{
|
||||
m_authServer = server;
|
||||
};
|
||||
|
||||
void setOfflineMode(bool offline) {
|
||||
m_offlineMode = offline;
|
||||
}
|
||||
|
||||
public slots:
|
||||
bool abort() override;
|
||||
|
||||
private slots:
|
||||
void onVersionDownloadSucceeded();
|
||||
void onDownloadSucceeded();
|
||||
void onDownloadFailed(QString reason);
|
||||
|
||||
private:
|
||||
shared_qobject_ptr<NetJob> jobPtr;
|
||||
bool m_aborted = false;
|
||||
|
||||
bool m_offlineMode;
|
||||
QString m_versionName;
|
||||
QString m_authServer;
|
||||
AuthlibInjectorPtr *m_injector;
|
||||
};
|
||||
Reference in New Issue
Block a user