summaryrefslogtreecommitdiffstats
path: root/logic
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-11-27 01:50:38 +0100
committerPetr Mrázek <peterix@gmail.com>2013-11-27 01:50:38 +0100
commit7024e5a83e543a5e59e0c30ab72fe6ee5c5522f0 (patch)
tree2ba213505afd68678248eff30d45a09041a7a0f5 /logic
parentd6b09f7c139c73379976a9d179dd05b66afe13a6 (diff)
downloadMultiMC-7024e5a83e543a5e59e0c30ab72fe6ee5c5522f0.tar
MultiMC-7024e5a83e543a5e59e0c30ab72fe6ee5c5522f0.tar.gz
MultiMC-7024e5a83e543a5e59e0c30ab72fe6ee5c5522f0.tar.lz
MultiMC-7024e5a83e543a5e59e0c30ab72fe6ee5c5522f0.tar.xz
MultiMC-7024e5a83e543a5e59e0c30ab72fe6ee5c5522f0.zip
Fix for latest snapshot ``changes''
Diffstat (limited to 'logic')
-rw-r--r--logic/OneSixLibrary.cpp3
-rw-r--r--logic/OneSixLibrary.h2
-rw-r--r--logic/OneSixVersion.cpp2
-rw-r--r--logic/auth/AuthenticateTask.cpp50
4 files changed, 54 insertions, 3 deletions
diff --git a/logic/OneSixLibrary.cpp b/logic/OneSixLibrary.cpp
index df04a0c7..ad4aec44 100644
--- a/logic/OneSixLibrary.cpp
+++ b/logic/OneSixLibrary.cpp
@@ -141,7 +141,8 @@ QJsonObject OneSixLibrary::toJson()
if (m_hint.size())
libRoot.insert("MMC-hint", m_hint);
if (m_base_url != "http://s3.amazonaws.com/Minecraft.Download/libraries/" &&
- m_base_url != "https://s3.amazonaws.com/Minecraft.Download/libraries/")
+ m_base_url != "https://s3.amazonaws.com/Minecraft.Download/libraries/" &&
+ m_base_url != "https://libraries.minecraft.net/")
libRoot.insert("url", m_base_url);
if (isNative() && m_native_suffixes.size())
{
diff --git a/logic/OneSixLibrary.h b/logic/OneSixLibrary.h
index 3a772420..f8dc3aef 100644
--- a/logic/OneSixLibrary.h
+++ b/logic/OneSixLibrary.h
@@ -30,7 +30,7 @@ class OneSixLibrary
private:
// basic values used internally (so far)
QString m_name;
- QString m_base_url = "http://s3.amazonaws.com/Minecraft.Download/libraries/";
+ QString m_base_url = "https://libraries.minecraft.net/";
QList<std::shared_ptr<Rule>> m_rules;
// custom values
diff --git a/logic/OneSixVersion.cpp b/logic/OneSixVersion.cpp
index 4e2bbda5..cc5b1de1 100644
--- a/logic/OneSixVersion.cpp
+++ b/logic/OneSixVersion.cpp
@@ -151,7 +151,7 @@ std::shared_ptr<OneSixVersion> OneSixVersion::fromJson(QJsonObject root)
root.value("minimumLauncherVersion").toDouble();
// ADD MORE HERE :D
- if (launcher_ver > 0 && launcher_ver <= 10)
+ if (launcher_ver > 0 && launcher_ver <= 11)
return fromJsonV4(root, readVersion);
else
{
diff --git a/logic/auth/AuthenticateTask.cpp b/logic/auth/AuthenticateTask.cpp
index a9c2c03f..bf7a54f9 100644
--- a/logic/auth/AuthenticateTask.cpp
+++ b/logic/auth/AuthenticateTask.cpp
@@ -133,6 +133,7 @@ bool AuthenticateTask::processResponse(QJsonObject responseData)
// Put the list of profiles we loaded into the MojangAccount object.
getMojangAccount()->loadProfiles(loadedProfiles);
+
// Finally, we set the current profile to the correct value. This is pretty simple.
// We do need to make sure that the current profile that the server gave us
@@ -153,7 +154,55 @@ bool AuthenticateTask::processResponse(QJsonObject responseData)
QLOG_ERROR() << "Server specified a selected profile that wasn't in the available profiles list.";
return false;
}
+
+ /*
+public class User
+{
+ private String id;
+ private List<Property> properties;
+
+ public String getId()
+ {
+ return this.id;
+ }
+
+ public List<Property> getProperties() {
+ return this.properties;
+ }
+ public class Property {
+ private String name;
+ private String value;
+
+ public Property() { }
+ public String getKey() { return this.name; }
+
+ public String getValue()
+ {
+ return this.value;
+ }
+ }
+}
+*/
+ // this is what the vanilla launcher passes to the userProperties launch param
+ // doesn't seem to be used for anything so far? I don't get any of this data on my account
+ // (peterixxx)
+ // is it a good idea to log this?
+ if(responseData.contains("user"))
+ {
+ auto obj = responseData.value("user").toObject();
+ auto userId = obj.value("id").toString();
+ auto propArray = obj.value("properties").toArray();
+ QLOG_DEBUG() << "User ID: " << userId;
+ QLOG_DEBUG() << "User Properties: ";
+ for(auto prop: propArray)
+ {
+ auto propTuple = prop.toObject();
+ auto name = propTuple.value("name").toString();
+ auto value = propTuple.value("value").toString();
+ QLOG_DEBUG() << name << " : " << value;
+ }
+ }
// We've made it through the minefield of possible errors. Return true to indicate that we've succeeded.
QLOG_DEBUG() << "Finished reading authentication response.";
@@ -178,3 +227,4 @@ QString AuthenticateTask::getStateMessage(const YggdrasilTask::State state) cons
}
}
+