| 220 | static const QString SKIN_URL_ALEX = "http://textures.minecraft.net/texture/83cee5ca6afcdb171285aa00e8049c297b2dbeba0efb8ff970a5677a1b644032"; |
| 221 | |
| 222 | bool isDefaultModelSteve(QString uuid) { |
| 223 | // need to calculate *Java* hashCode of UUID |
| 224 | // if number is even, skin/model is steve, otherwise it is alex |
| 225 | |
| 226 | // just in case dashes are in the id |
| 227 | uuid.remove('-'); |
| 228 | |
| 229 | if (uuid.size() != 32) { |
| 230 | return true; |
| 231 | } |
| 232 | |
| 233 | // qulonglong is guaranteed to be 64 bits |
| 234 | // we need to use unsigned numbers to guarantee truncation below |
| 235 | qulonglong most = uuid.left(16).toULongLong(nullptr, 16); |
| 236 | qulonglong least = uuid.right(16).toULongLong(nullptr, 16); |
| 237 | qulonglong xored = most ^ least; |
| 238 | return ((static_cast<quint32>(xored >> 32)) ^ static_cast<quint32>(xored)) % 2 == 0; |
| 239 | } |
| 240 | } |
| 241 | |
| 242 | /** |
no test coverage detected