summaryrefslogtreecommitdiffstats
path: root/logic/MinecraftProcess.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2014-01-27 03:00:49 +0100
committerPetr Mrázek <peterix@gmail.com>2014-01-27 03:00:49 +0100
commitffbc5bb62c0cd771b26cb1d9b5afdccef77075b4 (patch)
tree78b10cee3dc25acba02954aaf4f0e44ee4c295de /logic/MinecraftProcess.cpp
parentd7113de3bd3cb43b1bc68792cd27a716b012f2b5 (diff)
downloadMultiMC-ffbc5bb62c0cd771b26cb1d9b5afdccef77075b4.tar
MultiMC-ffbc5bb62c0cd771b26cb1d9b5afdccef77075b4.tar.gz
MultiMC-ffbc5bb62c0cd771b26cb1d9b5afdccef77075b4.tar.lz
MultiMC-ffbc5bb62c0cd771b26cb1d9b5afdccef77075b4.tar.xz
MultiMC-ffbc5bb62c0cd771b26cb1d9b5afdccef77075b4.zip
Offline mode can be used even when online.
Allow the user to pick a player name for offline mode. Big auth refactor. Now using session objects instead of the accounts themselves. Sessions only last for one instance start and hold all the auth and player data.
Diffstat (limited to 'logic/MinecraftProcess.cpp')
-rw-r--r--logic/MinecraftProcess.cpp26
1 files changed, 9 insertions, 17 deletions
diff --git a/logic/MinecraftProcess.cpp b/logic/MinecraftProcess.cpp
index 84610021..9c0a7074 100644
--- a/logic/MinecraftProcess.cpp
+++ b/logic/MinecraftProcess.cpp
@@ -79,26 +79,18 @@ void MinecraftProcess::setWorkdir(QString path)
QString MinecraftProcess::censorPrivateInfo(QString in)
{
- if(!m_account)
+ if(!m_session)
return in;
- 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 profileId = profile->id;
- QString profileName = profile->name;
- in.replace(profileId, "<PROFILE ID>");
- in.replace(profileName, "<PROFILE NAME>");
- }
+ if(m_session->session != "-")
+ in.replace(m_session->session, "<SESSION ID>");
+ in.replace(m_session->access_token, "<ACCESS TOKEN>");
+ in.replace(m_session->client_token, "<CLIENT TOKEN>");
+ in.replace(m_session->uuid, "<PROFILE ID>");
+ in.replace(m_session->player_name, "<PROFILE NAME>");
- auto i = m_account->user().properties.begin();
- while (i != m_account->user().properties.end())
+ auto i = m_session->u.properties.begin();
+ while (i != m_session->u.properties.end())
{
in.replace(i.value(), "<" + i.key().toUpper() + ">");
++i;