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

Method saveState

launcher/minecraft/auth/AccountData.cpp:396–425  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

394}
395
396QJsonObject AccountData::saveState() const {
397 QJsonObject output;
398 if(type == AccountType::Mojang) {
399 output["type"] = "Mojang";
400 if(legacy) {
401 output["legacy"] = true;
402 }
403 if(canMigrateToMSA) {
404 output["canMigrateToMSA"] = true;
405 }
406 }
407 else if (type == AccountType::MSA) {
408 output["type"] = "MSA";
409 output["msa-client-id"] = msaClientID;
410 tokenToJSONV3(output, msaToken, "msa");
411 tokenToJSONV3(output, userToken, "utoken");
412 tokenToJSONV3(output, xboxApiToken, "xrp-main");
413 tokenToJSONV3(output, mojangservicesToken, "xrp-mc");
414 } else if (type == AccountType::AuthlibInjector) {
415 output["type"] = "Authlib-Injector";
416 output["authlibInjectorUrl"] = authlibInjectorBaseUrl;
417 } else if (type == AccountType::Offline) {
418 output["type"] = "Offline";
419 }
420
421 tokenToJSONV3(output, yggdrasilToken, "ygg");
422 profileToJSONV3(output, minecraftProfile, "profile");
423 entitlementToJSONV3(output, minecraftEntitlement);
424 return output;
425}
426
427QString AccountData::userName() const {
428 if(type == AccountType::MSA) {

Callers 1

saveToJsonMethod · 0.80

Calls 3

tokenToJSONV3Function · 0.85
profileToJSONV3Function · 0.85
entitlementToJSONV3Function · 0.85

Tested by

no test coverage detected