Add offline mode support
This commit is contained in:
18
launcher/minecraft/auth/steps/OfflineStep.cpp
Normal file
18
launcher/minecraft/auth/steps/OfflineStep.cpp
Normal file
@ -0,0 +1,18 @@
|
||||
#include "OfflineStep.h"
|
||||
|
||||
#include "Application.h"
|
||||
|
||||
OfflineStep::OfflineStep(AccountData* data) : AuthStep(data) {};
|
||||
OfflineStep::~OfflineStep() noexcept = default;
|
||||
|
||||
QString OfflineStep::describe() {
|
||||
return tr("Creating offline account.");
|
||||
}
|
||||
|
||||
void OfflineStep::rehydrate() {
|
||||
// NOOP
|
||||
}
|
||||
|
||||
void OfflineStep::perform() {
|
||||
emit finished(AccountTaskState::STATE_WORKING, tr("Created offline account."));
|
||||
}
|
20
launcher/minecraft/auth/steps/OfflineStep.h
Normal file
20
launcher/minecraft/auth/steps/OfflineStep.h
Normal file
@ -0,0 +1,20 @@
|
||||
|
||||
#pragma once
|
||||
#include <QObject>
|
||||
|
||||
#include "QObjectPtr.h"
|
||||
#include "minecraft/auth/AuthStep.h"
|
||||
|
||||
#include <katabasis/DeviceFlow.h>
|
||||
|
||||
class OfflineStep : public AuthStep {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit OfflineStep(AccountData *data);
|
||||
virtual ~OfflineStep() noexcept;
|
||||
|
||||
void perform() override;
|
||||
void rehydrate() override;
|
||||
|
||||
QString describe() override;
|
||||
};
|
Reference in New Issue
Block a user