1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-23 04:57:44 +00:00
astra/launcher/include/gamerunner.h

34 lines
No EOL
1.2 KiB
C++

#pragma once
#include <QObject>
#include <QProcess>
class LauncherCore;
class Profile;
class LoginAuth;
class GameRunner : public QObject
{
public:
explicit GameRunner(LauncherCore &launcher, QObject *parent = nullptr);
/// Begins the game executable, but calls to Dalamud if needed.
void beginGameExecutable(Profile &settings, const LoginAuth &auth);
private:
/// Starts a vanilla game session with no Dalamud injection.
void beginVanillaGame(const QString &gameExecutablePath, Profile &profile, const LoginAuth &auth);
/// Starts a game session with Dalamud injected.
void beginDalamudGame(const QString &gameExecutablePath, Profile &profile, const LoginAuth &auth);
/// Returns the game arguments needed to properly launch the game. This encrypts it too if needed, and it's already joined!
QString getGameArgs(const Profile &profile, const LoginAuth &auth);
/// This wraps it in wine if needed.
void launchExecutable(const Profile &settings, QProcess *process, const QStringList &args, bool isGame, bool needsRegistrySetup);
void addRegistryKey(const Profile &settings, QString key, QString value, QString data);
LauncherCore &m_launcher;
};