Improved bot detection slightly. This was meant to go along with the fix for amb1801.

--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402472
This commit is contained in:
Scott Ehlert 2008-08-24 04:32:06 +00:00
parent 39c3ad0194
commit 18bec9f901
3 changed files with 5 additions and 3 deletions

View File

@ -162,8 +162,6 @@ private:
c -= (unsigned)'a';
assert(c >= 0 && c < 26);
if (!g_Admins.FindFlag(key, &g_FlagLetters[c]))
{
ParseError(states, "Unrecognized admin level \"%s\"", key);

View File

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

View File

@ -105,6 +105,7 @@ private:
int m_iIndex;
unsigned int m_LangId;
int m_UserId;
bool m_bFakeClient;
};
class PlayerManager :