Improved bot detection slightly. This was meant to go along with the fix for amb1801.
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402473
This commit is contained in:
parent
c951a6ca7c
commit
1251093ec1
@ -451,6 +451,7 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername
|
||||
char error[255];
|
||||
const char *authid = engine->GetPlayerNetworkIDString(pEntity);
|
||||
pPlayer->Authorize(authid);
|
||||
pPlayer->m_bFakeClient = true;
|
||||
if (!OnClientConnect(pEntity, playername, "127.0.0.1", error, sizeof(error)))
|
||||
{
|
||||
/* :TODO: kick the bot if it's rejected */
|
||||
@ -1219,6 +1220,7 @@ CPlayer::CPlayer()
|
||||
m_bIsInKickQueue = false;
|
||||
m_LastPassword.clear();
|
||||
m_LangId = SOURCEMOD_LANGUAGE_ENGLISH;
|
||||
m_bFakeClient = false;
|
||||
}
|
||||
|
||||
void CPlayer::Initialize(const char *name, const char *ip, edict_t *pEntity)
|
||||
@ -1286,6 +1288,7 @@ void CPlayer::Disconnect()
|
||||
m_bAdminCheckSignalled = false;
|
||||
m_UserId = -1;
|
||||
m_bIsInKickQueue = false;
|
||||
m_bFakeClient = false;
|
||||
}
|
||||
|
||||
void CPlayer::SetName(const char *name)
|
||||
@ -1350,7 +1353,7 @@ IPlayerInfo *CPlayer::GetPlayerInfo()
|
||||
|
||||
bool CPlayer::IsFakeClient()
|
||||
{
|
||||
return (strncasecmp(m_AuthID.c_str(), "BOT", 3) == 0);
|
||||
return m_bFakeClient;
|
||||
}
|
||||
|
||||
void CPlayer::SetAdminId(AdminId id, bool temporary)
|
||||
|
@ -195,6 +195,7 @@ private:
|
||||
bool m_QueryLang;
|
||||
bool m_bIsListenServer;
|
||||
int m_ListenClient;
|
||||
bool m_bFakeClient;
|
||||
};
|
||||
|
||||
extern PlayerManager g_Players;
|
||||
|
Loading…
Reference in New Issue
Block a user