From f43b65cf53274d1bbb43e2041ce72ff9eb68a7c8 Mon Sep 17 00:00:00 2001 From: faketruth Date: Fri, 9 Mar 2012 13:42:28 +0000 Subject: cClientHandles have a unique ID now to distinguish them cAuthenticator uses unique client ID for authentication Changed the kick function used by cAuthenticator to take a client ID instead of name, so the correct user is kicked Using callback reference instead of pointer in GetChunkData and affiliates GetChunkData returns false when failed, and true when succeeded Renamed entity type enums to something prettier Exposed some functions to Lua git-svn-id: http://mc-server.googlecode.com/svn/trunk@388 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cClientHandle.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'source/cClientHandle.h') diff --git a/source/cClientHandle.h b/source/cClientHandle.h index 6ac6e07b8..65a4e5db8 100644 --- a/source/cClientHandle.h +++ b/source/cClientHandle.h @@ -78,7 +78,7 @@ public: cPlayer* GetPlayer() { return m_Player; } // tolua_export - void Kick(const AString & a_Reason); //tolua_export + void Kick(const AString & a_Reason); //tolua_export void Authenticate(void); // Called by cAuthenticator when the user passes authentication void StreamChunks(void); @@ -100,11 +100,13 @@ public: void Send(const cPacket & a_Packet, ENUM_PRIORITY a_Priority = E_PRIORITY_NORMAL) { Send(&a_Packet, a_Priority); } void Send(const cPacket * a_Packet, ENUM_PRIORITY a_Priority = E_PRIORITY_NORMAL); - const AString & GetUsername(void) const; + const AString & GetUsername(void) const; //tolua_export - inline short GetPing() { return m_Ping; } + inline short GetPing() const { return m_Ping; } //tolua_export - void SetViewDistance(int a_ViewDistance); + void SetViewDistance(int a_ViewDistance); //tolua_export + + int GetUniqueID() const { return m_UniqueID; } //tolua_export private: @@ -212,6 +214,8 @@ private: virtual void GetOutgoingData(AString & a_Data) override; // Data can be sent to client virtual void SocketClosed (void) override; // The socket has been closed for any reason + static int s_ClientCount; + int m_UniqueID; }; // tolua_export -- cgit v1.2.3