diff options
author | Petr Mrázek <peterix@gmail.com> | 2013-12-05 02:39:52 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2013-12-05 02:39:52 +0100 |
commit | f028aa76bc5d28b7fc4d1ea4e194895690e9944e (patch) | |
tree | 5157fb0c4675c7f6f14c3947ab685f3b87d45610 /logic/MinecraftProcess.cpp | |
parent | 613699b3626aea750093ab7eaaeccaa28c0e87c6 (diff) | |
download | MultiMC-f028aa76bc5d28b7fc4d1ea4e194895690e9944e.tar MultiMC-f028aa76bc5d28b7fc4d1ea4e194895690e9944e.tar.gz MultiMC-f028aa76bc5d28b7fc4d1ea4e194895690e9944e.tar.lz MultiMC-f028aa76bc5d28b7fc4d1ea4e194895690e9944e.tar.xz MultiMC-f028aa76bc5d28b7fc4d1ea4e194895690e9944e.zip |
Offline mode support, part 1
Refactor MojangAccount so it exposes a less generic interface and supports login. Hide the ugly details.
Yggdrasil tasks are now only used from MojangAccount.
Diffstat (limited to 'logic/MinecraftProcess.cpp')
-rw-r--r-- | logic/MinecraftProcess.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/logic/MinecraftProcess.cpp b/logic/MinecraftProcess.cpp index 5d99bfae..209929b7 100644 --- a/logic/MinecraftProcess.cpp +++ b/logic/MinecraftProcess.cpp @@ -75,20 +75,22 @@ QString MinecraftProcess::censorPrivateInfo(QString in) { if(!m_account) return in; - else + + QString sessionId = m_account->sessionId(); + QString accessToken = m_account->accessToken(); + QString clientToken = m_account->clientToken(); + in.replace(sessionId, "<SESSION ID>"); + in.replace(accessToken, "<ACCESS TOKEN>"); + in.replace(clientToken, "<CLIENT TOKEN>"); + auto profile = m_account->currentProfile(); + if(profile) { - QString sessionId = m_account->sessionId(); - QString accessToken = m_account->accessToken(); - QString clientToken = m_account->clientToken(); - QString profileId = m_account->currentProfile()->id(); - QString profileName = m_account->currentProfile()->name(); - in.replace(sessionId, "<SESSION ID>"); - in.replace(accessToken, "<ACCESS TOKEN>"); - in.replace(clientToken, "<CLIENT TOKEN>"); + QString profileId = profile->id; + QString profileName = profile->name; in.replace(profileId, "<PROFILE ID>"); in.replace(profileName, "<PROFILE NAME>"); - return in; } + return in; } // console window |