117 TC_LOG_INFO(
"server.loading",
"Loading guilds definitions...");
124 "g.BackgroundColor, g.info, g.motd, g.createdate, g.BankMoney, g.level, COUNT(gbt.guildid) "
125 "FROM guild g LEFT JOIN guild_bank_tab gbt ON g.guildid = gbt.guildid GROUP BY g.guildid ORDER BY g.guildid ASC");
129 TC_LOG_INFO(
"server.loading",
">> Loaded 0 guild definitions. DB table `guild` is empty.");
137 Field* fields = result->Fetch();
150 while (result->NextRow());
157 TC_LOG_INFO(
"server.loading",
"Loading guild ranks...");
169 TC_LOG_INFO(
"server.loading",
">> Loaded 0 guild ranks. DB table `guild_rank` is empty.");
176 Field* fields = result->Fetch();
184 while (result->NextRow());
191 TC_LOG_INFO(
"server.loading",
"Loading guild members...");
200 QueryResult result =
CharacterDatabase.
Query(
"SELECT gm.guildid, gm.guid, rank, pnote, offnote, w.tab0, w.tab1, w.tab2, w.tab3, w.tab4, w.tab5, "
202 "w.tab6, w.tab7, w.money, c.name, c.level, c.class, c.gender, c.zone, c.account, c.logout_time "
203 "FROM guild_member gm "
204 "LEFT JOIN guild_member_withdraw w ON gm.guid = w.guid "
205 "LEFT JOIN characters c ON c.guid = gm.guid ORDER BY gm.guildid ASC");
208 TC_LOG_INFO(
"server.loading",
">> Loaded 0 guild members. DB table `guild_member` is empty.");
215 Field* fields = result->Fetch();
223 while (result->NextRow());
230 TC_LOG_INFO(
"server.loading",
"Loading bank tab rights...");
242 TC_LOG_INFO(
"server.loading",
">> Loaded 0 guild bank tab rights. DB table `guild_bank_right` is empty.");
249 Field* fields = result->Fetch();
257 while (result->NextRow());
264 TC_LOG_INFO(
"server.loading",
"Loading guild event logs...");
271 QueryResult result =
CharacterDatabase.
Query(
"SELECT guildid, LogGuid, EventType, PlayerGuid1, PlayerGuid2, NewRank, TimeStamp FROM guild_eventlog ORDER BY TimeStamp DESC, LogGuid DESC");
275 TC_LOG_INFO(
"server.loading",
">> Loaded 0 guild event logs. DB table `guild_eventlog` is empty.");
282 Field* fields = result->Fetch();
290 while (result->NextRow());
297 TC_LOG_INFO(
"server.loading",
"Loading guild bank event logs...");
305 QueryResult result =
CharacterDatabase.
Query(
"SELECT guildid, TabId, LogGuid, EventType, PlayerGuid, ItemOrMoney, ItemStackCount, DestTabId, TimeStamp FROM guild_bank_eventlog ORDER BY TimeStamp DESC, LogGuid DESC");
309 TC_LOG_INFO(
"server.loading",
">> Loaded 0 guild bank event logs. DB table `guild_bank_eventlog` is empty.");
316 Field* fields = result->Fetch();
324 while (result->NextRow());
331 TC_LOG_INFO(
"server.loading",
"Loading Guild News...");
338 QueryResult result =
CharacterDatabase.
Query(
"SELECT guildid, LogGuid, EventType, PlayerGuid, Flags, Value, Timestamp FROM guild_newslog ORDER BY TimeStamp DESC, LogGuid DESC");
341 TC_LOG_INFO(
"server.loading",
">> Loaded 0 guild event logs. DB table `guild_newslog` is empty.");
347 Field* fields = result->Fetch();
355 while (result->NextRow());
363 TC_LOG_INFO(
"server.loading",
"Loading guild bank tabs...");
375 TC_LOG_INFO(
"server.loading",
">> Loaded 0 guild bank tabs. DB table `guild_bank_tab` is empty.");
382 Field* fields = result->Fetch();
390 while (result->NextRow());
397 TC_LOG_INFO(
"guild",
"Filling bank tabs with items...");
412 TC_LOG_INFO(
"server.loading",
">> Loaded 0 guild bank tab items. DB table `guild_bank_item` or `item_instance` is empty.");
419 Field* fields = result->Fetch();
427 while (result->NextRow());
446 itr->second->GetAchievementMgr().LoadFromDB(achievementResult, criteriaResult);
451 TC_LOG_INFO(
"misc",
"Validating data of loaded guilds...");
457 Guild* guild = itr->second;
bool LoadBankEventLogFromDB(Field *fields)
Definition: Guild.cpp:2332
std::shared_ptr< PreparedResultSet > PreparedQueryResult
Definition: QueryResult.h:107
uint64 GetUInt64() const
Definition: Field.h:184
bool Validate()
Definition: Guild.cpp:2409
Class used to access individual fields of database query result.
Definition: Field.h:56
uint32 getMSTime()
Definition: Timer.h:24
Definition: CharacterDatabase.h:172
#define sWorld
Definition: World.h:887
void LoadRankFromDB(Field *fields)
Definition: Guild.cpp:2283
Definition: PreparedStatement.h:74
bool LoadEventLogFromDB(Field *fields)
Definition: Guild.cpp:2315
void LoadBankTabFromDB(Field *fields)
Definition: Guild.cpp:2387
void DirectPExecute(Format &&sql, Args &&...args)
Definition: DatabaseWorkerPool.h:134
void LoadGuildNewsLogFromDB(Field *fields)
Definition: Guild.cpp:2372
uint32_t uint32
Definition: Define.h:150
uint64_t uint64
Definition: Define.h:149
std::shared_ptr< ResultSet > QueryResult
Definition: QueryResult.h:61
PreparedStatement * GetPreparedStatement(PreparedStatementIndex index)
Definition: DatabaseWorkerPool.h:263
GuildContainer GuildStore
Definition: GuildMgr.h:57
void LoadBankRightFromDB(Field *fields)
Definition: Guild.cpp:2307
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
Definition: Timer.h:42
bool LoadBankItemFromDB(Field *fields)
Definition: Guild.cpp:2396
QueryResult Query(const char *sql, T *connection=nullptr)
Definition: DatabaseWorkerPool.cpp:113
bool LoadMemberFromDB(Field *fields)
Definition: Guild.cpp:2292
void setUInt64(const uint8 index, const uint64 value)
Definition: PreparedStatement.cpp:124
bool LoadFromDB(Field *fields)
Definition: Guild.cpp:2252
void AddGuild(Guild *guild)
Definition: GuildMgr.cpp:30
CharacterDatabaseWorkerPool CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21
#define TC_LOG_INFO(filterType__,...)
Definition: Log.h:201
Guild * GetGuildById(ObjectGuid::LowType guildId) const
Definition: GuildMgr.cpp:57
void DirectExecute(const char *sql)
Definition: DatabaseWorkerPool.h:121
Definition: CharacterDatabase.h:205
Definition: CharacterDatabase.h:206