summaryrefslogtreecommitdiffstats
path: root/logic
diff options
context:
space:
mode:
Diffstat (limited to 'logic')
-rw-r--r--logic/net/LoginTask.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/logic/net/LoginTask.cpp b/logic/net/LoginTask.cpp
index 4098783b..5717aa9f 100644
--- a/logic/net/LoginTask.cpp
+++ b/logic/net/LoginTask.cpp
@@ -213,14 +213,16 @@ void LoginTask::yggdrasilLogin()
clientToken.remove('{');
clientToken.remove('}');
// create the request
- QString requestConstent;
- requestConstent += "{";
- requestConstent += " \"agent\":{\"name\":\"Minecraft\",\"version\":1},\n";
- requestConstent += " \"username\":\"" + uInfo.username + "\",\n";
- requestConstent += " \"password\":\"" + uInfo.password + "\",\n";
- requestConstent += " \"clientToken\":\"" + clientToken + "\"\n";
- requestConstent += "}";
- netReply = worker->post(netRequest, requestConstent.toUtf8());
+ QJsonObject root;
+ QJsonObject agent;
+ agent.insert("name", QString("Minecraft"));
+ agent.insert("version", QJsonValue(1));
+ root.insert("agent", agent);
+ root.insert("username", uInfo.username);
+ root.insert("password", uInfo.password);
+ root.insert("clientToken", clientToken);
+ QJsonDocument requestDoc(root);
+ netReply = worker->post(netRequest, requestDoc.toJson());
}
/*