diff options
author | Tayou <31988415+TayouVR@users.noreply.github.com> | 2023-08-07 10:32:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-07 10:32:38 +0200 |
commit | 9afa7cc91fd889b146c609c6a59f7f7b3d995d9f (patch) | |
tree | 20ef3bd30beedca4995875485e468ee323d52096 /launcher/minecraft/auth/steps/EntitlementsStep.cpp | |
parent | b572f75dbaad61cf305f1fd4f60ba94d74bfa3fa (diff) | |
parent | 75c7df46a7022a46d447bb96fbde619e5d65db05 (diff) | |
download | PrismLauncher-9afa7cc91fd889b146c609c6a59f7f7b3d995d9f.tar.gz PrismLauncher-9afa7cc91fd889b146c609c6a59f7f7b3d995d9f.tar.bz2 PrismLauncher-9afa7cc91fd889b146c609c6a59f7f7b3d995d9f.zip |
Merge branch 'develop' into icon-indexing
Signed-off-by: Tayou <31988415+TayouVR@users.noreply.github.com>
Diffstat (limited to 'launcher/minecraft/auth/steps/EntitlementsStep.cpp')
-rw-r--r-- | launcher/minecraft/auth/steps/EntitlementsStep.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/launcher/minecraft/auth/steps/EntitlementsStep.cpp b/launcher/minecraft/auth/steps/EntitlementsStep.cpp index bd604292..e942db52 100644 --- a/launcher/minecraft/auth/steps/EntitlementsStep.cpp +++ b/launcher/minecraft/auth/steps/EntitlementsStep.cpp @@ -11,12 +11,13 @@ EntitlementsStep::EntitlementsStep(AccountData* data) : AuthStep(data) {} EntitlementsStep::~EntitlementsStep() noexcept = default; -QString EntitlementsStep::describe() { +QString EntitlementsStep::describe() +{ return tr("Determining game ownership."); } - -void EntitlementsStep::perform() { +void EntitlementsStep::perform() +{ auto uuid = QUuid::createUuid(); m_entitlementsRequestId = uuid.toString().remove('{').remove('}'); auto url = "https://api.minecraftservices.com/entitlements/license?requestId=" + m_entitlementsRequestId; @@ -24,22 +25,20 @@ void EntitlementsStep::perform() { request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); request.setRawHeader("Accept", "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, &EntitlementsStep::onRequestDone); requestor->get(request); qDebug() << "Getting entitlements..."; } -void EntitlementsStep::rehydrate() { +void EntitlementsStep::rehydrate() +{ // NOOP, for now. We only save bools and there's nothing to check. } -void EntitlementsStep::onRequestDone( - QNetworkReply::NetworkError error, - QByteArray data, - QList<QNetworkReply::RawHeaderPair> headers -) { - auto requestor = qobject_cast<AuthRequest *>(QObject::sender()); +void EntitlementsStep::onRequestDone(QNetworkReply::NetworkError error, QByteArray data, QList<QNetworkReply::RawHeaderPair> headers) +{ + auto requestor = qobject_cast<AuthRequest*>(QObject::sender()); requestor->deleteLater(); qCDebug(authCredentials()) << data; |