1
0

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
This commit is contained in:
faketruth
2012-03-09 13:42:28 +00:00
parent 11810e05e4
commit f43b65cf53
24 changed files with 224 additions and 71 deletions

View File

@@ -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