40 {
42
44 if (!result)
45 {
46 LOG_WARN(
"server.loading",
">> Loaded 0 known addons. DB table `addons` is empty!");
48 return;
49 }
50
52
53 do
54 {
55 Field* fields = result->Fetch();
56
57 std::string name = fields[0].
Get<std::string>();
59
60 m_knownAddons.emplace_back(name, crc);
61
62 ++count;
63 } while (result->NextRow());
64
67
69 result =
CharacterDatabase.Query(
"SELECT id, name, version, UNIX_TIMESTAMP(timestamp) FROM banned_addons");
70
71 if (result)
72 {
75
76 do
77 {
78 Field* fields = result->Fetch();
79
84
86
87 ++count2;
88 } while (result->NextRow());
89
92 }
93 }
#define LOG_INFO(filterType__,...)
Definition: Log.h:165
#define LOG_WARN(filterType__,...)
Definition: Log.h:161
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
Definition: Timer.h:131
uint32 getMSTime()
Definition: Timer.h:103
std::uint32_t uint32
Definition: Define.h:107
std::shared_ptr< ResultSet > QueryResult
Definition: DatabaseEnvFwd.h:27
DatabaseWorkerPool< CharacterDatabaseConnection > CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21
BannedAddonList m_bannedAddons
Definition: AddonMgr.cpp:36
static Digest GetDigestOf(uint8 const *data, std::size_t len)
Definition: CryptoHash.h:48
Class used to access individual fields of database query result.
Definition: Field.h:98
std::enable_if_t< std::is_arithmetic_v< T >, T > Get() const
Definition: Field.h:112