From 17a94b16ea6207fd5f38fbd309b4db0d92de0d31 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Wed, 30 Jul 2014 13:52:51 +0200 Subject: MojangAPI: Implemented UUID shortening and dashing. --- src/ClientHandle.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/ClientHandle.h') diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 50ed596d5..f2183a5ca 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -66,7 +66,9 @@ public: cPlayer * GetPlayer(void) { return m_Player; } // tolua_export + /** Returns the player's UUID, as used by the protocol, in the short form (no dashes) */ const AString & GetUUID(void) const { return m_UUID; } // tolua_export + void SetUUID(const AString & a_UUID) { m_UUID = a_UUID; } const Json::Value & GetProperties(void) const { return m_Properties; } @@ -80,7 +82,7 @@ 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. - Returns a 36-char UUID (with dashes). */ + Returns a 32-char UUID (no 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. @@ -360,7 +362,11 @@ private: int m_NumBlockChangeInteractionsThisTick; static int s_ClientCount; + + /** ID used for identification during authenticating. Assigned sequentially for each new instance. */ int m_UniqueID; + + /** Contains the UUID used by Mojang to identify the player's account. Short UUID stored here (without dashes) */ AString m_UUID; /** Set to true when the chunk where the player is is sent to the client. Used for spawning the player */ -- cgit v1.2.3