Re-add base64 decode option for Qt versions that support it
This commit is contained in:
parent
e56f0db11b
commit
a0bafa4952
@ -213,8 +213,8 @@ bool parseMinecraftProfile(QByteArray & data, MinecraftProfile &output) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
// these skin URLs are for the MHF_Steve and MHF_Alex accounts (made by a Mojang employee)
|
// these skin URLs are for the MHF_Steve and MHF_Alex accounts (made by a Mojang employee)
|
||||||
// they are needed because the session server doesn't return skin urls for default skins
|
// they are needed because the session server doesn't return skin urls for default skins
|
||||||
static const QString SKIN_URL_STEVE = "http://textures.minecraft.net/texture/1a4af718455d4aab528e7a61f86fa25e6a369d1768dcb13f7df319a713eb810b";
|
static const QString SKIN_URL_STEVE = "http://textures.minecraft.net/texture/1a4af718455d4aab528e7a61f86fa25e6a369d1768dcb13f7df319a713eb810b";
|
||||||
static const QString SKIN_URL_ALEX = "http://textures.minecraft.net/texture/83cee5ca6afcdb171285aa00e8049c297b2dbeba0efb8ff970a5677a1b644032";
|
static const QString SKIN_URL_ALEX = "http://textures.minecraft.net/texture/83cee5ca6afcdb171285aa00e8049c297b2dbeba0efb8ff970a5677a1b644032";
|
||||||
|
|
||||||
@ -307,7 +307,11 @@ bool parseMinecraftProfileMojang(QByteArray & data, MinecraftProfile &output) {
|
|||||||
|
|
||||||
auto value = pObj.value("value");
|
auto value = pObj.value("value");
|
||||||
if (value.isString()) {
|
if (value.isString()) {
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
|
||||||
|
texturePayload = QByteArray::fromBase64(value.toString().toUtf8(), QByteArray::AbortOnBase64DecodingErrors);
|
||||||
|
#else
|
||||||
texturePayload = QByteArray::fromBase64(value.toString().toUtf8());
|
texturePayload = QByteArray::fromBase64(value.toString().toUtf8());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!texturePayload.isEmpty()) {
|
if (!texturePayload.isEmpty()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user