diff options
author | madmaxoft <github@xoft.cz> | 2014-07-30 14:09:30 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-07-30 14:09:30 +0200 |
commit | 85d64d291a6d11df6689190268c1f4c6b1c02cdd (patch) | |
tree | ff57299fbc0dcff1c5a69ee22510ed90b3f72320 /src/Protocol/MojangAPI.cpp | |
parent | ManualBindings: Fixed alignment. (diff) | |
download | cuberite-85d64d291a6d11df6689190268c1f4c6b1c02cdd.tar cuberite-85d64d291a6d11df6689190268c1f4c6b1c02cdd.tar.gz cuberite-85d64d291a6d11df6689190268c1f4c6b1c02cdd.tar.bz2 cuberite-85d64d291a6d11df6689190268c1f4c6b1c02cdd.tar.lz cuberite-85d64d291a6d11df6689190268c1f4c6b1c02cdd.tar.xz cuberite-85d64d291a6d11df6689190268c1f4c6b1c02cdd.tar.zst cuberite-85d64d291a6d11df6689190268c1f4c6b1c02cdd.zip |
Diffstat (limited to 'src/Protocol/MojangAPI.cpp')
-rw-r--r-- | src/Protocol/MojangAPI.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/Protocol/MojangAPI.cpp b/src/Protocol/MojangAPI.cpp index 52afd71da..86ff134db 100644 --- a/src/Protocol/MojangAPI.cpp +++ b/src/Protocol/MojangAPI.cpp @@ -233,9 +233,14 @@ bool cMojangAPI::SecureRequest(const AString & a_ServerName, const AString & a_R AString cMojangAPI::MakeUUIDShort(const AString & a_UUID) { + // Note: we only check the string's length, not the actual content switch (a_UUID.size()) { - case 32: return a_UUID; + case 32: + { + // Already is a short UUID + return a_UUID; + } case 36: { @@ -260,12 +265,18 @@ AString cMojangAPI::MakeUUIDShort(const AString & a_UUID) AString cMojangAPI::MakeUUIDDashed(const AString & a_UUID) { + // Note: we only check the string's length, not the actual content switch (a_UUID.size()) { - case 36: return a_UUID; + case 36: + { + // Already is a dashed UUID + return a_UUID; + } case 32: { + // Insert dashes at the proper positions: AString res; res.reserve(36); res.append(a_UUID, 0, 8); |