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

Method refresh

launcher/minecraft/auth/Yggdrasil.cpp:77–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77void Yggdrasil::refresh() {
78 start();
79 /*
80 * {
81 * "clientToken": "client identifier"
82 * "accessToken": "current access token to be refreshed"
83 * "selectedProfile": // specifying this causes errors
84 * {
85 * "id": "profile ID"
86 * "name": "profile name"
87 * }
88 * "requestUser": true/false // request the user structure
89 * }
90 */
91 QJsonObject req;
92 req.insert("clientToken", m_data->clientToken());
93 req.insert("accessToken", m_data->accessToken());
94 /*
95 {
96 auto currentProfile = m_account->currentProfile();
97 QJsonObject profile;
98 profile.insert("id", currentProfile->id());
99 profile.insert("name", currentProfile->name());
100 req.insert("selectedProfile", profile);
101 }
102 */
103 req.insert("requestUser", false);
104 QJsonDocument doc(req);
105
106 QUrl reqUrl = getBaseUrl() + "/refresh";
107 QByteArray requestData = doc.toJson();
108
109 sendRequest(reqUrl, requestData);
110}
111
112void Yggdrasil::login(QString password) {
113 start();

Callers 10

loginMethod · 0.45
directoryChangedMethod · 0.45
replaceMethod · 0.45
updateMethod · 0.45
tryNextMethod · 0.45
performMethod · 0.45
performMethod · 0.45
executeTaskMethod · 0.45
executeTaskMethod · 0.45
getFromMetadataMethod · 0.45

Calls 4

insertMethod · 0.80
clientTokenMethod · 0.80
toJsonMethod · 0.80
accessTokenMethod · 0.45

Tested by

no test coverage detected