Core/Warden: Ignore the length value in the database for MEM_CHECK checks. Hi there Aokromes.

This commit is contained in:
Treeston
2020-08-20 18:34:09 +02:00
parent a3971ca4b0
commit fc32c3fd3b
3 changed files with 9 additions and 6 deletions

View File

@@ -0,0 +1,2 @@
--
UPDATE `warden_checks` SET `length`=NULL WHERE `type`=243;

View File

@@ -82,10 +82,10 @@ void WardenCheckMgr::LoadWardenChecks()
_checkResults.emplace(id, fields[3].GetBinary());
if (type == MEM_CHECK || type == PAGE_CHECK_A || type == PAGE_CHECK_B || type == PROC_CHECK)
{
wardenCheck.Address = fields[4].GetUInt32();
if (type == PAGE_CHECK_A || type == PAGE_CHECK_B || type == PROC_CHECK)
wardenCheck.Length = fields[5].GetUInt8();
}
// PROC_CHECK support missing
if (type == MEM_CHECK || type == MPQ_CHECK || type == LUA_STR_CHECK || type == DRIVER_CHECK || type == MODULE_CHECK)

View File

@@ -186,7 +186,7 @@ void WardenWin::RequestChecks()
for (WardenCheckCategory category : EnumUtils::Iterate<WardenCheckCategory>())
{
auto& [checks, checksIt] = _checks[category];
if (checksIt == checks.end())
if ((checksIt == checks.end()) && !checks.empty())
{
TC_LOG_DEBUG("warden", "Finished all %s checks, re-shuffling", EnumUtils::ToConstant(category));
Trinity::Containers::RandomShuffle(checks);
@@ -242,7 +242,7 @@ void WardenWin::RequestChecks()
{
buff << uint8(0x00);
buff << uint32(check.Address);
buff << uint8(check.Length);
buff << uint8(sWardenCheckMgr->GetCheckResult(id).size());
break;
}
case PAGE_CHECK_A:
@@ -376,11 +376,12 @@ void WardenWin::HandleCheckResult(ByteBuffer &buff)
continue;
}
WardenCheckResult const& expected = sWardenCheckMgr->GetCheckResult(id);
std::vector<uint8> response;
response.resize(check.Length);
response.resize(expected.size());
buff.read(response.data(), response.size());
WardenCheckResult const& expected = sWardenCheckMgr->GetCheckResult(id);
if (response != expected)
{
TC_LOG_DEBUG("warden", "RESULT MEM_CHECK fail CheckId %u account Id %u", id, _session->GetAccountId());