Jump to content
×
×
  • Create New...
  • 0

anti wait hack problem


DerBooy

Question

I made this like the tutorial here in metin2dev

 

bool IS_SPEED_HACK(LPCHARACTER ch, LPCHARACTER victim, DWORD current_time)
{
    if (ch->m_kAttackLog.dwVID == victim->GetVID())
    {
        if (current_time - ch->m_kAttackLog.dwTime < GET_ATTACK_SPEED(ch))
        {
            INCREASE_SPEED_HACK_COUNT(ch);
 
            if (test_server)
            {
                sys_log(0, "%s attack hack! time (delta, limit)=(%u, %u) hack_count %d",
                        ch->GetName(),
                        current_time - ch->m_kAttackLog.dwTime,
                        GET_ATTACK_SPEED(ch),
                        ch->m_speed_hack_count);
 
                ch->ChatPacket(CHAT_TYPE_INFO, "%s attack hack! time (delta, limit)=(%u, %u) hack_count %d",
                        ch->GetName(),
                        current_time - ch->m_kAttackLog.dwTime,
                        GET_ATTACK_SPEED(ch),
                        ch->m_speed_hack_count);
            }
 
            SET_ATTACK_TIME(ch, victim, current_time);
            SET_ATTACKED_TIME(ch, victim, current_time);
            return true;
        }
    }
 
    SET_ATTACK_TIME(ch, victim, current_time);
 
    if (victim->m_AttackedLog.dwPID == ch->GetPlayerID())
    {
        if (current_time - victim->m_AttackedLog.dwAttackedTime < GET_ATTACK_SPEED(ch))
        {
            INCREASE_SPEED_HACK_COUNT(ch);
            if (ch->m_speed_hack_count > 100)
            {
#ifdef ENABLE_SYSLOG_NOTICE
                sys_log(0, "%s Attack Speed HACK! time (delta, limit)=(%u, %u), hack_count = %d",
                        ch->GetName(),
                        current_time - victim->m_AttackedLog.dwAttackedTime,
                        GET_ATTACK_SPEED(ch),
                        ch->m_speed_hack_count);
#endif
#ifdef ENABLE_SYSCHAT_NOTICE
                ch->ChatPacket(CHAT_TYPE_INFO, "A hack was detected , close it!",
                        ch->GetName(),
                        current_time - victim->m_AttackedLog.dwAttackedTime,
                        GET_ATTACK_SPEED(ch),
                        ch->m_speed_hack_count);
#endif             
#ifdef ENABLE_BAN_WAITHACK              
                DBManager::instance().Query("INSERT INTO log.wait_hack SET login='%s', nickname='%s', ip='%s', time=NOW(), map_index=%d, server='%s';",
      ch->GetDesc()->GetAccountTable().login, ch->GetName(), ch->GetDesc()->GetHostName(), ch->GetMapIndex(), g_stHostname.c_str());
#endif
                ch->GetDesc()->DelayedDisconnect(3);
            }
             
            SET_ATTACKED_TIME(ch, victim, current_time);
            return true;
        }
    }
 
    SET_ATTACKED_TIME(ch, victim, current_time);
    return false;
}

 

Problem: Some of my Players ingame attacked in slow motion after a while and I dont know how to fix it.

Link to comment
Share on other sites

  • Answers 0
  • Created
  • Last Reply

Top Posters For This Question

Popular Days

Top Posters For This Question

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.