mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Remove outdated anti-bot code
This commit is contained in:
parent
0369946156
commit
20d2d1fdd8
|
@ -1525,24 +1525,6 @@ void CGameContext::OnClientEnter(int ClientId)
|
||||||
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL | MSGFLAG_NORECORD, ClientId);
|
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL | MSGFLAG_NORECORD, ClientId);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
int Empty = -1;
|
|
||||||
for(int i = 0; i < MAX_CLIENTS; i++)
|
|
||||||
{
|
|
||||||
if(Server()->ClientSlotEmpty(i))
|
|
||||||
{
|
|
||||||
Empty = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
CNetMsg_Sv_Chat Msg;
|
|
||||||
Msg.m_Team = 0;
|
|
||||||
Msg.m_ClientId = Empty;
|
|
||||||
Msg.m_pMessage = "Do you know someone who uses a bot? Please report them to the moderators.";
|
|
||||||
m_apPlayers[ClientId]->m_EligibleForFinishCheck = time_get();
|
|
||||||
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL | MSGFLAG_NORECORD, ClientId);
|
|
||||||
}
|
|
||||||
|
|
||||||
IServer::CClientInfo Info;
|
IServer::CClientInfo Info;
|
||||||
if(Server()->GetClientInfo(ClientId, &Info) && Info.m_GotDDNetVersion)
|
if(Server()->GetClientInfo(ClientId, &Info) && Info.m_GotDDNetVersion)
|
||||||
{
|
{
|
||||||
|
@ -2093,18 +2075,6 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
||||||
void CGameContext::OnSayNetMessage(const CNetMsg_Cl_Say *pMsg, int ClientId, const CUnpacker *pUnpacker)
|
void CGameContext::OnSayNetMessage(const CNetMsg_Cl_Say *pMsg, int ClientId, const CUnpacker *pUnpacker)
|
||||||
{
|
{
|
||||||
CPlayer *pPlayer = m_apPlayers[ClientId];
|
CPlayer *pPlayer = m_apPlayers[ClientId];
|
||||||
bool Check = !pPlayer->m_NotEligibleForFinish && pPlayer->m_EligibleForFinishCheck + 10 * time_freq() >= time_get();
|
|
||||||
if(Check && str_comp(pMsg->m_pMessage, "xd sure chillerbot.png is lyfe") == 0 && pMsg->m_Team == 0)
|
|
||||||
{
|
|
||||||
if(m_TeeHistorianActive)
|
|
||||||
{
|
|
||||||
m_TeeHistorian.RecordPlayerMessage(ClientId, pUnpacker->CompleteData(), pUnpacker->CompleteSize());
|
|
||||||
}
|
|
||||||
|
|
||||||
pPlayer->m_NotEligibleForFinish = true;
|
|
||||||
dbg_msg("hack", "bot detected, cid=%d", ClientId);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
int Team = pMsg->m_Team;
|
int Team = pMsg->m_Team;
|
||||||
|
|
||||||
// trim right and set maximum length to 256 utf8-characters
|
// trim right and set maximum length to 256 utf8-characters
|
||||||
|
|
|
@ -140,7 +140,6 @@ void CPlayer::Reset()
|
||||||
m_FirstVoteTick = Now;
|
m_FirstVoteTick = Now;
|
||||||
|
|
||||||
m_NotEligibleForFinish = false;
|
m_NotEligibleForFinish = false;
|
||||||
m_EligibleForFinishCheck = 0;
|
|
||||||
m_VotedForPractice = false;
|
m_VotedForPractice = false;
|
||||||
m_SwapTargetsClientId = -1;
|
m_SwapTargetsClientId = -1;
|
||||||
m_BirthdayAnnounced = false;
|
m_BirthdayAnnounced = false;
|
||||||
|
|
|
@ -222,7 +222,6 @@ public:
|
||||||
std::shared_ptr<CScorePlayerResult> m_ScoreQueryResult;
|
std::shared_ptr<CScorePlayerResult> m_ScoreQueryResult;
|
||||||
std::shared_ptr<CScorePlayerResult> m_ScoreFinishResult;
|
std::shared_ptr<CScorePlayerResult> m_ScoreFinishResult;
|
||||||
bool m_NotEligibleForFinish;
|
bool m_NotEligibleForFinish;
|
||||||
int64_t m_EligibleForFinishCheck;
|
|
||||||
bool m_VotedForPractice;
|
bool m_VotedForPractice;
|
||||||
int m_SwapTargetsClientId; //Client ID of the swap target for the given player
|
int m_SwapTargetsClientId; //Client ID of the swap target for the given player
|
||||||
bool m_BirthdayAnnounced;
|
bool m_BirthdayAnnounced;
|
||||||
|
|
Loading…
Reference in a new issue