diff options
author | Sefa Eyeoglu <contact@scrumplex.net> | 2023-08-04 19:42:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-04 19:42:36 +0200 |
commit | ae793f6cf11658c9abc5111e82d5ba7b3e6af127 (patch) | |
tree | ed41f30e2c0f02e4be1d42324b3f05fbab75b2cd /launcher/minecraft/auth/steps/MigrationEligibilityStep.cpp | |
parent | 50c7d39e082f0a7dbd977401e16d5adf534d9770 (diff) | |
parent | 1d638e018ac40fbfb35dd117f9a948c0cf35eadd (diff) | |
download | PrismLauncher-ae793f6cf11658c9abc5111e82d5ba7b3e6af127.tar.gz PrismLauncher-ae793f6cf11658c9abc5111e82d5ba7b3e6af127.tar.bz2 PrismLauncher-ae793f6cf11658c9abc5111e82d5ba7b3e6af127.zip |
Merge pull request #1459 from Scrumplex/format
Diffstat (limited to 'launcher/minecraft/auth/steps/MigrationEligibilityStep.cpp')
-rw-r--r-- | launcher/minecraft/auth/steps/MigrationEligibilityStep.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/launcher/minecraft/auth/steps/MigrationEligibilityStep.cpp b/launcher/minecraft/auth/steps/MigrationEligibilityStep.cpp index f5b5637a..5ce953df 100644 --- a/launcher/minecraft/auth/steps/MigrationEligibilityStep.cpp +++ b/launcher/minecraft/auth/steps/MigrationEligibilityStep.cpp @@ -5,37 +5,37 @@ #include "minecraft/auth/AuthRequest.h" #include "minecraft/auth/Parsers.h" -MigrationEligibilityStep::MigrationEligibilityStep(AccountData* data) : AuthStep(data) { - -} +MigrationEligibilityStep::MigrationEligibilityStep(AccountData* data) : AuthStep(data) {} MigrationEligibilityStep::~MigrationEligibilityStep() noexcept = default; -QString MigrationEligibilityStep::describe() { +QString MigrationEligibilityStep::describe() +{ return tr("Checking for migration eligibility."); } -void MigrationEligibilityStep::perform() { +void MigrationEligibilityStep::perform() +{ auto url = QUrl("https://api.minecraftservices.com/rollout/v1/msamigration"); QNetworkRequest request = QNetworkRequest(url); request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); request.setRawHeader("Authorization", QString("Bearer %1").arg(m_data->yggdrasilToken.token).toUtf8()); - AuthRequest *requestor = new AuthRequest(this); + AuthRequest* requestor = new AuthRequest(this); connect(requestor, &AuthRequest::finished, this, &MigrationEligibilityStep::onRequestDone); requestor->get(request); } -void MigrationEligibilityStep::rehydrate() { +void MigrationEligibilityStep::rehydrate() +{ // NOOP, for now. We only save bools and there's nothing to check. } -void MigrationEligibilityStep::onRequestDone( - QNetworkReply::NetworkError error, - QByteArray data, - QList<QNetworkReply::RawHeaderPair> headers -) { - auto requestor = qobject_cast<AuthRequest *>(QObject::sender()); +void MigrationEligibilityStep::onRequestDone(QNetworkReply::NetworkError error, + QByteArray data, + QList<QNetworkReply::RawHeaderPair> headers) +{ + auto requestor = qobject_cast<AuthRequest*>(QObject::sender()); requestor->deleteLater(); if (error == QNetworkReply::NoError) { |