Add warden documentation to ban reason

This commit is contained in:
Joni
2012-04-16 18:41:31 +02:00
parent 413cfac953
commit a8ae4cf1e3
3 changed files with 14 additions and 3 deletions

View File

@@ -187,7 +187,9 @@ std::string Warden::Penalty(WardenCheck* check /*= NULL*/)
duration << sWorld->getIntConfig(CONFIG_WARDEN_CLIENT_BAN_DURATION) << "s";
std::string accountName;
AccountMgr::GetName(_session->GetAccountId(), accountName);
sWorld->BanAccount(BAN_ACCOUNT, accountName, duration.str(), "Warden Anticheat violation","Server");
std::stringstream banReason;
banReason << "Warden Anticheat Violation: " << check->Comment << " (CheckId: " << check->CheckId << ")";
sWorld->BanAccount(BAN_ACCOUNT, accountName, duration.str(), banReason.str(),"Server");
return "Ban";
break;

View File

@@ -63,8 +63,8 @@ void WardenCheckMgr::LoadWardenChecks()
CheckStore.resize(maxCheckId + 1);
// 0 1 2 3 4 5 6
result = WorldDatabase.Query("SELECT id, type, data, result, address, length, str FROM warden_checks ORDER BY id ASC");
// 0 1 2 3 4 5 6 7
result = WorldDatabase.Query("SELECT id, type, data, result, address, length, str, comment FROM warden_checks ORDER BY id ASC");
uint32 count = 0;
do
@@ -78,9 +78,11 @@ void WardenCheckMgr::LoadWardenChecks()
uint32 address = fields[4].GetUInt32();
uint8 length = fields[5].GetUInt8();
std::string str = fields[6].GetString();
std::string comment = fields[7].GetString();
WardenCheck* wardenCheck = new WardenCheck();
wardenCheck->Type = checkType;
wardenCheck->CheckId = id;
// Initialize action with default action from config
wardenCheck->Action = WardenActions(sWorld->getIntConfig(CONFIG_WARDEN_CLIENT_FAIL_ACTION));
@@ -134,6 +136,11 @@ void WardenCheckMgr::LoadWardenChecks()
CheckResultStore[id] = wr;
}
if (comment.empty())
wardenCheck->Comment = "Undocumented Check";
else
wardenCheck->Comment = comment;
++count;
}
while (result->NextRow());

View File

@@ -36,6 +36,8 @@ struct WardenCheck
uint32 Address; // PROC_CHECK, MEM_CHECK, PAGE_CHECK
uint8 Length; // PROC_CHECK, MEM_CHECK, PAGE_CHECK
std::string Str; // LUA, MPQ, DRIVER
std::string Comment;
uint16 CheckId;
enum WardenActions Action;
};