diff options
author | Petr Mrázek <peterix@gmail.com> | 2013-09-23 00:23:50 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2013-09-23 00:29:40 +0200 |
commit | 984c36e571aae45cdd55da2fb689538198aadd3c (patch) | |
tree | c703bca5c0bc1d3a24e9f11e7e2f788d774461af /logic/OneSixInstance.cpp | |
parent | eb4ed3734fb4841a9e0b49af912158151f76c93b (diff) | |
download | MultiMC-984c36e571aae45cdd55da2fb689538198aadd3c.tar MultiMC-984c36e571aae45cdd55da2fb689538198aadd3c.tar.gz MultiMC-984c36e571aae45cdd55da2fb689538198aadd3c.tar.lz MultiMC-984c36e571aae45cdd55da2fb689538198aadd3c.tar.xz MultiMC-984c36e571aae45cdd55da2fb689538198aadd3c.zip |
Implement basic yggdrasil auth.
No fancy login token saving involved.
Diffstat (limited to 'logic/OneSixInstance.cpp')
-rw-r--r-- | logic/OneSixInstance.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/logic/OneSixInstance.cpp b/logic/OneSixInstance.cpp index e22a8890..6e39b5b5 100644 --- a/logic/OneSixInstance.cpp +++ b/logic/OneSixInstance.cpp @@ -49,21 +49,19 @@ QString replaceTokensIn(QString text, QMap<QString, QString> with) return result; } -QStringList OneSixInstance::processMinecraftArgs(QString user, QString session) +QStringList OneSixInstance::processMinecraftArgs(LoginResponse response) { I_D(OneSixInstance); auto version = d->version; QString args_pattern = version->minecraftArguments; QMap<QString, QString> token_mapping; - token_mapping["auth_username"] = user; - token_mapping["auth_session"] = session; - // FIXME: user and player name are DIFFERENT! - token_mapping["auth_player_name"] = user; - // FIXME: WTF is this. I just plugged in a random UUID here. - token_mapping["auth_uuid"] = "7d4bacf0-fd62-11e2-b778-0800200c9a66"; // obviously fake. - - // this is for offline: + token_mapping["auth_username"] = response.username; + token_mapping["auth_session"] = response.session_id; + token_mapping["auth_player_name"] = response.player_name; + token_mapping["auth_uuid"] = response.player_id; + + // this is for offline?: /* map["auth_player_name"] = "Player"; map["auth_player_name"] = "00000000-0000-0000-0000-000000000000"; @@ -85,7 +83,7 @@ QStringList OneSixInstance::processMinecraftArgs(QString user, QString session) return parts; } -MinecraftProcess *OneSixInstance::prepareForLaunch(QString user, QString session) +MinecraftProcess *OneSixInstance::prepareForLaunch(LoginResponse response) { I_D(OneSixInstance); cleanupAfterRun(); @@ -142,7 +140,7 @@ MinecraftProcess *OneSixInstance::prepareForLaunch(QString user, QString session args << classPath; } args << version->mainClass; - args.append(processMinecraftArgs(user, session)); + args.append(processMinecraftArgs(response)); // create the process and set its parameters MinecraftProcess *proc = new MinecraftProcess(this); |