MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / onRequestDone

Method onRequestDone

launcher/minecraft/auth/steps/XboxProfileStep.cpp:49–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49void XboxProfileStep::onRequestDone(
50 QNetworkReply::NetworkError error,
51 QByteArray data,
52 QList<QNetworkReply::RawHeaderPair> headers
53) {
54 auto requestor = qobject_cast<AuthRequest *>(QObject::sender());
55 requestor->deleteLater();
56
57 if (error != QNetworkReply::NoError) {
58 qWarning() << "Reply error:" << error;
59#ifndef NDEBUG
60 qDebug() << data;
61#endif
62 if (Net::isApplicationError(error)) {
63 emit finished(
64 AccountTaskState::STATE_FAILED_SOFT,
65 tr("Failed to retrieve the Xbox profile: %1").arg(requestor->errorString_)
66 );
67 }
68 else {
69 emit finished(
70 AccountTaskState::STATE_OFFLINE,
71 tr("Failed to retrieve the Xbox profile: %1").arg(requestor->errorString_)
72 );
73 }
74 return;
75 }
76
77#ifndef NDEBUG
78 qDebug() << "XBox profile: " << data;
79#endif
80
81 emit finished(AccountTaskState::STATE_WORKING, tr("Got Xbox profile"));
82}

Callers

nothing calls this directly

Calls 1

isApplicationErrorFunction · 0.85

Tested by

no test coverage detected