summaryrefslogtreecommitdiffstats
path: root/src/ClientHandle.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-10-15 13:41:23 +0200
committerMattes D <github@xoft.cz>2014-10-15 13:41:23 +0200
commitc6725f8d284c77b16f7e047e1c1b64d2e8f8a007 (patch)
tree2dce33529afbf410a91bbe7e341a3ec9c7d833b3 /src/ClientHandle.cpp
parentcWorld: Fixed scheduler. (diff)
downloadcuberite-c6725f8d284c77b16f7e047e1c1b64d2e8f8a007.tar
cuberite-c6725f8d284c77b16f7e047e1c1b64d2e8f8a007.tar.gz
cuberite-c6725f8d284c77b16f7e047e1c1b64d2e8f8a007.tar.bz2
cuberite-c6725f8d284c77b16f7e047e1c1b64d2e8f8a007.tar.lz
cuberite-c6725f8d284c77b16f7e047e1c1b64d2e8f8a007.tar.xz
cuberite-c6725f8d284c77b16f7e047e1c1b64d2e8f8a007.tar.zst
cuberite-c6725f8d284c77b16f7e047e1c1b64d2e8f8a007.zip
Diffstat (limited to 'src/ClientHandle.cpp')
-rw-r--r--src/ClientHandle.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index 3b677460b..b9adcc828 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -248,9 +248,12 @@ AString cClientHandle::GenerateOfflineUUID(const AString & a_Username)
// xxxxxxxx-xxxx-3xxx-yxxx-xxxxxxxxxxxx where x is any hexadecimal digit and y is one of 8, 9, A, or B
// Note that we generate a short UUID (without the dashes)
+ // First make the username lowercase:
+ AString lcUsername = StrToLower(a_Username);
+
// Generate an md5 checksum, and use it as base for the ID:
unsigned char MD5[16];
- md5((const unsigned char *)a_Username.c_str(), a_Username.length(), MD5);
+ md5((const unsigned char *)lcUsername.c_str(), lcUsername.length(), MD5);
MD5[6] &= 0x0f; // Need to trim to 4 bits only...
MD5[8] &= 0x0f; // ... otherwise %01x overflows into two chars
return Printf("%02x%02x%02x%02x%02x%02x3%01x%02x8%01x%02x%02x%02x%02x%02x%02x%02x",