TrinityCore
GuildMgr.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "GuildMgr.h"
19#include "AchievementMgr.h"
20#include "DB2Stores.h"
21#include "DatabaseEnv.h"
22#include "Guild.h"
23#include "Log.h"
24#include "ObjectMgr.h"
25#include "Util.h"
26#include "World.h"
27
28GuildMgr::GuildMgr() : NextGuildId(UI64LIT(1))
29{
30}
31
32GuildMgr::~GuildMgr() = default;
33
35{
37 ptr.reset(guild);
38 guild->SetWeakPtr(ptr);
39}
40
42{
43 GuildStore.erase(guildId);
44}
45
47{
48 for (GuildContainer::iterator itr = GuildStore.begin(); itr != GuildStore.end(); ++itr)
49 itr->second->SaveToDB();
50}
51
53{
54 if (NextGuildId >= 0xFFFFFFFE)
55 {
56 TC_LOG_ERROR("guild", "Guild ids overflow!! Can't continue, shutting down server. ");
58 }
59 return NextGuildId++;
60}
61
62// Guild collection
64{
65 GuildContainer::const_iterator itr = GuildStore.find(guildId);
66 if (itr != GuildStore.end())
67 return itr->second.get();
68
69 return nullptr;
70}
71
73{
74 // Full guids are only used when receiving/sending data to client
75 // everywhere else guild id is used
76 if (guid.IsGuild())
77 if (ObjectGuid::LowType guildId = guid.GetCounter())
78 return GetGuildById(guildId);
79
80 return nullptr;
81}
82
83Guild* GuildMgr::GetGuildByName(std::string_view guildName) const
84{
85 for (auto const& [id, guild] : GuildStore)
86 if (StringEqualI(guild->GetName(), guildName))
87 return guild.get();
88
89 return nullptr;
90}
91
93{
94 if (Guild* guild = GetGuildById(guildId))
95 return guild->GetName();
96
97 return "";
98}
99
101{
102 static GuildMgr instance;
103 return &instance;
104}
105
107{
108 for (GuildContainer::const_iterator itr = GuildStore.begin(); itr != GuildStore.end(); ++itr)
109 if (itr->second->GetLeaderGUID() == guid)
110 return itr->second.get();
111
112 return nullptr;
113}
114
116{
117 // 1. Load all guilds
118 TC_LOG_INFO("server.loading", "Loading guilds definitions...");
119 {
120 uint32 oldMSTime = getMSTime();
121
122 // 0 1 2 3 4 5 6
123 QueryResult result = CharacterDatabase.Query("SELECT g.guildid, g.name, g.leaderguid, g.EmblemStyle, g.EmblemColor, g.BorderStyle, g.BorderColor, "
124 // 7 8 9 10 11 12
125 "g.BackgroundColor, g.info, g.motd, g.createdate, g.BankMoney, COUNT(gbt.guildid) "
126 "FROM guild g LEFT JOIN guild_bank_tab gbt ON g.guildid = gbt.guildid GROUP BY g.guildid ORDER BY g.guildid ASC");
127
128 if (!result)
129 {
130 TC_LOG_INFO("server.loading", ">> Loaded 0 guild definitions. DB table `guild` is empty.");
131 return;
132 }
133 else
134 {
135 uint32 count = 0;
136 do
137 {
138 Field* fields = result->Fetch();
139 Guild* guild = new Guild();
140
141 if (!guild->LoadFromDB(fields))
142 {
143 delete guild;
144 continue;
145 }
146
147 AddGuild(guild);
148
149 ++count;
150 }
151 while (result->NextRow());
152
153 TC_LOG_INFO("server.loading", ">> Loaded {} guild definitions in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
154 }
155 }
156
157 // 2. Load all guild ranks
158 TC_LOG_INFO("server.loading", "Loading guild ranks...");
159 {
160 uint32 oldMSTime = getMSTime();
161
162 // Delete orphaned guild rank entries before loading the valid ones
163 CharacterDatabase.DirectExecute("DELETE gr FROM guild_rank gr LEFT JOIN guild g ON gr.guildId = g.guildId WHERE g.guildId IS NULL");
164
165 // 0 1 2 3 4 5
166 QueryResult result = CharacterDatabase.Query("SELECT guildid, rid, RankOrder, rname, rights, BankMoneyPerDay FROM guild_rank ORDER BY guildid ASC, rid ASC");
167
168 if (!result)
169 {
170 TC_LOG_INFO("server.loading", ">> Loaded 0 guild ranks. DB table `guild_rank` is empty.");
171 }
172 else
173 {
174 uint32 count = 0;
175 do
176 {
177 Field* fields = result->Fetch();
178 uint64 guildId = fields[0].GetUInt64();
179
180 if (Guild* guild = GetGuildById(guildId))
181 guild->LoadRankFromDB(fields);
182
183 ++count;
184 }
185 while (result->NextRow());
186
187 TC_LOG_INFO("server.loading", ">> Loaded {} guild ranks in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
188 }
189 }
190
191 // 3. Load all guild members
192 TC_LOG_INFO("server.loading", "Loading guild members...");
193 {
194 uint32 oldMSTime = getMSTime();
195
196 // Delete orphaned guild member entries before loading the valid ones
197 CharacterDatabase.DirectExecute("DELETE gm FROM guild_member gm LEFT JOIN guild g ON gm.guildId = g.guildId WHERE g.guildId IS NULL");
198 CharacterDatabase.DirectExecute("DELETE gm FROM guild_member_withdraw gm LEFT JOIN guild_member g ON gm.guid = g.guid WHERE g.guid IS NULL");
199
200 // 0 1 2 3 4 5 6 7 8 9 10
201 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 // 11 12 13 14 15 16 17 18 19 20 21
203 "w.tab6, w.tab7, w.money, c.name, c.level, c.race, c.class, c.gender, c.zone, c.account, c.logout_time "
204 "FROM guild_member gm "
205 "LEFT JOIN guild_member_withdraw w ON gm.guid = w.guid "
206 "LEFT JOIN characters c ON c.guid = gm.guid ORDER BY gm.guildid ASC");
207
208 if (!result)
209 TC_LOG_INFO("server.loading", ">> Loaded 0 guild members. DB table `guild_member` is empty.");
210 else
211 {
212 uint32 count = 0;
213
214 do
215 {
216 Field* fields = result->Fetch();
217 uint64 guildId = fields[0].GetUInt64();
218
219 if (Guild* guild = GetGuildById(guildId))
220 guild->LoadMemberFromDB(fields);
221
222 ++count;
223 }
224 while (result->NextRow());
225
226 TC_LOG_INFO("server.loading", ">> Loaded {} guild members in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
227 }
228 }
229
230 // 4. Load all guild bank tab rights
231 TC_LOG_INFO("server.loading", "Loading bank tab rights...");
232 {
233 uint32 oldMSTime = getMSTime();
234
235 // Delete orphaned guild bank right entries before loading the valid ones
236 CharacterDatabase.DirectExecute("DELETE gbr FROM guild_bank_right gbr LEFT JOIN guild g ON gbr.guildId = g.guildId WHERE g.guildId IS NULL");
237
238 // 0 1 2 3 4
239 QueryResult result = CharacterDatabase.Query("SELECT guildid, TabId, rid, gbright, SlotPerDay FROM guild_bank_right ORDER BY guildid ASC, TabId ASC");
240
241 if (!result)
242 {
243 TC_LOG_INFO("server.loading", ">> Loaded 0 guild bank tab rights. DB table `guild_bank_right` is empty.");
244 }
245 else
246 {
247 uint32 count = 0;
248 do
249 {
250 Field* fields = result->Fetch();
251 uint64 guildId = fields[0].GetUInt64();
252
253 if (Guild* guild = GetGuildById(guildId))
254 guild->LoadBankRightFromDB(fields);
255
256 ++count;
257 }
258 while (result->NextRow());
259
260 TC_LOG_INFO("server.loading", ">> Loaded {} bank tab rights in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
261 }
262 }
263
264 // 5. Load all event logs
265 TC_LOG_INFO("server.loading", "Loading guild event logs...");
266 {
267 uint32 oldMSTime = getMSTime();
268
269 CharacterDatabase.DirectPExecute("DELETE FROM guild_eventlog WHERE LogGuid > {}", sWorld->getIntConfig(CONFIG_GUILD_EVENT_LOG_COUNT));
270
271 // 0 1 2 3 4 5 6
272 QueryResult result = CharacterDatabase.Query("SELECT guildid, LogGuid, EventType, PlayerGuid1, PlayerGuid2, NewRank, TimeStamp FROM guild_eventlog ORDER BY TimeStamp DESC, LogGuid DESC");
273
274 if (!result)
275 {
276 TC_LOG_INFO("server.loading", ">> Loaded 0 guild event logs. DB table `guild_eventlog` is empty.");
277 }
278 else
279 {
280 uint32 count = 0;
281 do
282 {
283 Field* fields = result->Fetch();
284 uint64 guildId = fields[0].GetUInt64();
285
286 if (Guild* guild = GetGuildById(guildId))
287 guild->LoadEventLogFromDB(fields);
288
289 ++count;
290 }
291 while (result->NextRow());
292
293 TC_LOG_INFO("server.loading", ">> Loaded {} guild event logs in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
294 }
295 }
296
297 // 6. Load all bank event logs
298 TC_LOG_INFO("server.loading", "Loading guild bank event logs...");
299 {
300 uint32 oldMSTime = getMSTime();
301
302 // Remove log entries that exceed the number of allowed entries per guild
303 CharacterDatabase.DirectPExecute("DELETE FROM guild_bank_eventlog WHERE LogGuid > {}", sWorld->getIntConfig(CONFIG_GUILD_BANK_EVENT_LOG_COUNT));
304
305 // 0 1 2 3 4 5 6 7 8
306 QueryResult result = CharacterDatabase.Query("SELECT guildid, TabId, LogGuid, EventType, PlayerGuid, ItemOrMoney, ItemStackCount, DestTabId, TimeStamp FROM guild_bank_eventlog ORDER BY TimeStamp DESC, LogGuid DESC");
307
308 if (!result)
309 {
310 TC_LOG_INFO("server.loading", ">> Loaded 0 guild bank event logs. DB table `guild_bank_eventlog` is empty.");
311 }
312 else
313 {
314 uint32 count = 0;
315 do
316 {
317 Field* fields = result->Fetch();
318 uint64 guildId = fields[0].GetUInt64();
319
320 if (Guild* guild = GetGuildById(guildId))
321 guild->LoadBankEventLogFromDB(fields);
322
323 ++count;
324 }
325 while (result->NextRow());
326
327 TC_LOG_INFO("server.loading", ">> Loaded {} guild bank event logs in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
328 }
329 }
330
331 // 7. Load all news event logs
332 TC_LOG_INFO("server.loading", "Loading Guild News...");
333 {
334 uint32 oldMSTime = getMSTime();
335
336 CharacterDatabase.DirectPExecute("DELETE FROM guild_newslog WHERE LogGuid > {}", sWorld->getIntConfig(CONFIG_GUILD_NEWS_LOG_COUNT));
337
338 // 0 1 2 3 4 5 6
339 QueryResult result = CharacterDatabase.Query("SELECT guildid, LogGuid, EventType, PlayerGuid, Flags, Value, Timestamp FROM guild_newslog ORDER BY TimeStamp DESC, LogGuid DESC");
340
341 if (!result)
342 TC_LOG_INFO("server.loading", ">> Loaded 0 guild event logs. DB table `guild_newslog` is empty.");
343 else
344 {
345 uint32 count = 0;
346 do
347 {
348 Field* fields = result->Fetch();
349 uint64 guildId = fields[0].GetUInt64();
350
351 if (Guild* guild = GetGuildById(guildId))
352 guild->LoadGuildNewsLogFromDB(fields);
353
354 ++count;
355 }
356 while (result->NextRow());
357
358 TC_LOG_INFO("server.loading", ">> Loaded {} guild new logs in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
359 }
360 }
361
362 // 8. Load all guild bank tabs
363 TC_LOG_INFO("server.loading", "Loading guild bank tabs...");
364 {
365 uint32 oldMSTime = getMSTime();
366
367 // Delete orphaned guild bank tab entries before loading the valid ones
368 CharacterDatabase.DirectExecute("DELETE gbt FROM guild_bank_tab gbt LEFT JOIN guild g ON gbt.guildId = g.guildId WHERE g.guildId IS NULL");
369
370 // 0 1 2 3 4
371 QueryResult result = CharacterDatabase.Query("SELECT guildid, TabId, TabName, TabIcon, TabText FROM guild_bank_tab ORDER BY guildid ASC, TabId ASC");
372
373 if (!result)
374 {
375 TC_LOG_INFO("server.loading", ">> Loaded 0 guild bank tabs. DB table `guild_bank_tab` is empty.");
376 }
377 else
378 {
379 uint32 count = 0;
380 do
381 {
382 Field* fields = result->Fetch();
383 uint64 guildId = fields[0].GetUInt64();
384
385 if (Guild* guild = GetGuildById(guildId))
386 guild->LoadBankTabFromDB(fields);
387
388 ++count;
389 }
390 while (result->NextRow());
391
392 TC_LOG_INFO("server.loading", ">> Loaded {} guild bank tabs in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
393 }
394 }
395
396 // 9. Fill all guild bank tabs
397 TC_LOG_INFO("server.loading", "Filling bank tabs with items...");
398 {
399 uint32 oldMSTime = getMSTime();
400
401 // Delete orphan guild bank items
402 CharacterDatabase.DirectExecute("DELETE gbi FROM guild_bank_item gbi LEFT JOIN guild g ON gbi.guildId = g.guildId WHERE g.guildId IS NULL");
403
404 // 0 1 2 3 4 5 6 7 8 9 10 11 12
405 // SELECT guid, itemEntry, creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomBonusListId, durability, playedTime, text,
406 // 13 14 15 16 17 18
407 // battlePetSpeciesId, battlePetBreedData, battlePetLevel, battlePetDisplayId, context, bonusListIDs,
408 // 19 20 21 22 23 24
409 // itemModifiedAppearanceAllSpecs, itemModifiedAppearanceSpec1, itemModifiedAppearanceSpec2, itemModifiedAppearanceSpec3, itemModifiedAppearanceSpec4, itemModifiedAppearanceSpec5,
410 // 25 26 27 28 29 30
411 // spellItemEnchantmentAllSpecs, spellItemEnchantmentSpec1, spellItemEnchantmentSpec2, spellItemEnchantmentSpec3, spellItemEnchantmentSpec4, spellItemEnchantmentSpec5,
412 // 31 32 33
413 // secondaryItemModifiedAppearanceAllSpecs, secondaryItemModifiedAppearanceSpec1, secondaryItemModifiedAppearanceSpec2,
414 // 34 35 36
415 // secondaryItemModifiedAppearanceSpec3, secondaryItemModifiedAppearanceSpec4, secondaryItemModifiedAppearanceSpec5,
416 // 37 38 39 40 41 42 43 44 45 46 47 48
417 // gemItemId1, gemBonuses1, gemContext1, gemScalingLevel1, gemItemId2, gemBonuses2, gemContext2, gemScalingLevel2, gemItemId3, gemBonuses3, gemContext3, gemScalingLevel3
418 // 49 50
419 // fixedScalingLevel, artifactKnowledgeLevel
420 // 51 52 53
421 // guildid, TabId, SlotId FROM guild_bank_item gbi INNER JOIN item_instance ii ON gbi.item_guid = ii.guid
422
424 if (!result)
425 {
426 TC_LOG_INFO("server.loading", ">> Loaded 0 guild bank tab items. DB table `guild_bank_item` or `item_instance` is empty.");
427 }
428 else
429 {
430 uint32 count = 0;
431 do
432 {
433 Field* fields = result->Fetch();
434 uint64 guildId = fields[51].GetUInt64();
435
436 if (Guild* guild = GetGuildById(guildId))
437 guild->LoadBankItemFromDB(fields);
438
439 ++count;
440 }
441 while (result->NextRow());
442
443 TC_LOG_INFO("server.loading", ">> Loaded {} guild bank tab items in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
444 }
445 }
446
447 // 10. Load guild achievements
448 TC_LOG_INFO("server.loading", "Loading guild achievements...");
449 {
450 uint32 oldMSTime = getMSTime();
451
452 uint64 achievementCount = 0;
453 uint64 criteriaCount = 0;
454
455 PreparedQueryResult achievementResult;
456 PreparedQueryResult criteriaResult;
457 for (GuildContainer::const_iterator itr = GuildStore.begin(); itr != GuildStore.end(); ++itr)
458 {
460 stmt->setUInt64(0, itr->first);
461 achievementResult = CharacterDatabase.Query(stmt);
462 stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_ACHIEVEMENT_CRITERIA);
463 stmt->setUInt64(0, itr->first);
464 criteriaResult = CharacterDatabase.Query(stmt);
465
466 if (achievementResult)
467 achievementCount += achievementResult->GetRowCount();
468 if (criteriaResult)
469 criteriaCount += criteriaResult->GetRowCount();
470
471 itr->second->GetAchievementMgr().LoadFromDB(achievementResult, criteriaResult);
472 }
473
474 TC_LOG_INFO("server.loading", ">> Loaded {} guild achievements and {} criterias in {} ms", achievementCount, criteriaCount, GetMSTimeDiffToNow(oldMSTime));
475 }
476
477 // 11. Validate loaded guild data
478 TC_LOG_INFO("misc", "Validating data of loaded guilds...");
479 {
480 uint32 oldMSTime = getMSTime();
481
482 for (GuildContainer::iterator itr = GuildStore.begin(); itr != GuildStore.end();)
483 {
484 Guild* guild = itr->second.get();
485 ++itr;
486 if (guild)
487 guild->Validate();
488 }
489
490 TC_LOG_INFO("server.loading", ">> Validated data of loaded guilds in {} ms", GetMSTimeDiffToNow(oldMSTime));
491 }
492}
493
495{
496 uint32 oldMSTime = getMSTime();
497
498 // 0 1 2 3
499 QueryResult result = WorldDatabase.Query("SELECT ItemID, MinGuildRep, RaceMask, Cost FROM guild_rewards");
500
501 if (!result)
502 {
503 TC_LOG_ERROR("server.loading", ">> Loaded 0 guild reward definitions. DB table `guild_rewards` is empty.");
504 return;
505 }
506
507 uint32 count = 0;
508
509 do
510 {
511 GuildReward reward;
512 Field* fields = result->Fetch();
513 reward.ItemID = fields[0].GetUInt32();
514 reward.MinGuildRep = fields[1].GetUInt8();
515 reward.RaceMask.RawValue = fields[2].GetUInt64();
516 reward.Cost = fields[3].GetUInt64();
517
518 if (!sObjectMgr->GetItemTemplate(reward.ItemID))
519 {
520 TC_LOG_ERROR("server.loading", "Guild rewards constains not existing item entry {}", reward.ItemID);
521 continue;
522 }
523
524 if (reward.MinGuildRep >= MAX_REPUTATION_RANK)
525 {
526 TC_LOG_ERROR("server.loading", "Guild rewards contains wrong reputation standing {}, max is {}", uint32(reward.MinGuildRep), MAX_REPUTATION_RANK - 1);
527 continue;
528 }
529
531 stmt->setUInt32(0, reward.ItemID);
532 PreparedQueryResult reqAchievementResult = WorldDatabase.Query(stmt);
533 if (reqAchievementResult)
534 {
535 do
536 {
537 fields = reqAchievementResult->Fetch();
538
539 uint32 requiredAchievementId = fields[0].GetUInt32();
540
541 if (!sAchievementStore.LookupEntry(requiredAchievementId))
542 {
543 TC_LOG_ERROR("server.loading", "Guild rewards constains not existing achievement entry {}", requiredAchievementId);
544 continue;
545 }
546
547 reward.AchievementsRequired.push_back(requiredAchievementId);
548 } while (reqAchievementResult->NextRow());
549 }
550
551 GuildRewards.push_back(reward);
552 ++count;
553 } while (result->NextRow());
554
555 TC_LOG_INFO("server.loading", ">> Loaded {} guild reward definitions in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
556}
557
558void GuildMgr::ResetTimes(bool week)
559{
561
562 for (GuildContainer::const_iterator itr = GuildStore.begin(); itr != GuildStore.end(); ++itr)
563 if (Guild* guild = itr->second.get())
564 guild->ResetTimes(week);
565}
@ CHAR_SEL_GUILD_BANK_ITEMS
@ CHAR_SEL_GUILD_ACHIEVEMENT
@ CHAR_DEL_GUILD_MEMBER_WITHDRAW
@ CHAR_SEL_GUILD_ACHIEVEMENT_CRITERIA
DB2Storage< AchievementEntry > sAchievementStore("Achievement.db2", &AchievementLoadInfo::Instance)
std::shared_ptr< ResultSet > QueryResult
std::shared_ptr< PreparedResultSet > PreparedQueryResult
DatabaseWorkerPool< CharacterDatabaseConnection > CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21
DatabaseWorkerPool< WorldDatabaseConnection > WorldDatabase
Accessor to the world database.
Definition: DatabaseEnv.cpp:20
uint64_t uint64
Definition: Define.h:141
#define UI64LIT(N)
Definition: Define.h:127
uint32_t uint32
Definition: Define.h:142
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:165
#define TC_LOG_INFO(filterType__,...)
Definition: Log.h:159
#define sObjectMgr
Definition: ObjectMgr.h:1946
#define MAX_REPUTATION_RANK
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
Definition: Timer.h:57
uint32 getMSTime()
Definition: Timer.h:33
bool StringEqualI(std::string_view a, std::string_view b)
Definition: Util.cpp:891
@ WORLD_SEL_GUILD_REWARDS_REQ_ACHIEVEMENTS
Definition: WorldDatabase.h:86
Class used to access individual fields of database query result.
Definition: Field.h:90
uint8 GetUInt8() const
Definition: Field.cpp:30
uint64 GetUInt64() const
Definition: Field.cpp:78
uint32 GetUInt32() const
Definition: Field.cpp:62
GuildMgr()
Definition: GuildMgr.cpp:28
std::string GetGuildNameById(ObjectGuid::LowType guildId) const
Definition: GuildMgr.cpp:92
GuildContainer GuildStore
Definition: GuildMgr.h:66
void ResetTimes(bool week)
Definition: GuildMgr.cpp:558
Guild * GetGuildById(ObjectGuid::LowType guildId) const
Definition: GuildMgr.cpp:63
std::vector< GuildReward > GuildRewards
Definition: GuildMgr.h:67
ObjectGuid::LowType NextGuildId
Definition: GuildMgr.h:65
void LoadGuildRewards()
Definition: GuildMgr.cpp:494
Guild * GetGuildByLeader(ObjectGuid guid) const
Definition: GuildMgr.cpp:106
void AddGuild(Guild *guild)
Definition: GuildMgr.cpp:34
ObjectGuid::LowType GenerateGuildId()
Definition: GuildMgr.cpp:52
Guild * GetGuildByGuid(ObjectGuid guid) const
Definition: GuildMgr.cpp:72
void LoadGuilds()
Definition: GuildMgr.cpp:115
void RemoveGuild(ObjectGuid::LowType guildId)
Definition: GuildMgr.cpp:41
static GuildMgr * instance()
Definition: GuildMgr.cpp:100
Guild * GetGuildByName(std::string_view guildName) const
Definition: GuildMgr.cpp:83
void SaveGuilds()
Definition: GuildMgr.cpp:46
Definition: Guild.h:329
void SetWeakPtr(Trinity::unique_weak_ptr< Guild > weakRef)
Definition: Guild.h:877
ObjectGuid::LowType GetId() const
Definition: Guild.h:752
bool LoadFromDB(Field *fields)
Definition: Guild.cpp:2491
bool Validate()
Definition: Guild.cpp:2656
LowType GetCounter() const
Definition: ObjectGuid.h:293
bool IsGuild() const
Definition: ObjectGuid.h:336
uint64 LowType
Definition: ObjectGuid.h:278
void setUInt32(const uint8 index, const uint32 value)
void setUInt64(const uint8 index, const uint64 value)
static void StopNow(uint8 exitcode)
Definition: World.h:670
#define sWorld
Definition: World.h:931
@ CONFIG_GUILD_EVENT_LOG_COUNT
Definition: World.h:363
@ CONFIG_GUILD_BANK_EVENT_LOG_COUNT
Definition: World.h:364
@ CONFIG_GUILD_NEWS_LOG_COUNT
Definition: World.h:362
@ ERROR_EXIT_CODE
Definition: World.h:75
Trinity::RaceMask< uint64 > RaceMask
Definition: Guild.h:255
std::vector< uint32 > AchievementsRequired
Definition: Guild.h:257
uint32 ItemID
Definition: Guild.h:253
uint8 MinGuildRep
Definition: Guild.h:254
uint64 Cost
Definition: Guild.h:256