MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / parseRolloutResponse

Function parseRolloutResponse

launcher/minecraft/auth/Parsers.cpp:430–458  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

428}
429
430bool 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
460bool parseMojangResponse(QByteArray& data, Token& output)
461{

Callers

nothing calls this directly

Calls 5

getStringFunction · 0.85
getBoolFunction · 0.85
errorStringMethod · 0.80
objectMethod · 0.80
valueMethod · 0.80

Tested by

no test coverage detected