MCPcopy Create free account
hub / github.com/MultiMC/Launcher / saveState

Method saveState

launcher/minecraft/auth/AccountData.cpp:348–371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

346}
347
348QJsonObject AccountData::saveState() const {
349 QJsonObject output;
350 if(type == AccountType::Mojang) {
351 output["type"] = "Mojang";
352 if(legacy) {
353 output["legacy"] = true;
354 }
355 if(canMigrateToMSA) {
356 output["canMigrateToMSA"] = true;
357 }
358 }
359 else if (type == AccountType::MSA) {
360 output["type"] = "MSA";
361 tokenToJSONV3(output, msaToken, "msa");
362 tokenToJSONV3(output, userToken, "utoken");
363 tokenToJSONV3(output, xboxApiToken, "xrp-main");
364 tokenToJSONV3(output, mojangservicesToken, "xrp-mc");
365 }
366
367 tokenToJSONV3(output, yggdrasilToken, "ygg");
368 profileToJSONV3(output, minecraftProfile, "profile");
369 entitlementToJSONV3(output, minecraftEntitlement);
370 return output;
371}
372
373QString AccountData::userName() const {
374 if(type != AccountType::Mojang) {

Callers 1

saveToJsonMethod · 0.80

Calls 3

tokenToJSONV3Function · 0.85
profileToJSONV3Function · 0.85
entitlementToJSONV3Function · 0.85

Tested by

no test coverage detected