43 TC_LOG_INFO(
"warden",
">> Warden disabled, loading checks skipped.");
51 TC_LOG_INFO(
"server.loading",
">> Loaded 0 Warden checks. DB table `warden_checks` is empty!");
55 Field* fields = result->Fetch();
62 result =
WorldDatabase.
Query(
"SELECT id, type, data, result, address, length, str, comment FROM warden_checks ORDER BY id ASC");
67 fields = result->Fetch();
72 std::string checkResult = fields[3].
GetString();
76 std::string comment = fields[7].
GetString();
79 wardenCheck->
Type = checkType;
88 int len = data.size() / 2;
95 std::reverse(temp, temp + len);
107 wardenCheck->
Address = address;
113 wardenCheck->
Str = str;
121 int len = checkResult.size() / 2;
125 memset(temp, 0, len);
127 std::reverse(temp, temp + len);
135 wardenCheck->
Comment =
"Undocumented Check";
137 wardenCheck->
Comment = comment;
141 while (result->NextRow());
143 TC_LOG_INFO(
"server.loading",
">> Loaded %u warden checks.", count);
void SetHexStr(char const *str)
Definition: BigNumber.cpp:69
uint8 Length
Definition: WardenCheckMgr.h:39
std::vector< uint16 > MemChecksIdPool
Definition: WardenCheckMgr.h:67
Definition: WardenCheckMgr.h:46
Class used to access individual fields of database query result.
Definition: Field.h:56
BigNumber Result
Definition: WardenCheckMgr.h:48
uint8 Type
Definition: WardenCheckMgr.h:36
WorldDatabaseWorkerPool WorldDatabase
Accessor to the world database.
Definition: DatabaseEnv.cpp:20
CheckContainer CheckStore
Definition: WardenCheckMgr.h:76
enum WardenActions Action
Definition: WardenCheckMgr.h:43
void SetBinary(uint8 const *bytes, int32 len)
Definition: BigNumber.cpp:57
#define sWorld
Definition: World.h:887
std::vector< uint16 > OtherChecksIdPool
Definition: WardenCheckMgr.h:68
std::string Comment
Definition: WardenCheckMgr.h:41
int32 GetNumBytes(void)
Definition: BigNumber.cpp:157
uint8 GetUInt8() const
Definition: Field.h:70
BigNumber Data
Definition: WardenCheckMgr.h:37
uint16 CheckId
Definition: WardenCheckMgr.h:42
uint32_t uint32
Definition: Define.h:150
WardenActions
Definition: WardenCheckMgr.h:27
std::shared_ptr< ResultSet > QueryResult
Definition: QueryResult.h:61
uint16_t uint16
Definition: Define.h:151
uint16 GetUInt16() const
Definition: Field.h:108
float length(float v)
Definition: vectorMath.h:208
QueryResult Query(const char *sql, T *connection=nullptr)
Definition: DatabaseWorkerPool.cpp:113
std::unique_ptr< uint8[]> AsByteArray(int32 minSize=0, bool littleEndian=true)
Definition: BigNumber.cpp:177
uint32 GetUInt32() const
Definition: Field.h:146
uint8_t uint8
Definition: Define.h:152
CheckResultContainer CheckResultStore
Definition: WardenCheckMgr.h:77
std::string Str
Definition: WardenCheckMgr.h:40
#define TC_LOG_INFO(filterType__,...)
Definition: Log.h:201
Definition: WardenCheckMgr.h:34
uint32 Address
Definition: WardenCheckMgr.h:38
std::string GetString() const
Definition: Field.h:276