From bbd17b6224ea1cbccbe602a123b828b20ec5619f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sat, 14 Dec 2013 01:18:54 +0100 Subject: Fix twitch --- logic/OneSixInstance.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'logic/OneSixInstance.cpp') diff --git a/logic/OneSixInstance.cpp b/logic/OneSixInstance.cpp index 337830a2..fd41b9e5 100644 --- a/logic/OneSixInstance.cpp +++ b/logic/OneSixInstance.cpp @@ -152,8 +152,17 @@ QStringList OneSixInstance::processMinecraftArgs(MojangAccountPtr account) token_mapping["game_directory"] = absRootDir; QString absAssetsDir = QDir("assets/").absolutePath(); token_mapping["game_assets"] = reconstructAssets(d->version).absolutePath(); - //TODO: this is something new and not even fully implemented in the vanilla launcher. - token_mapping["user_properties"] = "{ }"; + + auto user = account->user(); + QJsonObject userAttrs; + for(auto key: user.properties.keys()) + { + auto array = QJsonArray::fromStringList(user.properties.values(key)); + userAttrs.insert(key, array); + } + QJsonDocument value(userAttrs); + + token_mapping["user_properties"] = value.toJson(QJsonDocument::Compact); token_mapping["user_type"] = account->currentProfile()->legacy ? "legacy" : "mojang"; // 1.7.3+ assets tokens token_mapping["assets_root"] = absAssetsDir; -- cgit v1.2.3