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:
@@ -619,14 +619,14 @@ const AString & cServer::GetServerID(void) const
|
||||
|
||||
|
||||
|
||||
void cServer::KickUser(const AString & iUserName, const AString & iReason)
|
||||
void cServer::KickUser(int a_ClientID, const AString & a_Reason)
|
||||
{
|
||||
cCSLock Lock(m_CSClients);
|
||||
for (ClientList::iterator itr = m_Clients.begin(); itr != m_Clients.end(); ++itr)
|
||||
{
|
||||
if ((*itr)->GetUsername() == iUserName)
|
||||
if ((*itr)->GetUniqueID() == a_ClientID)
|
||||
{
|
||||
(*itr)->Kick(iReason);
|
||||
(*itr)->Kick(a_Reason);
|
||||
}
|
||||
} // for itr - m_Clients[]
|
||||
}
|
||||
@@ -635,12 +635,12 @@ void cServer::KickUser(const AString & iUserName, const AString & iReason)
|
||||
|
||||
|
||||
|
||||
void cServer::AuthenticateUser(const AString & iUserName)
|
||||
void cServer::AuthenticateUser(int a_ClientID)
|
||||
{
|
||||
cCSLock Lock(m_CSClients);
|
||||
for (ClientList::iterator itr = m_Clients.begin(); itr != m_Clients.end(); ++itr)
|
||||
{
|
||||
if ((*itr)->GetUsername() == iUserName)
|
||||
if ((*itr)->GetUniqueID() == a_ClientID)
|
||||
{
|
||||
(*itr)->Authenticate();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user