summaryrefslogtreecommitdiffstats
path: root/src/ClientHandle.h
diff options
context:
space:
mode:
authordaniel0916 <theschokolps@gmail.com>2014-04-16 14:31:02 +0200
committerdaniel0916 <theschokolps@gmail.com>2014-04-16 14:31:02 +0200
commit5a9acb7eb6eef293dc53cfe916c74f5cfa069db4 (patch)
tree8e0b29c5f0240ac0961e69b905921243130d0258 /src/ClientHandle.h
parentFixed merge conflict (diff)
parentAttempted fix for the client crash with the new protocols. (diff)
downloadcuberite-5a9acb7eb6eef293dc53cfe916c74f5cfa069db4.tar
cuberite-5a9acb7eb6eef293dc53cfe916c74f5cfa069db4.tar.gz
cuberite-5a9acb7eb6eef293dc53cfe916c74f5cfa069db4.tar.bz2
cuberite-5a9acb7eb6eef293dc53cfe916c74f5cfa069db4.tar.lz
cuberite-5a9acb7eb6eef293dc53cfe916c74f5cfa069db4.tar.xz
cuberite-5a9acb7eb6eef293dc53cfe916c74f5cfa069db4.tar.zst
cuberite-5a9acb7eb6eef293dc53cfe916c74f5cfa069db4.zip
Diffstat (limited to '')
-rw-r--r--src/ClientHandle.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/ClientHandle.h b/src/ClientHandle.h
index f6d0af3b4..8bba0d27c 100644
--- a/src/ClientHandle.h
+++ b/src/ClientHandle.h
@@ -64,8 +64,22 @@ public:
cPlayer* GetPlayer() { 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; }
+
+ /** Generates an UUID based on the username stored for this client, and stores it in the m_UUID member.
+ 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.
+ Internally calls the GenerateOfflineUUID static function. */
+ void GenerateOfflineUUID(void);
+
+ /** 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. */
+ static AString GenerateOfflineUUID(const AString & a_Username); // tolua_export
+
void Kick(const AString & a_Reason); // tolua_export
- void Authenticate(void); // Called by cAuthenticator when the user passes authentication
+ void Authenticate(const AString & a_Name, const AString & a_UUID); // Called by cAuthenticator when the user passes authentication
void StreamChunks(void);
@@ -334,6 +348,7 @@ private:
static int s_ClientCount;
int m_UniqueID;
+ AString m_UUID;
/** Set to true when the chunk where the player is is sent to the client. Used for spawning the player */
bool m_HasSentPlayerChunk;