Fix for latest snapshot ``changes''

This commit is contained in:
Petr Mrázek 2013-11-27 01:50:38 +01:00
parent d6b09f7c13
commit 7024e5a83e
4 changed files with 54 additions and 3 deletions

View File

@ -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())
{

View File

@ -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

View File

@ -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
{

View File

@ -134,6 +134,7 @@ bool AuthenticateTask::processResponse(QJsonObject responseData)
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
// is actually in the available profiles list.
@ -154,6 +155,54 @@ bool AuthenticateTask::processResponse(QJsonObject responseData)
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
}
}