summaryrefslogtreecommitdiffstats
path: root/src/ClientHandle.h
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-06-21 22:13:35 +0200
committermadmaxoft <github@xoft.cz>2014-06-21 22:13:35 +0200
commit08fed2a213f40e963ef871664439d744faefffba (patch)
treeda4ef449fe2c19b46d2c32470869298ea45d492c /src/ClientHandle.h
parentRestored style continuity. (diff)
downloadcuberite-08fed2a213f40e963ef871664439d744faefffba.tar
cuberite-08fed2a213f40e963ef871664439d744faefffba.tar.gz
cuberite-08fed2a213f40e963ef871664439d744faefffba.tar.bz2
cuberite-08fed2a213f40e963ef871664439d744faefffba.tar.lz
cuberite-08fed2a213f40e963ef871664439d744faefffba.tar.xz
cuberite-08fed2a213f40e963ef871664439d744faefffba.tar.zst
cuberite-08fed2a213f40e963ef871664439d744faefffba.zip
Diffstat (limited to 'src/ClientHandle.h')
-rw-r--r--src/ClientHandle.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/ClientHandle.h b/src/ClientHandle.h
index 0d883f3af..3e18cbdad 100644
--- a/src/ClientHandle.h
+++ b/src/ClientHandle.h
@@ -63,7 +63,7 @@ public:
const AString & GetIPString(void) const { return m_IPString; }
- cPlayer* GetPlayer() { return m_Player; } // tolua_export
+ cPlayer * GetPlayer(void) { return m_Player; } // tolua_export
const AString & GetUUID(void) const { return m_UUID; } // tolua_export
void SetUUID(const AString & a_UUID) { m_UUID = a_UUID; }
@@ -76,9 +76,16 @@ public:
/** Generates an UUID based on the player name provided.
This is used for the offline (non-auth) mode, when there's no UUID source.
- Each username generates a unique and constant UUID, so that when the player reconnects with the same name, their UUID is the same. */
+ Each username generates a unique and constant UUID, so that when the player reconnects with the same name, their UUID is the same.
+ Returns a 36-char UUID (with dashes). */
static AString GenerateOfflineUUID(const AString & a_Username); // tolua_export
+ /** Returns true if the UUID is generated by online auth, false if it is an offline-generated UUID.
+ We use Version-3 UUIDs for offline UUIDs, online UUIDs are Version-4, thus we can tell them apart.
+ Accepts both 32-char and 36-char UUIDs (with and without dashes).
+ If the string given is not a valid UUID, returns false. */
+ static bool IsUUIDOnline(const AString & a_UUID); // tolua_export
+
/** Formats the type of message with the proper color and prefix for sending to the client. **/
static AString FormatMessageType(bool ShouldAppendChatPrefixes, eMessageType a_ChatPrefix, const AString & a_AdditionalData);