1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-22 12:47:44 +00:00
astra/launcher/core/include/patcher.h
Joshua Goins 3d32674663 Add game patching support
Yes it's finally here! It's been tested to update the game from the base
2012 version all the way up to patch 6.18. This also works across all
expansions, and the previous boot patches that were supported before.

However, the patcher dialog is in need of an update, as patching happens
on the same thread so the entire application freezes.
2022-07-20 18:00:42 -04:00

37 lines
No EOL
870 B
C++

#pragma once
#include <QString>
#include <QProgressDialog>
#include <QNetworkAccessManager>
// General-purpose patcher routine. It opens a nice dialog box, handles downloading
// and processing patches.
class Patcher : public QObject {
Q_OBJECT
public:
// isBoot is used for telling the patcher that you're reading boot patches, which for some reason has a different patchlist format.
Patcher(bool isBoot, QString baseDirectory);
void processPatchList(QNetworkAccessManager& mgr, QString patchList);
signals:
void done();
private:
void checkIfDone();
struct QueuedPatch {
QString name, repository, version, path;
};
void processPatch(QueuedPatch patch);
QVector<QueuedPatch> patchQueue;
bool isBoot = false;
QString baseDirectory;
QProgressDialog* dialog = nullptr;
int remainingPatches = -1;
};