diff options
author | Petr Mrázek <peterix@gmail.com> | 2013-10-23 02:08:39 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2013-10-23 02:08:39 +0200 |
commit | c8b84257ae6bd45573beabac0fd8c4313436f3c9 (patch) | |
tree | b4e8c0a389a6f83fe6649d7e88eb690342f5d2d2 /logic | |
parent | c65bab6efec27d7b0654609798f77dd617d33d2d (diff) | |
download | MultiMC-c8b84257ae6bd45573beabac0fd8c4313436f3c9.tar MultiMC-c8b84257ae6bd45573beabac0fd8c4313436f3c9.tar.gz MultiMC-c8b84257ae6bd45573beabac0fd8c4313436f3c9.tar.lz MultiMC-c8b84257ae6bd45573beabac0fd8c4313436f3c9.tar.xz MultiMC-c8b84257ae6bd45573beabac0fd8c4313436f3c9.zip |
Actually use QJson for Yggdrasil requests
Diffstat (limited to 'logic')
-rw-r--r-- | logic/net/LoginTask.cpp | 18 |
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()); } /* |