Skip to content

Commit

Permalink
Fix duplicated maiev scan in debug (#2706)
Browse files Browse the repository at this point in the history
  • Loading branch information
0blu authored Jul 26, 2024
1 parent 743e80a commit aec344b
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/game/Anticheat/WardenAnticheat/Warden.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -415,12 +415,7 @@ void Warden::EncryptData(uint8* buffer, size_t size)

void Warden::BeginTimeoutClock()
{
#ifdef _DEBUG
m_timeoutClock = 0;
#else
// we will expect a reply eventually
m_timeoutClock = WorldTimer::getMSTime() + IN_MILLISECONDS * sWorld.getConfig(CONFIG_UINT32_AC_WARDEN_CLIENT_RESPONSE_DELAY);
#endif
m_timeoutClock = WorldTimer::getMSTime() + (IN_MILLISECONDS * sWorld.getConfig(CONFIG_UINT32_AC_WARDEN_CLIENT_RESPONSE_DELAY));
}

void Warden::StopTimeoutClock()
Expand All @@ -435,7 +430,7 @@ bool Warden::TimeoutClockStarted() const

void Warden::BeginScanClock()
{
m_scanClock = WorldTimer::getMSTime() + 1000 * sWorld.getConfig(CONFIG_UINT32_AC_WARDEN_SCAN_FREQUENCY);
m_scanClock = WorldTimer::getMSTime() + (IN_MILLISECONDS * sWorld.getConfig(CONFIG_UINT32_AC_WARDEN_SCAN_FREQUENCY));
}

void Warden::StopScanClock()
Expand Down Expand Up @@ -680,12 +675,14 @@ void Warden::Update()
}
}

#ifndef _DEBUG // Ignore timeout when in debug mode (we might single step though code, which takes a long time)
if (!!m_timeoutClock && WorldTimer::getMSTime() > m_timeoutClock)
{
sLog.OutWarden(this, LOG_LVL_BASIC, "Client response timeout. Kicking.");
KickSession();
return;
}
#endif

if (m_pendingScans.empty())
{
Expand Down

0 comments on commit aec344b

Please sign in to comment.