2023-08-05 22:14:05 -04:00
|
|
|
// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2023-07-30 08:49:34 -04:00
|
|
|
#pragma once
|
|
|
|
|
2023-09-16 18:52:12 -04:00
|
|
|
#include <qcorotask.h>
|
|
|
|
|
2023-07-30 08:49:34 -04:00
|
|
|
#include "launchercore.h"
|
|
|
|
#include "patcher.h"
|
|
|
|
|
|
|
|
class SquareLauncher : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit SquareLauncher(LauncherCore &window, QObject *parent = nullptr);
|
|
|
|
|
2023-09-16 18:52:12 -04:00
|
|
|
using StoredInfo = std::pair<QString, QUrl>;
|
|
|
|
QCoro::Task<std::optional<StoredInfo>> getStored(const LoginInformation &info);
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-09-16 18:52:12 -04:00
|
|
|
QCoro::Task<> login(const LoginInformation &info);
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-09-16 18:52:12 -04:00
|
|
|
QCoro::Task<> registerSession(const LoginInformation &info);
|
2023-07-30 08:49:34 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
QString getBootHash(const LoginInformation &info);
|
|
|
|
|
|
|
|
Patcher *patcher = nullptr;
|
|
|
|
|
2023-09-16 18:52:12 -04:00
|
|
|
QString SID, username;
|
2023-07-30 08:49:34 -04:00
|
|
|
LoginAuth auth;
|
|
|
|
|
|
|
|
LauncherCore &window;
|
|
|
|
};
|