PDA

View Full Version : |Source| Source antispeed.



antoniofr
03/04/2015, 11:08 PM
STRUCT


struct SpeedPlayerSettings
{
DWORD m_Rate;
DWORD m_Count;
DWORD m_Time;
};

struct SpeedSettings
{
SpeedPlayerSettings Speed[5600];
int Switch;
int AutoBlock;
int AutoDisconnect;
int MaxHit;
int MaxDetectCount;
};




void SpeedSystem::CheckAttack(DWORD aIndex)
{
if(CSpeed.Switch != 0)
{
SYSTEMTIME Function;
GetSystemTime(&Function);

if(CSpeed.Speed[aIndex].m_Time == Function.wSecond && CSpeed.Speed[aIndex].m_Rate > CSpeed.MaxHit)
{
CSpeed.Speed[aIndex].m_Count++;
MsgSystem::Leftblue_All("[Sistema] %s atacando muito rápido.",lpObj[aIndex].Name);

if(CSpeed.Speed[aIndex].m_Count >= CSpeed.MaxDetectCount)
{
if(CSpeed.AutoBlock != 0)
{
MsgSystem::Leftblue_All("[Sistema] %s banido por uso de speed hacker.",lpObj[aIndex].Name);
Manager.ExecFormat("UPDATE Character set CtlCode=1 where Name='%s'",lpObj[aIndex].Name);
CloseClient(aIndex);
}
else if(CSpeed.AutoDisconnect != 0)
{
MsgSystem::Leftblue_All("[Sistema] %s desconectado por uso de speed hacker.",lpObj[aIndex].Name);
CloseClient(aIndex);
}
else
{
MsgSystem::Leftblue_All("[Sistema] %s Speed hacker detectado.",lpObj[aIndex].Name);
}
}
}
else
{
CSpeed.Speed[aIndex].m_Rate++;
}

if(CSpeed.Speed[aIndex].m_Time != Function.wSecond)
CSpeed.Speed[aIndex].m_Rate = 0;
CSpeed.Speed[aIndex].m_Time = Function.wSecond;
}
}


Protocol.cpp


case 0x1E:
{
if(aRecv[3] == 0x2B)
{
SpeedSystem::CheckAttack(aIndex);
}
}
break;


Créditos: antonio.fr / Função baseada em uma que foi postada na net , se alguém souber o nome do autor manda mp pra min coloca os créditos.