51 Field* fields = result->Fetch();
56 m_knownAddons.push_back(
SavedAddon(name, crc));
60 while (result->NextRow());
65 TC_LOG_INFO(
"server.loading",
">> Loaded 0 known addons. DB table `addons` is empty!");
68 result =
CharacterDatabase.
Query(
"SELECT id, name, version, UNIX_TIMESTAMP(timestamp) FROM banned_addons");
76 Field* fields = result->Fetch();
79 addon.
Id = fields[0].
GetUInt32() + dbcMaxBannedAddon;
83 std::string version = fields[2].
GetString();
85 MD5(reinterpret_cast<uint8 const*>(name.c_str()), name.length(), addon.
NameMD5);
86 MD5(reinterpret_cast<uint8 const*>(version.c_str()), version.length(), addon.
VersionMD5);
88 m_bannedAddons.push_back(addon);
92 while (result->NextRow());
uint8 VersionMD5[MD5_DIGEST_LENGTH]
Definition: AddonMgr.h:55
Definition: AddonMgr.h:40
uint32 Timestamp
Definition: AddonMgr.h:56
Class used to access individual fields of database query result.
Definition: Field.h:56
uint32 getMSTime()
Definition: Timer.h:24
uint32_t uint32
Definition: Define.h:150
std::shared_ptr< ResultSet > QueryResult
Definition: QueryResult.h:61
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
Definition: Timer.h:42
QueryResult Query(const char *sql, T *connection=nullptr)
Definition: DatabaseWorkerPool.cpp:113
uint8 NameMD5[MD5_DIGEST_LENGTH]
Definition: AddonMgr.h:54
uint32 GetUInt32() const
Definition: Field.h:146
CharacterDatabaseWorkerPool CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21
#define TC_LOG_INFO(filterType__,...)
Definition: Log.h:201
uint32_t uint32
Definition: g3dmath.h:168
DBCStorage< BannedAddOnsEntry > sBannedAddOnsStore(BannedAddOnsfmt)
uint32 Id
Definition: AddonMgr.h:53
std::string GetString() const
Definition: Field.h:276
Definition: AddonMgr.h:51