diff options
author | Petr Mrázek <peterix@gmail.com> | 2021-08-20 01:34:32 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2021-08-20 01:34:32 +0200 |
commit | 1b68d51da634ddab39fe872fcc28a4f491c0c8a4 (patch) | |
tree | 9a22465d682018830635a8929eab3cc8482b1faa /launcher/minecraft/auth/flows | |
parent | 94fd9a3535ae9a55c228720858292ed2bb69ff98 (diff) | |
download | PrismLauncher-1b68d51da634ddab39fe872fcc28a4f491c0c8a4.tar.gz PrismLauncher-1b68d51da634ddab39fe872fcc28a4f491c0c8a4.tar.bz2 PrismLauncher-1b68d51da634ddab39fe872fcc28a4f491c0c8a4.zip |
NOISSUE add setting capes, tweak missing profile message, fix cape IDs
Diffstat (limited to 'launcher/minecraft/auth/flows')
-rw-r--r-- | launcher/minecraft/auth/flows/AuthContext.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/launcher/minecraft/auth/flows/AuthContext.cpp b/launcher/minecraft/auth/flows/AuthContext.cpp index d6a72208..9754d1a9 100644 --- a/launcher/minecraft/auth/flows/AuthContext.cpp +++ b/launcher/minecraft/auth/flows/AuthContext.cpp @@ -576,7 +576,9 @@ void AuthContext::onXBoxProfileDone( } void AuthContext::checkResult() { + qDebug() << "AuthContext::checkResult called"; if(m_requestsDone != 2) { + qDebug() << "Number of ready results:" << m_requestsDone; return; } if(m_mcAuthSucceeded && m_xboxProfileSucceeded) { @@ -638,10 +640,9 @@ bool parseMinecraftProfile(QByteArray & data, MinecraftProfile &output) { break; } auto capesArray = obj.value("capes").toArray(); - int i = -1; - int currentCape = -1; + + QString currentCape; for(auto cape: capesArray) { - i++; auto capeObj = cape.toObject(); Cape capeOut; if(!getString(capeObj.value("id"), capeOut.id)) { @@ -652,7 +653,7 @@ bool parseMinecraftProfile(QByteArray & data, MinecraftProfile &output) { continue; } if(state == "ACTIVE") { - currentCape = i; + currentCape = capeOut.id; } if(!getString(capeObj.value("url"), capeOut.url)) { continue; @@ -661,8 +662,7 @@ bool parseMinecraftProfile(QByteArray & data, MinecraftProfile &output) { continue; } - // we deal with only the active skin - output.capes.push_back(capeOut); + output.capes[capeOut.id] = capeOut; } output.currentCape = currentCape; output.validity = Katabasis::Validity::Certain; @@ -692,18 +692,18 @@ void AuthContext::onMinecraftProfileDone(int, QNetworkReply::NetworkError error, if (error == QNetworkReply::ContentNotFoundError) { m_data->minecraftProfile = MinecraftProfile(); finishActivity(); - changeState(STATE_FAILED_HARD, tr("Account is missing a profile")); + changeState(STATE_FAILED_HARD, tr("Account is missing a Minecraft Java profile.\n\nWhile the Microsoft account is valid, it does not own the game.\n\nYou might own Bedrock on this account, but that does not give you access to Java currently.")); return; } if (error != QNetworkReply::NoError) { finishActivity(); - changeState(STATE_FAILED_HARD, tr("Profile acquisition failed")); + changeState(STATE_FAILED_HARD, tr("Minecraft Java profile acquisition failed.")); return; } if(!parseMinecraftProfile(data, m_data->minecraftProfile)) { m_data->minecraftProfile = MinecraftProfile(); finishActivity(); - changeState(STATE_FAILED_HARD, tr("Profile response could not be parsed")); + changeState(STATE_FAILED_HARD, tr("Minecraft Java profile response could not be parsed")); return; } doGetSkin(); |