| 428 | } |
| 429 | |
| 430 | bool parseRolloutResponse(QByteArray& data, bool& result) |
| 431 | { |
| 432 | qDebug() << "Parsing Rollout response..."; |
| 433 | qCDebug(authCredentials()) << data; |
| 434 | |
| 435 | QJsonParseError jsonError; |
| 436 | QJsonDocument doc = QJsonDocument::fromJson(data, &jsonError); |
| 437 | if (jsonError.error) { |
| 438 | qWarning() << "Failed to parse response from https://api.minecraftservices.com/rollout/v1/msamigration as JSON: " |
| 439 | << jsonError.errorString(); |
| 440 | return false; |
| 441 | } |
| 442 | |
| 443 | auto obj = doc.object(); |
| 444 | QString feature; |
| 445 | if (!getString(obj.value("feature"), feature)) { |
| 446 | qWarning() << "Rollout feature is not a string"; |
| 447 | return false; |
| 448 | } |
| 449 | if (feature != "msamigration") { |
| 450 | qWarning() << "Rollout feature is not what we expected (msamigration), but is instead \"" << feature << "\""; |
| 451 | return false; |
| 452 | } |
| 453 | if (!getBool(obj.value("rollout"), result)) { |
| 454 | qWarning() << "Rollout feature is not a string"; |
| 455 | return false; |
| 456 | } |
| 457 | return true; |
| 458 | } |
| 459 | |
| 460 | bool parseMojangResponse(QByteArray& data, Token& output) |
| 461 | { |
nothing calls this directly
no test coverage detected