TrinityCore
Loading...
Searching...
No Matches
World.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
22#include "World.h"
23#include "AccountMgr.h"
24#include "AchievementMgr.h"
26#include "ArenaTeamMgr.h"
27#include "AuctionHouseBot.h"
28#include "AuctionHouseMgr.h"
30#include "BattlePetMgr.h"
31#include "BattlefieldMgr.h"
32#include "BattlegroundMgr.h"
34#include "BlackMarketMgr.h"
35#include "CalendarMgr.h"
36#include "ChannelMgr.h"
37#include "CharacterCache.h"
40#include "Chat.h"
41#include "ChatCommand.h"
42#include "ChatPackets.h"
43#include "Config.h"
44#include "Containers.h"
46#include "CreatureAIRegistry.h"
47#include "CreatureGroups.h"
48#include "CreatureTextMgr.h"
49#include "DB2Stores.h"
50#include "DatabaseEnv.h"
52#include "DisableMgr.h"
53#include "GameEventMgr.h"
54#include "GameObjectModel.h"
55#include "GameTables.h"
56#include "GameTime.h"
57#include "GarrisonMgr.h"
58#include "GitRevision.h"
59#include "GridNotifiersImpl.h"
60#include "GroupMgr.h"
61#include "GuildMgr.h"
62#include "IPLocation.h"
63#include "InstanceLockMgr.h"
64#include "ItemBonusMgr.h"
65#include "LFGMgr.h"
66#include "Language.h"
67#include "LanguageMgr.h"
68#include "Log.h"
69#include "LootItemStorage.h"
70#include "LootMgr.h"
71#include "M2Stores.h"
72#include "MMapManager.h"
73#include "Map.h"
74#include "MapManager.h"
75#include "MapUtils.h"
76#include "Metric.h"
77#include "MiscPackets.h"
78#include "ObjectAccessor.h"
79#include "ObjectMgr.h"
80#include "OutdoorPvPMgr.h"
81#include "PetitionMgr.h"
82#include "Player.h"
83#include "PlayerDump.h"
84#include "PoolMgr.h"
85#include "QuestMgr.h"
86#include "QuestPools.h"
87#include "RealmList.h"
88#include "ScenarioMgr.h"
89#include "ScriptMgr.h"
90#include "ScriptReloadMgr.h"
91#include "SkillDiscovery.h"
92#include "SkillExtraItems.h"
93#include "SmartScriptMgr.h"
94#include "SpellMgr.h"
95#include "SupportMgr.h"
96#include "TaxiPathGraph.h"
97#include "TerrainMgr.h"
98#include "TraitMgr.h"
99#include "TransmogMgr.h"
100#include "TransportMgr.h"
101#include "Unit.h"
102#include "UpdateTime.h"
103#include "VMapFactory.h"
104#include "VMapManager.h"
105#include "WaypointManager.h"
106#include "WeatherMgr.h"
107#include "WhoListStorage.h"
108#include "WorldSession.h"
109#include "WorldStateMgr.h"
110#include <zlib.h>
111
112TC_GAME_API std::atomic<bool> World::m_stopEvent(false);
114
115TC_GAME_API std::atomic<uint32> World::m_worldLoopCounter(0);
116
118{
119 std::string Id;
120};
121
122PersistentWorldVariable const World::NextCurrencyResetTimeVarId{ "NextCurrencyResetTime" };
123PersistentWorldVariable const World::NextWeeklyQuestResetTimeVarId{ "NextWeeklyQuestResetTime" };
124PersistentWorldVariable const World::NextBGRandomDailyResetTimeVarId{ "NextBGRandomDailyResetTime" };
125PersistentWorldVariable const World::CharacterDatabaseCleaningFlagsVarId{ "PersistentCharacterCleanFlags" };
126PersistentWorldVariable const World::NextGuildDailyResetTimeVarId{ "NextGuildDailyResetTime" };
127PersistentWorldVariable const World::NextMonthlyQuestResetTimeVarId{ "NextMonthlyQuestResetTime" };
128PersistentWorldVariable const World::NextDailyQuestResetTimeVarId{ "NextDailyQuestResetTime" };
129PersistentWorldVariable const World::NextOldCalendarEventDeletionTimeVarId{ "NextOldCalendarEventDeletionTime" };
130PersistentWorldVariable const World::NextGuildWeeklyResetTimeVarId{ "NextGuildWeeklyResetTime" };
131
134{
135 m_playerLimit = 0;
137 m_allowMovement = true;
138 m_ShutdownMask = 0;
139 m_ShutdownTimer = 0;
140
143 m_PlayerCount = 0;
152
155
156 mail_timer = 0;
159
160 m_isClosed = false;
161
162 m_CleaningFlags = 0;
163
164 memset(rate_values, 0, sizeof(rate_values));
165 memset(m_int_configs, 0, sizeof(m_int_configs));
166 memset(m_int64_configs, 0, sizeof(m_int64_configs));
167 memset(m_bool_configs, 0, sizeof(m_bool_configs));
168 memset(m_float_configs, 0, sizeof(m_float_configs));
169
170 _guidWarn = false;
171 _guidAlert = false;
172 _warnDiff = 0;
174}
175
178{
180 while (!m_sessions.empty())
181 {
182 // not remove from queue, prevent loading new sessions
183 delete m_sessions.begin()->second;
184 m_sessions.erase(m_sessions.begin());
185 }
186
187 CliCommandHolder* command = nullptr;
188 while (cliCmdQueue.next(command))
189 delete command;
190
192
194}
195
197{
198 static World instance;
199 return &instance;
200}
201
204{
206 SessionMap::const_iterator itr;
207 for (itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
208 {
209 if (!itr->second)
210 continue;
211
212 Player* player = itr->second->GetPlayer();
213 if (!player)
214 continue;
215
216 if (player->IsInWorld() && player->GetZoneId() == zone)
217 return player;
218 }
219 return nullptr;
220}
221
222bool World::IsClosed() const
223{
224 return m_isClosed;
225}
226
227void World::SetClosed(bool val)
228{
229 m_isClosed = val;
230
231 // Invert the value, for simplicity for scripters.
232 sScriptMgr->OnOpenStateChange(!val);
233}
234
236{
237 if (std::shared_ptr<Realm const> currentRealm = sRealmList->GetCurrentRealm())
238 SetPlayerSecurityLimit(currentRealm->AllowedSecurityLevel);
239}
240
242{
243 AccountTypes sec = _sec < SEC_CONSOLE ? _sec : SEC_PLAYER;
244 bool update = sec > m_allowedSecurityLevel;
246 if (update)
248}
249
250void World::SetMotd(std::string motd)
251{
253 sScriptMgr->OnMotdChange(motd);
254
255 _motd.clear();
256
257 std::vector<std::string_view> tokens = Trinity::Tokenize(motd, '@', true);
258
259 _motd.reserve(tokens.size());
260
261 for (std::string_view const& token : tokens)
262 _motd.emplace_back(token);
263}
264
265std::vector<std::string> const& World::GetMotd() const
266{
267 return _motd;
268}
269
271{
272 // Lock this only to prevent multiple maps triggering at the same time
273 std::scoped_lock lock(_guidAlertLock);
274
275 time_t gameTime = GameTime::GetGameTime();
276 time_t today = (gameTime / DAY) * DAY;
277
278 // Check if our window to restart today has passed. 5 mins until quiet time
279 while (gameTime >= GetLocalHourTimestamp(today, getIntConfig(CONFIG_RESPAWN_RESTARTQUIETTIME)) - 1810)
280 today += DAY;
281
282 // Schedule restart for 30 minutes before quiet time, or as long as we have
284
285 _guidWarn = true;
287}
288
290{
291 // Lock this only to prevent multiple maps triggering at the same time
292 std::scoped_lock lock(_guidAlertLock);
293
295 _guidAlert = true;
296 _guidWarn = false;
297}
298
307
315
322
325{
326 SessionMap::const_iterator itr = m_sessions.find(id);
327
328 if (itr != m_sessions.end())
329 return itr->second; // also can return nullptr for kicked session
330 else
331 return nullptr;
332}
333
336{
338 SessionMap::const_iterator itr = m_sessions.find(id);
339
340 if (itr != m_sessions.end() && itr->second)
341 {
342 if (itr->second->PlayerLoading())
343 return false;
344
345 itr->second->KickPlayer("World::RemoveSession");
346 }
347
348 return true;
349}
350
355
356void World::AddInstanceSocket(std::weak_ptr<WorldSocket> sock, uint64 connectToKey)
357{
358 _linkSocketQueue.add(std::make_pair(sock, connectToKey));
359}
360
362{
363 ASSERT(s);
364
365 //NOTE - Still there is race condition in WorldSession* being used in the Sockets
366
369 if (!RemoveSession(s->GetAccountId()))
370 {
371 s->KickPlayer("World::AddSession_ Couldn't remove the other session while on loading screen");
372 delete s; // session not added yet in session list, so not listed in queue
373 return;
374 }
375
376 // decrease session counts only at not reconnection case
377 bool decrease_session = true;
378
379 // if session already exist, prepare to it deleting at next world update
380 // NOTE - KickPlayer() should be called on "old" in RemoveSession()
381 {
382 SessionMap::const_iterator old = m_sessions.find(s->GetAccountId());
383
384 if (old != m_sessions.end())
385 {
386 // prevent decrease sessions count if session queued
387 if (RemoveQueuedPlayer(old->second))
388 decrease_session = false;
389 // not remove replaced session form queue if listed
390 Trinity::Containers::MultimapErasePair(m_sessionsByBnetGuid, old->second->GetBattlenetAccountGUID(), old->second);
391 delete old->second;
392 }
393 }
394
395 m_sessions[s->GetAccountId()] = s;
397
399 uint32 pLimit = GetPlayerAmountLimit();
400 uint32 QueueSize = GetQueuedSessionCount(); //number of players in the queue
401
402 //so we don't count the user trying to
403 //login as a session and queue the socket that we are using
404 if (decrease_session)
405 --Sessions;
406
407 if (pLimit > 0 && Sessions >= pLimit && !s->HasPermission(rbac::RBAC_PERM_SKIP_QUEUE) && !HasRecentlyDisconnected(s))
408 {
411 TC_LOG_INFO("misc", "PlayerQueue: Account id {} is in Queue Position ({}).", s->GetAccountId(), ++QueueSize);
412 return;
413 }
414
416
418
419 // Updates the population
420 if (pLimit > 0)
421 {
422 float popu = (float)GetActiveSessionCount(); // updated number of users on the server
423 popu /= pLimit;
424
426 stmt->setFloat(0, popu);
427 stmt->setUInt32(1, sRealmList->GetCurrentRealmId().Realm);
428 LoginDatabase.Execute(stmt);
429
430 TC_LOG_INFO("misc", "Server Population ({}).", popu);
431 }
432}
433
435{
436 if (!session)
437 return false;
438
440 {
441 for (DisconnectMap::iterator i = m_disconnects.begin(); i != m_disconnects.end();)
442 {
443 if (difftime(i->second, GameTime::GetGameTime()) < tolerance)
444 {
445 if (i->first == session->GetAccountId())
446 return true;
447 ++i;
448 }
449 else
450 m_disconnects.erase(i++);
451 }
452 }
453 return false;
454 }
455
457{
458 uint32 position = 1;
459
460 for (Queue::const_iterator iter = m_QueuedPlayer.begin(); iter != m_QueuedPlayer.end(); ++iter, ++position)
461 if ((*iter) == sess)
462 return position;
463
464 return 0;
465}
466
468{
469 sess->SetInQueue(true);
470 m_QueuedPlayer.push_back(sess);
471
472 // The 1st SMSG_AUTH_RESPONSE needs to contain other info too.
473 sess->SendAuthResponse(ERROR_OK, true, GetQueuePos(sess));
474}
475
477{
478 // sessions count including queued to remove (if removed_session set)
479 uint32 sessions = GetActiveSessionCount();
480
481 uint32 position = 1;
482 Queue::iterator iter = m_QueuedPlayer.begin();
483
484 // search to remove and count skipped positions
485 bool found = false;
486
487 for (; iter != m_QueuedPlayer.end(); ++iter, ++position)
488 {
489 if (*iter == sess)
490 {
491 sess->SetInQueue(false);
492 sess->ResetTimeOutTime(false);
493 iter = m_QueuedPlayer.erase(iter);
494 found = true; // removing queued session
495 break;
496 }
497 }
498
499 // iter point to next socked after removed or end()
500 // position store position of removed socket and then new position next socket after removed
501
502 // if session not queued then we need decrease sessions count
503 if (!found && sessions)
504 --sessions;
505
506 // accept first in queue
507 if ((!m_playerLimit || sessions < m_playerLimit) && !m_QueuedPlayer.empty())
508 {
509 WorldSession* pop_sess = m_QueuedPlayer.front();
510 pop_sess->InitializeSession();
511 m_QueuedPlayer.pop_front();
512
513 // update iter to point first queued socket or end() if queue is empty now
514 iter = m_QueuedPlayer.begin();
515 position = 1;
516 }
517
518 // update position from iter to end()
519 // iter point to first not updated socket, position store new position
520 for (; iter != m_QueuedPlayer.end(); ++iter, ++position)
521 (*iter)->SendAuthWaitQueue(position);
522
523 return found;
524}
525
526template <typename T, typename IndexType>
528{
529 std::string_view Name;
531 IndexType Index = { };
533 bool Reloadable = true;
534};
535
536template <typename T, auto Max>
538
539template <typename T, typename IndexType>
540static void StoreConfigValue(T& oldValue, std::type_identity_t<T> value, ConfigOptionLoadDefinition<T, IndexType> const& definition, bool reload)
541{
542 if constexpr (!std::is_same_v<T, bool>)
543 {
544 if (definition.Min && value < *definition.Min)
545 {
546 TC_LOG_ERROR("server.loading", "{} {} must be >= {}. Using {} instead.", definition.Name, value, *definition.Min, *definition.Min);
547 value = *definition.Min;
548 }
549 if (definition.Max && value > *definition.Max)
550 {
551 TC_LOG_ERROR("server.loading", "{} {} must be <= {}. Using {} instead.", definition.Name, value, *definition.Max, *definition.Max);
552 value = *definition.Max;
553 }
554 }
555 if (reload && !definition.Reloadable)
556 {
557 if (value != oldValue)
558 TC_LOG_ERROR("server.loading", "{} option can't be changed at worldserver.conf reload, using current value ({}).", definition.Name, oldValue);
559 return;
560 }
561 oldValue = value;
562}
563
566{
567 if (reload)
568 {
569 std::vector<std::string> configErrors;
570 if (!sConfigMgr->Reload(configErrors))
571 {
572 for (std::string const& configError : configErrors)
573 TC_LOG_ERROR("misc", "World settings reload fail: {}.", configError);
574
575 return;
576 }
577 sLog->LoadFromConfig();
578 sMetric->LoadFromConfigs();
579 }
580
581 m_defaultDbcLocale = LocaleConstant(sConfigMgr->GetIntDefault("DBC.Locale"sv, 0));
582
584 {
585 TC_LOG_ERROR("server.loading", "Incorrect DBC.Locale! Must be >= 0 and < {} and not {} (set to 0)", TOTAL_LOCALES, LOCALE_none);
587 }
588
589 TC_LOG_INFO("server.loading", "Using {} DBC Locale", localeNames[m_defaultDbcLocale]);
590
592 SetPlayerAmountLimit(sConfigMgr->GetIntDefault("PlayerLimit"sv, 100));
593 SetMotd(sConfigMgr->GetStringDefault("Motd"sv, "Welcome to a TrinityCore Server."sv));
594
595 uint32 databaseCacheVersion = m_int_configs[CONFIG_CLIENTCACHE_VERSION];
596
598 { {
599 { .Name = "Support.Enabled"sv, .DefaultValue = true, .Index = CONFIG_SUPPORT_ENABLED },
600 { .Name = "Support.TicketsEnabled"sv, .DefaultValue = false, .Index = CONFIG_SUPPORT_TICKETS_ENABLED },
601 { .Name = "Support.BugsEnabled"sv, .DefaultValue = false, .Index = CONFIG_SUPPORT_BUGS_ENABLED },
602 { .Name = "Support.ComplaintsEnabled"sv, .DefaultValue = false, .Index = CONFIG_SUPPORT_COMPLAINTS_ENABLED },
603 { .Name = "Support.SuggestionsEnabled"sv, .DefaultValue = false, .Index = CONFIG_SUPPORT_SUGGESTIONS_ENABLED },
604 { .Name = "DurabilityLoss.InPvP"sv, .DefaultValue = false, .Index = CONFIG_DURABILITY_LOSS_IN_PVP },
605 { .Name = "AddonChannel"sv, .DefaultValue = true, .Index = CONFIG_ADDON_CHANNEL },
606 { .Name = "CleanCharacterDB"sv, .DefaultValue = false, .Index = CONFIG_CLEAN_CHARACTER_DB },
607 { .Name = "PreserveCustomChannels"sv, .DefaultValue = false, .Index = CONFIG_PRESERVE_CUSTOM_CHANNELS },
608 { .Name = "GridUnload"sv, .DefaultValue = true, .Index = CONFIG_GRID_UNLOAD },
609 { .Name = "BaseMapLoadAllGrids"sv, .DefaultValue = false, .Index = CONFIG_BASEMAP_LOAD_GRIDS },
610 { .Name = "InstanceMapLoadAllGrids"sv, .DefaultValue = false, .Index = CONFIG_INSTANCEMAP_LOAD_GRIDS },
611 { .Name = "BattlegroundMapLoadAllGrids"sv, .DefaultValue = true, .Index = CONFIG_BATTLEGROUNDMAP_LOAD_GRIDS },
612 { .Name = "PlayerSave.Stats.SaveOnlyOnLogout"sv, .DefaultValue = true, .Index = CONFIG_STATS_SAVE_ONLY_ON_LOGOUT },
613 { .Name = "Creature.RegenHPCannotReachTargetInRaid"sv, .DefaultValue = true, .Index = CONFIG_REGEN_HP_CANNOT_REACH_TARGET_IN_RAID },
614 { .Name = "AllowTwoSide.Interaction.Calendar"sv, .DefaultValue = false, .Index = CONFIG_ALLOW_TWO_SIDE_INTERACTION_CALENDAR },
615 { .Name = "AllowTwoSide.Interaction.Channel"sv, .DefaultValue = false, .Index = CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL },
616 { .Name = "AllowTwoSide.Interaction.Group"sv, .DefaultValue = false, .Index = CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP },
617 { .Name = "AllowTwoSide.Interaction.Guild"sv, .DefaultValue = false, .Index = CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD },
618 { .Name = "AllowTwoSide.Interaction.Auction"sv, .DefaultValue = true, .Index = CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION },
619 { .Name = "AllowTwoSide.Trade"sv, .DefaultValue = false, .Index = CONFIG_ALLOW_TWO_SIDE_TRADE },
620 { .Name = "ExtendedAccountNameLengthLimit"sv, .DefaultValue = false, .Index = CONFIG_EXTENDED_ACCOUNT_NAME_LENGTH_LIMIT },
621 { .Name = "CharacterCreating.DisableAlliedRaceAchievementRequirement"sv, .DefaultValue = false, .Index = CONFIG_CHARACTER_CREATING_DISABLE_ALLIED_RACE_ACHIEVEMENT_REQUIREMENT },
622 { .Name = "AllFlightPaths"sv, .DefaultValue = false, .Index = CONFIG_ALL_TAXI_PATHS },
623 { .Name = "InstantFlightPaths"sv, .DefaultValue = false, .Index = CONFIG_INSTANT_TAXI },
624 { .Name = "Instance.IgnoreLevel"sv, .DefaultValue = false, .Index = CONFIG_INSTANCE_IGNORE_LEVEL },
625 { .Name = "Instance.IgnoreRaid"sv, .DefaultValue = false, .Index = CONFIG_INSTANCE_IGNORE_RAID },
626 { .Name = "CastUnstuck"sv, .DefaultValue = true, .Index = CONFIG_CAST_UNSTUCK },
627 { .Name = "GM.AllowInvite"sv, .DefaultValue = false, .Index = CONFIG_ALLOW_GM_GROUP },
628 { .Name = "GM.LowerSecurity"sv, .DefaultValue = false, .Index = CONFIG_GM_LOWER_SECURITY },
629 { .Name = "SkillChance.Prospecting"sv, .DefaultValue = false, .Index = CONFIG_SKILL_PROSPECTING },
630 { .Name = "SkillChance.Milling"sv, .DefaultValue = false, .Index = CONFIG_SKILL_MILLING },
631 { .Name = "ActivateWeather"sv, .DefaultValue = true, .Index = CONFIG_WEATHER },
632 { .Name = "Event.Announce"sv, .DefaultValue = false, .Index = CONFIG_EVENT_ANNOUNCE },
633 { .Name = "Quests.EnableQuestTracker"sv, .DefaultValue = false, .Index = CONFIG_QUEST_ENABLE_QUEST_TRACKER },
634 { .Name = "Quests.IgnoreRaid"sv, .DefaultValue = false, .Index = CONFIG_QUEST_IGNORE_RAID },
635 { .Name = "Quests.IgnoreAutoAccept"sv, .DefaultValue = false, .Index = CONFIG_QUEST_IGNORE_AUTO_ACCEPT },
636 { .Name = "Quests.IgnoreAutoComplete"sv, .DefaultValue = false, .Index = CONFIG_QUEST_IGNORE_AUTO_COMPLETE },
637 { .Name = "DetectPosCollision"sv, .DefaultValue = true, .Index = CONFIG_DETECT_POS_COLLISION },
638 { .Name = "Channel.RestrictedLfg"sv, .DefaultValue = true, .Index = CONFIG_RESTRICTED_LFG_CHANNEL },
639 { .Name = "ChatFakeMessagePreventing"sv, .DefaultValue = false, .Index = CONFIG_CHAT_FAKE_MESSAGE_PREVENTING },
640 { .Name = "Death.CorpseReclaimDelay.PvP"sv, .DefaultValue = true, .Index = CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP },
641 { .Name = "Death.CorpseReclaimDelay.PvE"sv, .DefaultValue = true, .Index = CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE },
642 { .Name = "Death.Bones.World"sv, .DefaultValue = true, .Index = CONFIG_DEATH_BONES_WORLD },
643 { .Name = "Death.Bones.BattlegroundOrArena"sv, .DefaultValue = true, .Index = CONFIG_DEATH_BONES_BG_OR_ARENA },
644 { .Name = "Die.Command.Mode"sv, .DefaultValue = true, .Index = CONFIG_DIE_COMMAND_MODE },
645 { .Name = "DeclinedNames"sv, .DefaultValue = false, .Index = CONFIG_DECLINED_NAMES_USED },
646 { .Name = "Battleground.CastDeserter"sv, .DefaultValue = true, .Index = CONFIG_BATTLEGROUND_CAST_DESERTER },
647 { .Name = "Battleground.QueueAnnouncer.Enable"sv, .DefaultValue = false, .Index = CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE },
648 { .Name = "Battleground.QueueAnnouncer.PlayerOnly"sv, .DefaultValue = false, .Index = CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY },
649 { .Name = "Battleground.StoreStatistics.Enable"sv, .DefaultValue = false, .Index = CONFIG_BATTLEGROUND_STORE_STATISTICS_ENABLE },
650 { .Name = "Battleground.GiveXPForKills"sv, .DefaultValue = false, .Index = CONFIG_BG_XP_FOR_KILL },
651 { .Name = "Arena.QueueAnnouncer.Enable"sv, .DefaultValue = false, .Index = CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE },
652 { .Name = "Arena.ArenaSeason.InProgress"sv, .DefaultValue = false, .Index = CONFIG_ARENA_SEASON_IN_PROGRESS },
653 { .Name = "ArenaLog.ExtendedInfo"sv, .DefaultValue = false, .Index = CONFIG_ARENA_LOG_EXTENDED_INFO },
654 { .Name = "OffhandCheckAtSpellUnlearn"sv, .DefaultValue = true, .Index = CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN },
655 { .Name = "Respawn.DynamicEscortNPC"sv, .DefaultValue = false, .Index = CONFIG_RESPAWN_DYNAMIC_ESCORTNPC },
656 { .Name = "mmap.enablePathFinding"sv, .DefaultValue = true, .Index = CONFIG_ENABLE_MMAPS },
657 { .Name = "vmap.enableIndoorCheck"sv, .DefaultValue = true, .Index = CONFIG_VMAP_INDOOR_CHECK },
658 { .Name = "PlayerStart.AllSpells"sv, .DefaultValue = false, .Index = CONFIG_START_ALL_SPELLS },
659 { .Name = "ResetDuelCooldowns"sv, .DefaultValue = false, .Index = CONFIG_RESET_DUEL_COOLDOWNS },
660 { .Name = "ResetDuelHealthMana"sv, .DefaultValue = false, .Index = CONFIG_RESET_DUEL_HEALTH_MANA },
661 { .Name = "PlayerStart.MapsExplored"sv, .DefaultValue = false, .Index = CONFIG_START_ALL_EXPLORED },
662 { .Name = "PlayerStart.AllReputation"sv, .DefaultValue = false, .Index = CONFIG_START_ALL_REP },
663 { .Name = "PvPToken.Enable"sv, .DefaultValue = false, .Index = CONFIG_PVP_TOKEN_ENABLE },
664 { .Name = "NoResetTalentsCost"sv, .DefaultValue = false, .Index = CONFIG_NO_RESET_TALENT_COST },
665 { .Name = "ShowKickInWorld"sv, .DefaultValue = false, .Index = CONFIG_SHOW_KICK_IN_WORLD },
666 { .Name = "ShowMuteInWorld"sv, .DefaultValue = false, .Index = CONFIG_SHOW_MUTE_IN_WORLD },
667 { .Name = "ShowBanInWorld"sv, .DefaultValue = false, .Index = CONFIG_SHOW_BAN_IN_WORLD },
668 { .Name = "FeatureSystem.CharacterUndelete.Enabled"sv, .DefaultValue = false, .Index = CONFIG_FEATURE_SYSTEM_CHARACTER_UNDELETE_ENABLED },
669 { .Name = "DBC.EnforceItemAttributes"sv, .DefaultValue = true, .Index = CONFIG_DBC_ENFORCE_ITEM_ATTRIBUTES },
670 { .Name = "InstancesResetAnnounce"sv, .DefaultValue = false, .Index = CONFIG_INSTANCES_RESET_ANNOUNCE },
671 { .Name = "AutoBroadcast.On"sv, .DefaultValue = false, .Index = CONFIG_AUTOBROADCAST },
672 { .Name = "PlayerDump.DisallowPaths"sv, .DefaultValue = true, .Index = CONFIG_PDUMP_NO_PATHS },
673 { .Name = "PlayerDump.DisallowOverwrite"sv, .DefaultValue = true, .Index = CONFIG_PDUMP_NO_OVERWRITE },
674 { .Name = "Wintergrasp.Enable"sv, .DefaultValue = false, .Index = CONFIG_WINTERGRASP_ENABLE },
675 { .Name = "TolBarad.Enable"sv, .DefaultValue = true, .Index = CONFIG_TOLBARAD_ENABLE },
676 { .Name = "Stats.Limits.Enable"sv, .DefaultValue = false, .Index = CONFIG_STATS_LIMITS_ENABLE },
677 { .Name = "Allow.IP.Based.Action.Logging"sv, .DefaultValue = false, .Index = CONFIG_IP_BASED_ACTION_LOGGING },
678 { .Name = "Calculate.Creature.Zone.Area.Data"sv, .DefaultValue = false, .Index = CONFIG_CALCULATE_CREATURE_ZONE_AREA_DATA },
679 { .Name = "Calculate.Gameoject.Zone.Area.Data"sv, .DefaultValue = false, .Index = CONFIG_CALCULATE_GAMEOBJECT_ZONE_AREA_DATA },
680 { .Name = "BlackMarket.Enabled"sv, .DefaultValue = true, .Index = CONFIG_BLACKMARKET_ENABLED },
681 { .Name = "HotSwap.Enabled"sv, .DefaultValue = true, .Index = CONFIG_HOTSWAP_ENABLED },
682 { .Name = "HotSwap.EnableReCompiler"sv, .DefaultValue = true, .Index = CONFIG_HOTSWAP_RECOMPILER_ENABLED },
683 { .Name = "HotSwap.EnableEarlyTermination"sv, .DefaultValue = true, .Index = CONFIG_HOTSWAP_EARLY_TERMINATION_ENABLED },
684 { .Name = "HotSwap.EnableBuildFileRecreation"sv, .DefaultValue = true, .Index = CONFIG_HOTSWAP_BUILD_FILE_RECREATION_ENABLED },
685 { .Name = "HotSwap.EnableInstall"sv, .DefaultValue = true, .Index = CONFIG_HOTSWAP_INSTALL_ENABLED },
686 { .Name = "HotSwap.EnablePrefixCorrection"sv, .DefaultValue = true, .Index = CONFIG_HOTSWAP_PREFIX_CORRECTION_ENABLED },
687 { .Name = "PreventRenameCharacterOnCustomization"sv, .DefaultValue = false, .Index = CONFIG_PREVENT_RENAME_CUSTOMIZATION },
688 { .Name = "PartyRaidWarnings"sv, .DefaultValue = false, .Index = CONFIG_CHAT_PARTY_RAID_WARNINGS },
689 { .Name = "CacheDataQueries"sv, .DefaultValue = true, .Index = CONFIG_CACHE_DATA_QUERIES },
690 { .Name = "Creature.CheckInvalidPosition"sv, .DefaultValue = false, .Index = CONFIG_CREATURE_CHECK_INVALID_POSITION },
691 { .Name = "GameObject.CheckInvalidPosition"sv, .DefaultValue = false, .Index = CONFIG_GAME_OBJECT_CHECK_INVALID_POSITION },
692 { .Name = "CheckGameObjectLoS"sv, .DefaultValue = true, .Index = CONFIG_CHECK_GOBJECT_LOS },
693 { .Name = "AllowLoggingIPAddressesInDatabase"sv, .DefaultValue = true, .Index = CONFIG_ALLOW_LOGGING_IP_ADDRESSES_IN_DATABASE },
694 { .Name = "Loot.EnableAELoot"sv, .DefaultValue = true, .Index = CONFIG_ENABLE_AE_LOOT },
695 { .Name = "Load.Locales"sv, .DefaultValue = true, .Index = CONFIG_LOAD_LOCALES },
696 } };
697
699 { {
700 { .Name = "Server.LoginInfo"sv, .DefaultValue = 0, .Index = CONFIG_ENABLE_SINFO_LOGIN },
701 { .Name = "XP.Boost.Daymask"sv, .DefaultValue = 0, .Index = CONFIG_XP_BOOST_DAYMASK },
702 { .Name = "Compression"sv, .DefaultValue = 1, .Index = CONFIG_COMPRESSION, .Min = Z_BEST_SPEED, .Max = Z_BEST_COMPRESSION },
703 { .Name = "PersistentCharacterCleanFlags"sv, .DefaultValue = 0, .Index = CONFIG_PERSISTENT_CHARACTER_CLEAN_FLAGS },
704 { .Name = "Auction.ReplicateItemsCooldown"sv, .DefaultValue = 900, .Index = CONFIG_AUCTION_REPLICATE_DELAY },
705 { .Name = "Auction.SearchDelay"sv, .DefaultValue = 300, .Index = CONFIG_AUCTION_SEARCH_DELAY, .Min = 100, .Max = 10000 },
706 { .Name = "Auction.TaintedSearchDelay"sv, .DefaultValue = 3000, .Index = CONFIG_AUCTION_TAINTED_SEARCH_DELAY, .Min = 100, .Max = 10000 },
707 { .Name = "ChatLevelReq.Channel"sv, .DefaultValue = 1, .Index = CONFIG_CHAT_CHANNEL_LEVEL_REQ },
708 { .Name = "ChatLevelReq.Whisper"sv, .DefaultValue = 1, .Index = CONFIG_CHAT_WHISPER_LEVEL_REQ },
709 { .Name = "ChatLevelReq.Emote"sv, .DefaultValue = 1, .Index = CONFIG_CHAT_EMOTE_LEVEL_REQ },
710 { .Name = "ChatLevelReq.Say"sv, .DefaultValue = 1, .Index = CONFIG_CHAT_SAY_LEVEL_REQ },
711 { .Name = "ChatLevelReq.Yell"sv, .DefaultValue = 1, .Index = CONFIG_CHAT_YELL_LEVEL_REQ },
712 { .Name = "PartyLevelReq"sv, .DefaultValue = 1, .Index = CONFIG_PARTY_LEVEL_REQ },
713 { .Name = "LevelReq.Trade"sv, .DefaultValue = 1, .Index = CONFIG_TRADE_LEVEL_REQ },
714 { .Name = "LevelReq.Auction"sv, .DefaultValue = 1, .Index = CONFIG_AUCTION_LEVEL_REQ },
715 { .Name = "LevelReq.Mail"sv, .DefaultValue = 1, .Index = CONFIG_MAIL_LEVEL_REQ },
716 { .Name = "PreserveCustomChannelDuration"sv, .DefaultValue = 14, .Index = CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION },
717 { .Name = "PreserveCustomChannelInterval"sv, .DefaultValue = 5, .Index = CONFIG_PRESERVE_CUSTOM_CHANNEL_INTERVAL },
718 { .Name = "PlayerSaveInterval"sv, .DefaultValue = 15 * MINUTE * IN_MILLISECONDS, .Index = CONFIG_INTERVAL_SAVE },
719 { .Name = "DisconnectToleranceInterval"sv, .DefaultValue = 0, .Index = CONFIG_INTERVAL_DISCONNECT_TOLERANCE },
720 { .Name = "PlayerSave.Stats.MinLevel"sv, .DefaultValue = 0, .Index = CONFIG_MIN_LEVEL_STAT_SAVE, .Max = STRONG_MAX_LEVEL },
721 { .Name = "GridCleanUpDelay"sv, .DefaultValue = 5 * MINUTE * IN_MILLISECONDS, .Index = CONFIG_INTERVAL_GRIDCLEAN, .Min = MIN_GRID_DELAY },
722 { .Name = "MapUpdateInterval"sv, .DefaultValue = 10, .Index = CONFIG_INTERVAL_MAPUPDATE, .Min = MIN_MAP_UPDATE_DELAY },
723 { .Name = "ChangeWeatherInterval"sv, .DefaultValue = 10 * MINUTE * IN_MILLISECONDS, .Index = CONFIG_INTERVAL_CHANGEWEATHER },
724 { .Name = "WorldServerPort"sv, .DefaultValue = 8085, .Index = CONFIG_PORT_WORLD, .Min = 1, .Max = std::numeric_limits<uint16>::max(), .Reloadable = false },
725 { .Name = "SocketTimeOutTime"sv, .DefaultValue = 900000, .Index = CONFIG_SOCKET_TIMEOUTTIME },
726 { .Name = "SocketTimeOutTimeActive"sv, .DefaultValue = 60000, .Index = CONFIG_SOCKET_TIMEOUTTIME_ACTIVE },
727 { .Name = "SessionAddDelay"sv, .DefaultValue = 10000, .Index = CONFIG_SESSION_ADD_DELAY },
728 { .Name = "MinQuestScaledXPRatio"sv, .DefaultValue = 0, .Index = CONFIG_MIN_QUEST_SCALED_XP_RATIO, .Max = 100 },
729 { .Name = "MinCreatureScaledXPRatio"sv, .DefaultValue = 0, .Index = CONFIG_MIN_CREATURE_SCALED_XP_RATIO, .Max = 100 },
730 { .Name = "MinDiscoveredScaledXPRatio"sv, .DefaultValue = 0, .Index = CONFIG_MIN_DISCOVERED_SCALED_XP_RATIO, .Max = 100 },
731 { .Name = "GameType"sv, .DefaultValue = 0, .Index = CONFIG_GAME_TYPE, .Reloadable = false },
732 { .Name = "RealmZone"sv, .DefaultValue = HARDCODED_DEVELOPMENT_REALM_CATEGORY_ID, .Index = CONFIG_REALM_ZONE, .Reloadable = false },
733 { .Name = "StrictPlayerNames"sv, .DefaultValue = 0, .Index = CONFIG_STRICT_PLAYER_NAMES },
734 { .Name = "StrictCharterNames"sv, .DefaultValue = 0, .Index = CONFIG_STRICT_CHARTER_NAMES },
735 { .Name = "StrictPetNames"sv, .DefaultValue = 0, .Index = CONFIG_STRICT_PET_NAMES },
736 { .Name = "MinPlayerName"sv, .DefaultValue = 2, .Index = CONFIG_MIN_PLAYER_NAME, .Min = 1, .Max = MAX_PLAYER_NAME },
737 { .Name = "MinCharterName"sv, .DefaultValue = 2, .Index = CONFIG_MIN_CHARTER_NAME, .Min = 1, .Max = MAX_CHARTER_NAME },
738 { .Name = "MinPetName"sv, .DefaultValue = 2, .Index = CONFIG_MIN_PET_NAME, .Min = 1, .Max = MAX_PET_NAME },
739 { .Name = "Guild.CharterCost"sv, .DefaultValue = 1000, .Index = CONFIG_CHARTER_COST_GUILD },
740 { .Name = "ArenaTeam.CharterCost.2v2"sv, .DefaultValue = 800000, .Index = CONFIG_CHARTER_COST_ARENA_2v2 },
741 { .Name = "ArenaTeam.CharterCost.3v3"sv, .DefaultValue = 1200000, .Index = CONFIG_CHARTER_COST_ARENA_3v3 },
742 { .Name = "ArenaTeam.CharterCost.5v5"sv, .DefaultValue = 2000000, .Index = CONFIG_CHARTER_COST_ARENA_5v5 },
743 { .Name = "CharacterCreating.Disabled"sv, .DefaultValue = 0, .Index = CONFIG_CHARACTER_CREATING_DISABLED },
744 { .Name = "CharacterCreating.Disabled.ClassMask"sv, .DefaultValue = 0, .Index = CONFIG_CHARACTER_CREATING_DISABLED_CLASSMASK },
745 { .Name = "CharactersPerRealm"sv, .DefaultValue = 60, .Index = CONFIG_CHARACTERS_PER_REALM, .Min = 1, .Max = MAX_CHARACTERS_PER_REALM },
746 { .Name = "CharactersPerAccount"sv, .DefaultValue = 60, .Index = CONFIG_CHARACTERS_PER_ACCOUNT, .Min = 1, .Max = MAX_CHARACTERS_PER_REALM },
747 { .Name = "CharacterCreating.EvokersPerRealm"sv, .DefaultValue = 1, .Index = CONFIG_CHARACTER_CREATING_EVOKERS_PER_REALM, .Min = 1, .Max = MAX_CHARACTERS_PER_REALM },
748 { .Name = "CharacterCreating.MinLevelForDemonHunter"sv, .DefaultValue = 0, .Index = CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_DEMON_HUNTER },
749 { .Name = "CharacterCreating.MinLevelForEvoker"sv, .DefaultValue = 50, .Index = CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_EVOKER },
750 { .Name = "SkipCinematics"sv, .DefaultValue = 0, .Index = CONFIG_SKIP_CINEMATICS, .Min = 0, .Max = 2 },
751 { .Name = "MaxPlayerLevel"sv, .DefaultValue = GetMaxLevelForExpansion(CURRENT_EXPANSION), .Index = CONFIG_MAX_PLAYER_LEVEL, .Min = 1, .Max = MAX_LEVEL, .Reloadable = false },
752 { .Name = "MinDualSpecLevel"sv, .DefaultValue = 40, .Index = CONFIG_MIN_DUALSPEC_LEVEL },
753 { .Name = "StartPlayerLevel"sv, .DefaultValue = 1, .Index = CONFIG_START_PLAYER_LEVEL, .Min = 1 },
754 { .Name = "StartDeathKnightPlayerLevel"sv, .DefaultValue = 8, .Index = CONFIG_START_DEATH_KNIGHT_PLAYER_LEVEL, .Min = 1 },
755 { .Name = "StartDemonHunterPlayerLevel"sv, .DefaultValue = 8, .Index = CONFIG_START_DEMON_HUNTER_PLAYER_LEVEL, .Min = 1 },
756 { .Name = "StartAlliedRacePlayerLevel"sv, .DefaultValue = 10, .Index = CONFIG_START_ALLIED_RACE_LEVEL, .Min = 1 },
757 { .Name = "Currency.ResetHour"sv, .DefaultValue = 3, .Index = CONFIG_CURRENCY_RESET_HOUR, .Min = 0, .Max = 23 },
758 { .Name = "Currency.ResetDay"sv, .DefaultValue = 3, .Index = CONFIG_CURRENCY_RESET_DAY, .Min = 0, .Max = 6 },
759 { .Name = "Currency.ResetInterval"sv, .DefaultValue = 7, .Index = CONFIG_CURRENCY_RESET_INTERVAL, .Min = 1 },
760 { .Name = "RecruitAFriend.MaxLevel"sv, .DefaultValue = GetMaxLevelForExpansion(CURRENT_EXPANSION), .Index = CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL, .Min = 1 },
761 { .Name = "RecruitAFriend.MaxDifference"sv, .DefaultValue = 4, .Index = CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL_DIFFERENCE },
762 { .Name = "ResetSchedule.WeekDay"sv, .DefaultValue = 2, .Index = CONFIG_RESET_SCHEDULE_WEEK_DAY, .Min = 0, .Max = 6 },
763 { .Name = "ResetSchedule.Hour"sv, .DefaultValue = 8, .Index = CONFIG_RESET_SCHEDULE_HOUR, .Min = 0, .Max = 23 },
764 { .Name = "Instance.UnloadDelay"sv, .DefaultValue = 30 * MINUTE * IN_MILLISECONDS, .Index = CONFIG_INSTANCE_UNLOAD_DELAY },
765 { .Name = "Quests.DailyResetTime"sv, .DefaultValue = 3, .Index = CONFIG_DAILY_QUEST_RESET_TIME_HOUR, .Min = 0, .Max = 23 },
766 { .Name = "Quests.WeeklyResetWDay"sv, .DefaultValue = 3, .Index = CONFIG_WEEKLY_QUEST_RESET_TIME_WDAY, .Min = 0, .Max = 6 },
767 { .Name = "MaxPrimaryTradeSkill"sv, .DefaultValue = 2, .Index = CONFIG_MAX_PRIMARY_TRADE_SKILL },
768 { .Name = "MinPetitionSigns"sv, .DefaultValue = 4, .Index = CONFIG_MIN_PETITION_SIGNS, .Max = 4 },
769 { .Name = "GM.LoginState"sv, .DefaultValue = 2, .Index = CONFIG_GM_LOGIN_STATE },
770 { .Name = "GM.Visible"sv, .DefaultValue = 2, .Index = CONFIG_GM_VISIBLE_STATE },
771 { .Name = "GM.Chat"sv, .DefaultValue = 2, .Index = CONFIG_GM_CHAT },
772 { .Name = "GM.WhisperingTo"sv, .DefaultValue = 2, .Index = CONFIG_GM_WHISPERING_TO },
773 { .Name = "GM.FreezeAuraDuration"sv, .DefaultValue = 0, .Index = CONFIG_GM_FREEZE_DURATION },
774 { .Name = "GM.InGMList.Level"sv, .DefaultValue = SEC_ADMINISTRATOR, .Index = CONFIG_GM_LEVEL_IN_GM_LIST },
775 { .Name = "GM.InWhoList.Level"sv, .DefaultValue = SEC_ADMINISTRATOR, .Index = CONFIG_GM_LEVEL_IN_WHO_LIST },
776 { .Name = "GM.StartLevel"sv, .DefaultValue = 1, .Index = CONFIG_START_GM_LEVEL, .Min = 1, .Max = MAX_LEVEL },
777 { .Name = "GM.ForceShutdownThreshold"sv, .DefaultValue = 30, .Index = CONFIG_FORCE_SHUTDOWN_THRESHOLD },
778 { .Name = "Visibility.GroupMode"sv, .DefaultValue = 1, .Index = CONFIG_GROUP_VISIBILITY, .Min = 0, .Max = 3 },
779 { .Name = "MailDeliveryDelay"sv, .DefaultValue = HOUR, .Index = CONFIG_MAIL_DELIVERY_DELAY },
780 { .Name = "CleanOldMailTime"sv, .DefaultValue = 4, .Index = CONFIG_CLEAN_OLD_MAIL_TIME, .Min = 0, .Max = 23 },
781 { .Name = "UpdateUptimeInterval"sv, .DefaultValue = 10, .Index = CONFIG_UPTIME_UPDATE, .Min = 1 },
782 { .Name = "LogDB.Opt.ClearInterval"sv, .DefaultValue = 10, .Index = CONFIG_LOGDB_CLEARINTERVAL, .Min = 1 },
783 { .Name = "LogDB.Opt.ClearTime"sv, .DefaultValue = 1209600, .Index = CONFIG_LOGDB_CLEARTIME, .Min = 1 },
784 { .Name = "SkillChance.Orange"sv, .DefaultValue = 100, .Index = CONFIG_SKILL_CHANCE_ORANGE },
785 { .Name = "SkillChance.Yellow"sv, .DefaultValue = 75, .Index = CONFIG_SKILL_CHANCE_YELLOW },
786 { .Name = "SkillChance.Green"sv, .DefaultValue = 25, .Index = CONFIG_SKILL_CHANCE_GREEN },
787 { .Name = "SkillChance.Grey"sv, .DefaultValue = 0, .Index = CONFIG_SKILL_CHANCE_GREY },
788 { .Name = "SkillChance.MiningSteps"sv, .DefaultValue = 75, .Index = CONFIG_SKILL_CHANCE_MINING_STEPS },
789 { .Name = "SkillChance.SkinningSteps"sv, .DefaultValue = 75, .Index = CONFIG_SKILL_CHANCE_SKINNING_STEPS },
790 { .Name = "SkillGain.Crafting"sv, .DefaultValue = 1, .Index = CONFIG_SKILL_GAIN_CRAFTING },
791 { .Name = "SkillGain.Gathering"sv, .DefaultValue = 1, .Index = CONFIG_SKILL_GAIN_GATHERING },
792 { .Name = "MaxOverspeedPings"sv, .DefaultValue = 2, .Index = CONFIG_MAX_OVERSPEED_PINGS },
793 { .Name = "ClientCacheVersion"sv, .DefaultValue = 0, .Index = CONFIG_CLIENTCACHE_VERSION },
794 { .Name = "DisableWaterBreath"sv, .DefaultValue = SEC_CONSOLE, .Index = CONFIG_DISABLE_BREATHING },
795 { .Name = "Expansion"sv, .DefaultValue = CURRENT_EXPANSION, .Index = CONFIG_EXPANSION, .Min = 0, .Max = MAX_EXPANSIONS, .Reloadable = false },
796 { .Name = "ChatFlood.MessageCount"sv, .DefaultValue = 10, .Index = CONFIG_CHATFLOOD_MESSAGE_COUNT },
797 { .Name = "ChatFlood.MessageDelay"sv, .DefaultValue = 1, .Index = CONFIG_CHATFLOOD_MESSAGE_DELAY },
798 { .Name = "ChatFlood.AddonMessageCount"sv, .DefaultValue = 100, .Index = CONFIG_CHATFLOOD_ADDON_MESSAGE_COUNT },
799 { .Name = "ChatFlood.AddonMessageDelay"sv, .DefaultValue = 1, .Index = CONFIG_CHATFLOOD_ADDON_MESSAGE_DELAY },
800 { .Name = "ChatFlood.MuteTime"sv, .DefaultValue = 10, .Index = CONFIG_CHATFLOOD_MUTE_TIME },
801 { .Name = "CreatureFamilyAssistanceDelay"sv, .DefaultValue = 1500, .Index = CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY },
802 { .Name = "CreatureFamilyFleeDelay"sv, .DefaultValue = 7000, .Index = CONFIG_CREATURE_FAMILY_FLEE_DELAY },
803 { .Name = "WorldBossLevelDiff"sv, .DefaultValue = 3, .Index = CONFIG_WORLD_BOSS_LEVEL_DIFF },
804 { .Name = "Quests.LowLevelHideDiff"sv, .DefaultValue = 4, .Index = CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF, .Max = MAX_LEVEL },
805 { .Name = "Quests.HighLevelHideDiff"sv, .DefaultValue = 7, .Index = CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF, .Max = MAX_LEVEL },
806 { .Name = "Battleground.Random.ResetHour"sv, .DefaultValue = 6, .Index = CONFIG_RANDOM_BG_RESET_HOUR, .Min = 0, .Max = 23 },
807 { .Name = "Calendar.DeleteOldEventsHour"sv, .DefaultValue = 6, .Index = CONFIG_CALENDAR_DELETE_OLD_EVENTS_HOUR, .Min = 0, .Max = 23 },
808 { .Name = "Guild.ResetHour"sv, .DefaultValue = 6, .Index = CONFIG_GUILD_RESET_HOUR, .Min = 0, .Max = 23 },
809 { .Name = "TalentsInspecting"sv, .DefaultValue = 1, .Index = CONFIG_TALENTS_INSPECTING },
810 { .Name = "ChatStrictLinkChecking.Severity"sv, .DefaultValue = 0, .Index = CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY },
811 { .Name = "ChatStrictLinkChecking.Kick"sv, .DefaultValue = 0, .Index = CONFIG_CHAT_STRICT_LINK_CHECKING_KICK },
812 { .Name = "Corpse.Decay.Normal"sv, .DefaultValue = 60, .Index = CONFIG_CORPSE_DECAY_NORMAL },
813 { .Name = "Corpse.Decay.Elite"sv, .DefaultValue = 300, .Index = CONFIG_CORPSE_DECAY_ELITE },
814 { .Name = "Corpse.Decay.RareElite"sv, .DefaultValue = 300, .Index = CONFIG_CORPSE_DECAY_RAREELITE },
815 { .Name = "Corpse.Decay.Obsolete"sv, .DefaultValue = 3600, .Index = CONFIG_CORPSE_DECAY_OBSOLETE },
816 { .Name = "Corpse.Decay.Rare"sv, .DefaultValue = 300, .Index = CONFIG_CORPSE_DECAY_RARE },
817 { .Name = "Corpse.Decay.Trivial"sv, .DefaultValue = 300, .Index = CONFIG_CORPSE_DECAY_TRIVIAL },
818 { .Name = "Corpse.Decay.MinusMob"sv, .DefaultValue = 150, .Index = CONFIG_CORPSE_DECAY_MINUSMOB },
819 { .Name = "Death.SicknessLevel"sv, .DefaultValue = 11, .Index = CONFIG_DEATH_SICKNESS_LEVEL },
820 { .Name = "Battleground.ReportAFK"sv, .DefaultValue = 3, .Index = CONFIG_BATTLEGROUND_REPORT_AFK, .Min = 1, .Max = 9 },
821 { .Name = "Battleground.InvitationType"sv, .DefaultValue = 0, .Index = CONFIG_BATTLEGROUND_INVITATION_TYPE },
822 { .Name = "Battleground.PrematureFinishTimer"sv, .DefaultValue = 5 * MINUTE * IN_MILLISECONDS, .Index = CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER },
823 { .Name = "Battleground.PremadeGroupWaitForMatch"sv, .DefaultValue = 30 * MINUTE * IN_MILLISECONDS, .Index = CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH },
824 { .Name = "Arena.MaxRatingDifference"sv, .DefaultValue = 150, .Index = CONFIG_ARENA_MAX_RATING_DIFFERENCE },
825 { .Name = "Arena.RatingDiscardTimer"sv, .DefaultValue = 10 * MINUTE * IN_MILLISECONDS, .Index = CONFIG_ARENA_RATING_DISCARD_TIMER },
826 { .Name = "Arena.RatedUpdateTimer"sv, .DefaultValue = 5 * IN_MILLISECONDS, .Index = CONFIG_ARENA_RATED_UPDATE_TIMER },
827 { .Name = "Arena.ArenaSeason.ID"sv, .DefaultValue = 32, .Index = CONFIG_ARENA_SEASON_ID },
828 { .Name = "Arena.ArenaStartRating"sv, .DefaultValue = 0, .Index = CONFIG_ARENA_START_RATING },
829 { .Name = "Arena.ArenaStartPersonalRating"sv, .DefaultValue = 0, .Index = CONFIG_ARENA_START_PERSONAL_RATING },
830 { .Name = "Arena.ArenaStartMatchmakerRating"sv, .DefaultValue = 1500, .Index = CONFIG_ARENA_START_MATCHMAKER_RATING },
831 { .Name = "Creature.PickPocketRefillDelay"sv, .DefaultValue = 10 * MINUTE, .Index = CONFIG_CREATURE_PICKPOCKET_REFILL },
832 { .Name = "Creature.MovingStopTimeForPlayer"sv, .DefaultValue = 3 * MINUTE * IN_MILLISECONDS, .Index = CONFIG_CREATURE_STOP_FOR_PLAYER },
833 { .Name = "Guild.NewsLogRecordsCount"sv, .DefaultValue = GUILD_NEWSLOG_MAX_RECORDS, .Index = CONFIG_GUILD_NEWS_LOG_COUNT, .Max = GUILD_NEWSLOG_MAX_RECORDS },
834 { .Name = "Guild.EventLogRecordsCount"sv, .DefaultValue = GUILD_EVENTLOG_MAX_RECORDS, .Index = CONFIG_GUILD_EVENT_LOG_COUNT, .Max = GUILD_EVENTLOG_MAX_RECORDS },
835 { .Name = "Guild.BankEventLogRecordsCount"sv, .DefaultValue = GUILD_BANKLOG_MAX_RECORDS, .Index = CONFIG_GUILD_BANK_EVENT_LOG_COUNT, .Max = GUILD_BANKLOG_MAX_RECORDS },
836 { .Name = "Visibility.Notify.Period.OnContinents"sv, .DefaultValue = DEFAULT_VISIBILITY_NOTIFY_PERIOD, .Index = CONFIG_VISIBILITY_NOTIFY_PERIOD_CONTINENT },
837 { .Name = "Visibility.Notify.Period.InInstances"sv, .DefaultValue = DEFAULT_VISIBILITY_NOTIFY_PERIOD, .Index = CONFIG_VISIBILITY_NOTIFY_PERIOD_INSTANCE },
838 { .Name = "Visibility.Notify.Period.InBG"sv, .DefaultValue = DEFAULT_VISIBILITY_NOTIFY_PERIOD, .Index = CONFIG_VISIBILITY_NOTIFY_PERIOD_BATTLEGROUND },
839 { .Name = "Visibility.Notify.Period.InArenas"sv, .DefaultValue = DEFAULT_VISIBILITY_NOTIFY_PERIOD, .Index = CONFIG_VISIBILITY_NOTIFY_PERIOD_ARENA },
840 { .Name = "CharDelete.Method"sv, .DefaultValue = 0, .Index = CONFIG_CHARDELETE_METHOD },
841 { .Name = "CharDelete.MinLevel"sv, .DefaultValue = 0, .Index = CONFIG_CHARDELETE_MIN_LEVEL },
842 { .Name = "CharDelete.DeathKnight.MinLevel"sv, .DefaultValue = 0, .Index = CONFIG_CHARDELETE_DEATH_KNIGHT_MIN_LEVEL },
843 { .Name = "CharDelete.DemonHunter.MinLevel"sv, .DefaultValue = 0, .Index = CONFIG_CHARDELETE_DEMON_HUNTER_MIN_LEVEL },
844 { .Name = "CharDelete.KeepDays"sv, .DefaultValue = 30, .Index = CONFIG_CHARDELETE_KEEP_DAYS },
845 { .Name = "NoGrayAggro.Above"sv, .DefaultValue = 0, .Index = CONFIG_NO_GRAY_AGGRO_ABOVE },
846 { .Name = "NoGrayAggro.Below"sv, .DefaultValue = 0, .Index = CONFIG_NO_GRAY_AGGRO_BELOW },
847 { .Name = "Respawn.MinCheckIntervalMS"sv, .DefaultValue = 5000, .Index = CONFIG_RESPAWN_MINCHECKINTERVALMS },
848 { .Name = "Respawn.DynamicMode"sv, .DefaultValue = 0, .Index = CONFIG_RESPAWN_DYNAMICMODE, .Min = 0, .Max = 1 },
849 { .Name = "Respawn.GuidWarnLevel"sv, .DefaultValue = 12000000, .Index = CONFIG_RESPAWN_GUIDWARNLEVEL, .Min = 0, .Max = 16777215 },
850 { .Name = "Respawn.GuidAlertLevel"sv, .DefaultValue = 16000000, .Index = CONFIG_RESPAWN_GUIDALERTLEVEL, .Min = 0, .Max = 16777215 },
851 { .Name = "Respawn.RestartQuietTime"sv, .DefaultValue = 3, .Index = CONFIG_RESPAWN_RESTARTQUIETTIME, .Min = 0, .Max = 23 },
852 { .Name = "Respawn.DynamicMinimumCreature"sv, .DefaultValue = 10, .Index = CONFIG_RESPAWN_DYNAMICMINIMUM_CREATURE },
853 { .Name = "Respawn.DynamicMinimumGameObject"sv, .DefaultValue = 10, .Index = CONFIG_RESPAWN_DYNAMICMINIMUM_GAMEOBJECT },
854 { .Name = "Respawn.WarningFrequency"sv, .DefaultValue = 1800, .Index = CONFIG_RESPAWN_GUIDWARNING_FREQUENCY },
855 { .Name = "MaxWhoListReturns"sv, .DefaultValue = 49, .Index = CONFIG_MAX_WHO },
856 { .Name = "WhoList.Update.Interval"sv, .DefaultValue = 5, .Index = CONFIG_WHO_LIST_UPDATE_INTERVAL, .Min = 1 },
857 { .Name = "HonorPointsAfterDuel"sv, .DefaultValue = 0, .Index = CONFIG_HONOR_AFTER_DUEL },
858 { .Name = "PvPToken.MapAllowType"sv, .DefaultValue = 4, .Index = CONFIG_PVP_TOKEN_MAP_TYPE, .Min = 1, .Max = 4 },
859 { .Name = "PvPToken.ItemID"sv, .DefaultValue = 29434, .Index = CONFIG_PVP_TOKEN_ID },
860 { .Name = "PvPToken.ItemCount"sv, .DefaultValue = 1, .Index = CONFIG_PVP_TOKEN_COUNT, .Min = 1 },
861 { .Name = "MapUpdate.Threads"sv, .DefaultValue = 1, .Index = CONFIG_NUMTHREADS, .Min = 1 },
862 { .Name = "Command.LookupMaxResults"sv, .DefaultValue = 0, .Index = CONFIG_MAX_RESULTS_LOOKUP_COMMANDS },
863 { .Name = "FeatureSystem.CharacterUndelete.Cooldown"sv, .DefaultValue = 2592000, .Index = CONFIG_FEATURE_SYSTEM_CHARACTER_UNDELETE_COOLDOWN },
864 { .Name = "DungeonFinder.OptionsMask"sv, .DefaultValue = 1, .Index = CONFIG_LFG_OPTIONSMASK },
865 { .Name = "Account.PasswordChangeSecurity"sv, .DefaultValue = 0, .Index = CONFIG_ACC_PASSCHANGESEC },
866 { .Name = "Battleground.RewardWinnerHonorFirst"sv, .DefaultValue = 27000, .Index = CONFIG_BG_REWARD_WINNER_HONOR_FIRST },
867 { .Name = "Battleground.RewardWinnerConquestFirst"sv, .DefaultValue = 10000, .Index = CONFIG_BG_REWARD_WINNER_CONQUEST_FIRST },
868 { .Name = "Battleground.RewardWinnerHonorLast"sv, .DefaultValue = 13500, .Index = CONFIG_BG_REWARD_WINNER_HONOR_LAST },
869 { .Name = "Battleground.RewardWinnerConquestLast"sv, .DefaultValue = 5000, .Index = CONFIG_BG_REWARD_WINNER_CONQUEST_LAST },
870 { .Name = "Battleground.RewardLoserHonorFirst"sv, .DefaultValue = 4500, .Index = CONFIG_BG_REWARD_LOSER_HONOR_FIRST },
871 { .Name = "Battleground.RewardLoserHonorLast"sv, .DefaultValue = 3500, .Index = CONFIG_BG_REWARD_LOSER_HONOR_LAST },
872 { .Name = "AccountInstancesPerHour"sv, .DefaultValue = 10, .Index = CONFIG_MAX_INSTANCES_PER_HOUR },
873 { .Name = "AutoBroadcast.Center"sv, .DefaultValue = 0, .Index = CONFIG_AUTOBROADCAST_CENTER },
874 { .Name = "AutoBroadcast.Timer"sv, .DefaultValue = 60000, .Index = CONFIG_AUTOBROADCAST_INTERVAL },
875 { .Name = "MaxPingTime"sv, .DefaultValue = 30, .Index = CONFIG_DB_PING_INTERVAL },
876 { .Name = "Guild.SaveInterval"sv, .DefaultValue = 15, .Index = CONFIG_GUILD_SAVE_INTERVAL },
877 { .Name = "Wintergrasp.PlayerMax"sv, .DefaultValue = 100, .Index = CONFIG_WINTERGRASP_PLR_MAX },
878 { .Name = "Wintergrasp.PlayerMin"sv, .DefaultValue = 0, .Index = CONFIG_WINTERGRASP_PLR_MIN },
879 { .Name = "Wintergrasp.PlayerMinLvl"sv, .DefaultValue = 77, .Index = CONFIG_WINTERGRASP_PLR_MIN_LVL },
880 { .Name = "Wintergrasp.BattleTimer"sv, .DefaultValue = 30, .Index = CONFIG_WINTERGRASP_BATTLETIME },
881 { .Name = "Wintergrasp.NoBattleTimer"sv, .DefaultValue = 150, .Index = CONFIG_WINTERGRASP_NOBATTLETIME },
882 { .Name = "Wintergrasp.CrashRestartTimer"sv, .DefaultValue = 10, .Index = CONFIG_WINTERGRASP_RESTART_AFTER_CRASH },
883 { .Name = "TolBarad.PlayerMax"sv, .DefaultValue = 100, .Index = CONFIG_TOLBARAD_PLR_MAX },
884 { .Name = "TolBarad.PlayerMin"sv, .DefaultValue = 0, .Index = CONFIG_TOLBARAD_PLR_MIN },
885 { .Name = "TolBarad.PlayerMinLvl"sv, .DefaultValue = 85, .Index = CONFIG_TOLBARAD_PLR_MIN_LVL },
886 { .Name = "TolBarad.BattleTimer"sv, .DefaultValue = 15, .Index = CONFIG_TOLBARAD_BATTLETIME },
887 { .Name = "TolBarad.BonusTime"sv, .DefaultValue = 5, .Index = CONFIG_TOLBARAD_BONUSTIME },
888 { .Name = "TolBarad.NoBattleTimer"sv, .DefaultValue = 150, .Index = CONFIG_TOLBARAD_NOBATTLETIME },
889 { .Name = "TolBarad.CrashRestartTimer"sv, .DefaultValue = 10, .Index = CONFIG_TOLBARAD_RESTART_AFTER_CRASH },
890 { .Name = "PacketSpoof.Policy"sv, .DefaultValue = WorldSession::DosProtection::POLICY_KICK, .Index = CONFIG_PACKET_SPOOF_POLICY },
891 { .Name = "PacketSpoof.BanMode"sv, .DefaultValue = BAN_ACCOUNT, .Index = CONFIG_PACKET_SPOOF_BANMODE, .Min = BAN_ACCOUNT, .Max = BAN_IP },
892 { .Name = "PacketSpoof.BanDuration"sv, .DefaultValue = 86400, .Index = CONFIG_PACKET_SPOOF_BANDURATION },
893 { .Name = "AuctionHouseBot.Update.Interval"sv, .DefaultValue = 20, .Index = CONFIG_AHBOT_UPDATE_INTERVAL },
894 { .Name = "BlackMarket.MaxAuctions"sv, .DefaultValue = 12, .Index = CONFIG_BLACKMARKET_MAXAUCTIONS },
895 { .Name = "BlackMarket.UpdatePeriod"sv, .DefaultValue = 24, .Index = CONFIG_BLACKMARKET_UPDATE_PERIOD },
896 { .Name = "Pvp.FactionBalance.LevelCheckDiff"sv, .DefaultValue = 0, .Index = CONFIG_FACTION_BALANCE_LEVEL_CHECK_DIFF },
897 } };
898
900 { {
901 { .Name = "CharacterCreating.Disabled.RaceMask"sv, .DefaultValue = 0, .Index = CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK },
902 { .Name = "StartPlayerMoney"sv, .DefaultValue = 0, .Index = CONFIG_START_PLAYER_MONEY, .Min = 0, .Max = MAX_MONEY_AMOUNT },
903 { .Name = "StartDeathKnightPlayerMoney"sv, .DefaultValue = 2000, .Index = CONFIG_START_DEATH_KNIGHT_PLAYER_MONEY, .Min = 0, .Max = MAX_MONEY_AMOUNT },
904 { .Name = "StartDemonHunterPlayerMoney"sv, .DefaultValue = 0, .Index = CONFIG_START_DEMON_HUNTER_PLAYER_MONEY, .Min = 0, .Max = MAX_MONEY_AMOUNT },
905 { .Name = "StartEvokerPlayerMoney"sv, .DefaultValue = 0, .Index = CONFIG_START_EVOKER_PLAYER_MONEY, .Min = 0, .Max = MAX_MONEY_AMOUNT },
906 { .Name = "StartAlliedRacePlayerMoney"sv, .DefaultValue = 10000, .Index = CONFIG_START_ALLIED_RACE_MONEY, .Min = 0, .Max = MAX_MONEY_AMOUNT },
907 } };
908
910 { {
911 { .Name = "MaxGroupXPDistance"sv, .DefaultValue = 74.0f, .Index = CONFIG_GROUP_XP_DISTANCE },
912 { .Name = "MaxRecruitAFriendBonusDistance"sv, .DefaultValue = 100.0f, .Index = CONFIG_MAX_RECRUIT_A_FRIEND_DISTANCE },
913 { .Name = "MonsterSight"sv, .DefaultValue = 50.0f, .Index = CONFIG_SIGHT_MONSTER },
914 { .Name = "CreatureFamilyFleeAssistanceRadius"sv, .DefaultValue = 30.0f, .Index = CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS },
915 { .Name = "CreatureFamilyAssistanceRadius"sv, .DefaultValue = 10.0f, .Index = CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS },
916 { .Name = "ThreatRadius"sv, .DefaultValue = 60.0f, .Index = CONFIG_THREAT_RADIUS },
917 { .Name = "ListenRange.Say"sv, .DefaultValue = 25.0f, .Index = CONFIG_LISTEN_RANGE_SAY },
918 { .Name = "ListenRange.TextEmote"sv, .DefaultValue = 25.0f, .Index = CONFIG_LISTEN_RANGE_TEXTEMOTE },
919 { .Name = "ListenRange.Yell"sv, .DefaultValue = 300.0f, .Index = CONFIG_LISTEN_RANGE_YELL },
920 { .Name = "Arena.ArenaWinRatingModifier1"sv, .DefaultValue = 48.0f, .Index = CONFIG_ARENA_WIN_RATING_MODIFIER_1 },
921 { .Name = "Arena.ArenaWinRatingModifier2"sv, .DefaultValue = 24.0f, .Index = CONFIG_ARENA_WIN_RATING_MODIFIER_2 },
922 { .Name = "Arena.ArenaLoseRatingModifier"sv, .DefaultValue = 24.0f, .Index = CONFIG_ARENA_LOSE_RATING_MODIFIER },
923 { .Name = "Arena.ArenaMatchmakerRatingModifier"sv, .DefaultValue = 24.0f, .Index = CONFIG_ARENA_MATCHMAKER_RATING_MODIFIER },
924 { .Name = "Visibility.Distance.Continents"sv, .DefaultValue = DEFAULT_VISIBILITY_DISTANCE, .Index = CONFIG_MAX_VISIBILITY_DISTANCE_CONTINENT, .Min = 0.0f, .Max = MAX_VISIBILITY_DISTANCE },
925 { .Name = "Visibility.Distance.Instances"sv, .DefaultValue = DEFAULT_VISIBILITY_INSTANCE, .Index = CONFIG_MAX_VISIBILITY_DISTANCE_INSTANCE, .Min = 0.0f, .Max = MAX_VISIBILITY_DISTANCE },
926 { .Name = "Visibility.Distance.BG"sv, .DefaultValue = DEFAULT_VISIBILITY_BGARENAS, .Index = CONFIG_MAX_VISIBILITY_DISTANCE_BATTLEGROUND, .Min = 0.0f, .Max = MAX_VISIBILITY_DISTANCE },
927 { .Name = "Visibility.Distance.Arenas"sv, .DefaultValue = DEFAULT_VISIBILITY_BGARENAS, .Index = CONFIG_MAX_VISIBILITY_DISTANCE_ARENA, .Min = 0.0f, .Max = MAX_VISIBILITY_DISTANCE },
928 { .Name = "Respawn.DynamicRateCreature"sv, .DefaultValue = 10.0f, .Index = CONFIG_RESPAWN_DYNAMICRATE_CREATURE, .Min = 0.0f },
929 { .Name = "Respawn.DynamicRateGameObject"sv, .DefaultValue = 10.0f, .Index = CONFIG_RESPAWN_DYNAMICRATE_GAMEOBJECT, .Min = 0.0f },
930 { .Name = "Stats.Limits.Dodge"sv, .DefaultValue = 95.0f, .Index = CONFIG_STATS_LIMITS_DODGE },
931 { .Name = "Stats.Limits.Parry"sv, .DefaultValue = 95.0f, .Index = CONFIG_STATS_LIMITS_PARRY },
932 { .Name = "Stats.Limits.Block"sv, .DefaultValue = 95.0f, .Index = CONFIG_STATS_LIMITS_BLOCK },
933 { .Name = "Stats.Limits.Crit"sv, .DefaultValue = 95.0f, .Index = CONFIG_STATS_LIMITS_CRIT },
934 { .Name = "Pvp.FactionBalance.Pct5"sv, .DefaultValue = 0.6f, .Index = CONFIG_CALL_TO_ARMS_5_PCT },
935 { .Name = "Pvp.FactionBalance.Pct10"sv, .DefaultValue = 0.7f, .Index = CONFIG_CALL_TO_ARMS_10_PCT },
936 { .Name = "Pvp.FactionBalance.Pct20"sv, .DefaultValue = 0.8f, .Index = CONFIG_CALL_TO_ARMS_20_PCT },
937 } };
938
940 { {
941 { .Name = "Rate.Health"sv, .DefaultValue = 1.0f, .Index = RATE_HEALTH, .Min = 0.01f },
942 { .Name = "Rate.Mana"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_MANA, .Min = 0.01f },
943 { .Name = "Rate.Rage.Gain"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_RAGE_INCOME, .Min = 0.01f },
944 { .Name = "Rate.Rage.Loss"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_RAGE_LOSS, .Min = 0.01f },
945 { .Name = "Rate.Focus"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_FOCUS, .Min = 0.01f },
946 { .Name = "Rate.Energy"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_ENERGY, .Min = 0.01f },
947 { .Name = "Rate.ComboPoints.Loss"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_COMBO_POINTS_LOSS, .Min = 0.01f },
948 { .Name = "Rate.RunicPower.Gain"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_RUNIC_POWER_INCOME, .Min = 0.01f },
949 { .Name = "Rate.RunicPower.Loss"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_RUNIC_POWER_LOSS, .Min = 0.01f },
950 { .Name = "Rate.SoulShards.Loss"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_SOUL_SHARDS, .Min = 0.01f },
951 { .Name = "Rate.LunarPower.Loss"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_LUNAR_POWER, .Min = 0.01f },
952 { .Name = "Rate.HolyPower.Loss"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_HOLY_POWER, .Min = 0.01f },
953 { .Name = "Rate.Maelstrom.Loss"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_MAELSTROM, .Min = 0.01f },
954 { .Name = "Rate.Chi.Loss"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_CHI, .Min = 0.01f },
955 { .Name = "Rate.Insanity.Loss"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_INSANITY, .Min = 0.01f },
956 { .Name = "Rate.ArcaneCharges.Loss"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_ARCANE_CHARGES, .Min = 0.01f },
957 { .Name = "Rate.Fury.Loss"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_FURY, .Min = 0.01f },
958 { .Name = "Rate.Pain.Loss"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_PAIN, .Min = 0.01f },
959 { .Name = "Rate.Essence.Loss"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_ESSENCE, .Min = 0.01f },
960 { .Name = "Rate.Skill.Discovery"sv, .DefaultValue = 1.0f, .Index = RATE_SKILL_DISCOVERY },
961 { .Name = "Rate.Drop.Item.Poor"sv, .DefaultValue = 1.0f, .Index = RATE_DROP_ITEM_POOR },
962 { .Name = "Rate.Drop.Item.Normal"sv, .DefaultValue = 1.0f, .Index = RATE_DROP_ITEM_NORMAL },
963 { .Name = "Rate.Drop.Item.Uncommon"sv, .DefaultValue = 1.0f, .Index = RATE_DROP_ITEM_UNCOMMON },
964 { .Name = "Rate.Drop.Item.Rare"sv, .DefaultValue = 1.0f, .Index = RATE_DROP_ITEM_RARE },
965 { .Name = "Rate.Drop.Item.Epic"sv, .DefaultValue = 1.0f, .Index = RATE_DROP_ITEM_EPIC },
966 { .Name = "Rate.Drop.Item.Legendary"sv, .DefaultValue = 1.0f, .Index = RATE_DROP_ITEM_LEGENDARY },
967 { .Name = "Rate.Drop.Item.Artifact"sv, .DefaultValue = 1.0f, .Index = RATE_DROP_ITEM_ARTIFACT },
968 { .Name = "Rate.Drop.Item.Referenced"sv, .DefaultValue = 1.0f, .Index = RATE_DROP_ITEM_REFERENCED },
969 { .Name = "Rate.Drop.Item.ReferencedAmount"sv, .DefaultValue = 1.0f, .Index = RATE_DROP_ITEM_REFERENCED_AMOUNT },
970 { .Name = "Rate.Drop.Money"sv, .DefaultValue = 1.0f, .Index = RATE_DROP_MONEY },
971 { .Name = "Rate.XP.Kill"sv, .DefaultValue = 1.0f, .Index = RATE_XP_KILL },
972 { .Name = "Rate.XP.BattlegroundKill"sv, .DefaultValue = 1.0f, .Index = RATE_XP_BG_KILL },
973 { .Name = "Rate.XP.Quest"sv, .DefaultValue = 1.0f, .Index = RATE_XP_QUEST },
974 { .Name = "Rate.XP.Explore"sv, .DefaultValue = 1.0f, .Index = RATE_XP_EXPLORE },
975 { .Name = "XP.Boost.Rate"sv, .DefaultValue = 2.0f, .Index = RATE_XP_BOOST },
976 { .Name = "Rate.RepairCost"sv, .DefaultValue = 1.0f, .Index = RATE_REPAIRCOST, .Min = 0.0f },
977 { .Name = "Rate.Reputation.Gain"sv, .DefaultValue = 1.0f, .Index = RATE_REPUTATION_GAIN },
978 { .Name = "Rate.Reputation.LowLevel.Kill"sv, .DefaultValue = 1.0f, .Index = RATE_REPUTATION_LOWLEVEL_KILL },
979 { .Name = "Rate.Reputation.LowLevel.Quest"sv, .DefaultValue = 1.0f, .Index = RATE_REPUTATION_LOWLEVEL_QUEST },
980 { .Name = "Rate.Reputation.RecruitAFriendBonus"sv, .DefaultValue = 0.1f, .Index = RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS},
981 { .Name = "Rate.Creature.HP.Normal"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_HP_NORMAL },
982 { .Name = "Rate.Creature.HP.Elite"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_HP_ELITE },
983 { .Name = "Rate.Creature.HP.RareElite"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_HP_RAREELITE },
984 { .Name = "Rate.Creature.HP.Obsolete"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_HP_OBSOLETE },
985 { .Name = "Rate.Creature.HP.Rare"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_HP_RARE },
986 { .Name = "Rate.Creature.HP.Trivial"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_HP_TRIVIAL },
987 { .Name = "Rate.Creature.HP.MinusMob"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_HP_MINUSMOB },
988 { .Name = "Rate.Creature.Damage.Normal"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_DAMAGE_NORMAL },
989 { .Name = "Rate.Creature.Damage.Elite"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_DAMAGE_ELITE },
990 { .Name = "Rate.Creature.Damage.RareElite"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_DAMAGE_RAREELITE },
991 { .Name = "Rate.Creature.Damage.Obsolete"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_DAMAGE_OBSOLETE },
992 { .Name = "Rate.Creature.Damage.Rare"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_DAMAGE_RARE },
993 { .Name = "Rate.Creature.Damage.Trivial"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_DAMAGE_TRIVIAL },
994 { .Name = "Rate.Creature.Damage.MinusMob"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_DAMAGE_MINUSMOB },
995 { .Name = "Rate.Creature.SpellDamage.Normal"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_SPELLDAMAGE_NORMAL },
996 { .Name = "Rate.Creature.SpellDamage.Elite"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_SPELLDAMAGE_ELITE },
997 { .Name = "Rate.Creature.SpellDamage.RareElite"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_SPELLDAMAGE_RAREELITE },
998 { .Name = "Rate.Creature.SpellDamage.Obsolete"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_SPELLDAMAGE_OBSOLETE },
999 { .Name = "Rate.Creature.SpellDamage.Rare"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_SPELLDAMAGE_RARE },
1000 { .Name = "Rate.Creature.SpellDamage.Trivial"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_SPELLDAMAGE_TRIVIAL },
1001 { .Name = "Rate.Creature.SpellDamage.MinusMob"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_SPELLDAMAGE_MINUSMOB },
1002 { .Name = "Rate.Creature.Aggro"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_AGGRO },
1003 { .Name = "Rate.Rest.InGame"sv, .DefaultValue = 1.0f, .Index = RATE_REST_INGAME },
1004 { .Name = "Rate.Rest.Offline.InTavernOrCity"sv, .DefaultValue = 1.0f, .Index = RATE_REST_OFFLINE_IN_TAVERN_OR_CITY },
1005 { .Name = "Rate.Rest.Offline.InWilderness"sv, .DefaultValue = 1.0f, .Index = RATE_REST_OFFLINE_IN_WILDERNESS },
1006 { .Name = "Rate.Damage.Fall"sv, .DefaultValue = 1.0f, .Index = RATE_DAMAGE_FALL },
1007 { .Name = "Rate.Auction.Time"sv, .DefaultValue = 1.0f, .Index = RATE_AUCTION_TIME },
1008 { .Name = "Rate.Auction.Deposit"sv, .DefaultValue = 1.0f, .Index = RATE_AUCTION_DEPOSIT },
1009 { .Name = "Rate.Auction.Cut"sv, .DefaultValue = 1.0f, .Index = RATE_AUCTION_CUT },
1010 { .Name = "Rate.Honor"sv, .DefaultValue = 1.0f, .Index = RATE_HONOR },
1011 { .Name = "Rate.InstanceResetTime"sv, .DefaultValue = 1.0f, .Index = RATE_INSTANCE_RESET_TIME },
1012 { .Name = "Rate.MoveSpeed"sv, .DefaultValue = 1.0f, .Index = RATE_MOVESPEED, .Min = 0.01f },
1013 { .Name = "Rate.Corpse.Decay.Looted"sv, .DefaultValue = 0.5f, .Index = RATE_CORPSE_DECAY_LOOTED },
1014 { .Name = "DurabilityLoss.OnDeath"sv, .DefaultValue = 10.0f, .Index = RATE_DURABILITY_LOSS_ON_DEATH, .Min = 0.0f, .Max = 100.0f },
1015 { .Name = "DurabilityLossChance.Damage"sv, .DefaultValue = 0.5f, .Index = RATE_DURABILITY_LOSS_DAMAGE, .Min = 0.0f },
1016 { .Name = "DurabilityLossChance.Absorb"sv, .DefaultValue = 0.5f, .Index = RATE_DURABILITY_LOSS_ABSORB, .Min = 0.0f },
1017 { .Name = "DurabilityLossChance.Parry"sv, .DefaultValue = 0.05f, .Index = RATE_DURABILITY_LOSS_PARRY, .Min = 0.0f },
1018 { .Name = "DurabilityLossChance.Block"sv, .DefaultValue = 0.05f, .Index = RATE_DURABILITY_LOSS_BLOCK, .Min = 0.0f },
1019 { .Name = "Rate.Quest.Money.Reward"sv, .DefaultValue = 1.0f, .Index = RATE_MONEY_QUEST, .Min = 0.0f },
1020 { .Name = "Rate.Quest.Money.Max.Level.Reward"sv, .DefaultValue = 1.0f, .Index = RATE_MONEY_MAX_LEVEL_QUEST, .Min = 0.0f },
1021 } };
1022
1023 for (ConfigOptionLoadDefinition<bool, WorldBoolConfigs> const& definition : bools)
1024 StoreConfigValue(m_bool_configs[definition.Index], sConfigMgr->GetBoolDefault(definition.Name, definition.DefaultValue), definition, reload);
1025
1026 for (ConfigOptionLoadDefinition<uint32, WorldIntConfigs> const& definition : ints)
1027 StoreConfigValue(m_int_configs[definition.Index], sConfigMgr->GetIntDefault(definition.Name, definition.DefaultValue), definition, reload);
1028
1029 for (ConfigOptionLoadDefinition<uint64, WorldInt64Configs> const& definition : int64s)
1030 StoreConfigValue(m_int64_configs[definition.Index], sConfigMgr->GetInt64Default(definition.Name, definition.DefaultValue), definition, reload);
1031
1032 for (ConfigOptionLoadDefinition<float, WorldFloatConfigs> const& definition : floats)
1033 StoreConfigValue(m_float_configs[definition.Index], sConfigMgr->GetFloatDefault(definition.Name, definition.DefaultValue), definition, reload);
1034
1035 for (ConfigOptionLoadDefinition<float, Rates> const& definition : rates)
1036 StoreConfigValue(rate_values[definition.Index], sConfigMgr->GetFloatDefault(definition.Name, definition.DefaultValue), definition, reload);
1037
1039 SetNewCharString(sConfigMgr->GetStringDefault("PlayerStart.String"sv, ""sv));
1040
1041 for (uint8 i = 0; i < MAX_MOVE_TYPE; ++i)
1043
1045
1047 {
1049 {
1050 TC_LOG_ERROR("server.loading", "BaseMapLoadAllGrids enabled, but GridUnload also enabled. GridUnload must be disabled to enable base map pre-loading. Base map pre-loading disabled");
1052 }
1054 {
1055 TC_LOG_ERROR("server.loading", "InstanceMapLoadAllGrids enabled, but GridUnload also enabled. GridUnload must be disabled to enable instance map pre-loading. Instance map pre-loading disabled");
1057 }
1058 }
1059
1060 // Config values are in "milliseconds" but we handle SocketTimeOut only as "seconds" so divide by 1000
1063
1064 // must be after CONFIG_CHARACTERS_PER_REALM
1066 {
1067 TC_LOG_ERROR("server.loading", "CharactersPerAccount ({}) can't be less than CharactersPerRealm ({}).", m_int_configs[CONFIG_CHARACTERS_PER_ACCOUNT], m_int_configs[CONFIG_CHARACTERS_PER_REALM]);
1069 }
1070
1071 auto validateStartLevel = [&](WorldIntConfigs config, char const* name)
1072 {
1074 if (m_int_configs[config] > maxLevel)
1075 {
1076 TC_LOG_ERROR("server.loading", "{} ({}) must be in range 1..MaxPlayerLevel({}). Set to {}.", name, m_int_configs[config], maxLevel, maxLevel);
1077 m_int_configs[config] = maxLevel;
1078 }
1079 };
1080
1081 validateStartLevel(CONFIG_START_PLAYER_LEVEL, "StartPlayerLevel");
1082 validateStartLevel(CONFIG_START_DEATH_KNIGHT_PLAYER_LEVEL, "StartDeathKnightPlayerLevel");
1083 validateStartLevel(CONFIG_START_DEMON_HUNTER_PLAYER_LEVEL, "StartDemonHunterPlayerLevel");
1084 validateStartLevel(CONFIG_START_ALLIED_RACE_LEVEL, "StartAlliedRacePlayerLevel");
1085 validateStartLevel(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL, "RecruitAFriend.MaxLevel");
1086
1088 {
1089 TC_LOG_ERROR("server.loading", "GM.StartLevel ({}) must be in range StartPlayerLevel({})..{}. Set to {}.",
1092 }
1093
1094 TC_LOG_INFO("server.loading", "Will clear `logs` table of entries older than {} seconds every {} minutes.",
1096
1098 {
1099 TC_LOG_ERROR("server.loading", "MaxOverspeedPings ({}) must be in range 2..infinity (or 0 to disable check). Set to 2.", m_int_configs[CONFIG_MAX_OVERSPEED_PINGS]);
1101 }
1102
1103 // always use declined names in the russian client
1104 if (Cfg_CategoriesEntry const* category = sCfgCategoriesStore.LookupEntry(m_int_configs[CONFIG_REALM_ZONE]))
1105 if (category->GetCreateCharsetMask().HasFlag(CfgCategoriesCharsets::Russian))
1107
1109 m_int_configs[CONFIG_CLIENTCACHE_VERSION] = databaseCacheVersion;
1110
1111 TC_LOG_INFO("server.loading", "Client cache version set to: {}", m_int_configs[CONFIG_CLIENTCACHE_VERSION]);
1112
1113 auto validateVisibilityDistance = [&](WorldFloatConfigs config, char const* name)
1114 {
1115 float minVisibilityDistance = 45.0f * rate_values[RATE_CREATURE_AGGRO];
1116 if (m_float_configs[config] < minVisibilityDistance)
1117 {
1118 TC_LOG_ERROR("server.loading", "{} can't be less max aggro radius {}", name, minVisibilityDistance);
1119 m_float_configs[config] = minVisibilityDistance;
1120 }
1121 };
1122
1123 // visibility on continents
1124 validateVisibilityDistance(CONFIG_MAX_VISIBILITY_DISTANCE_CONTINENT, "Visibility.Distance.Continents");
1125
1126 // visibility in instances
1127 validateVisibilityDistance(CONFIG_MAX_VISIBILITY_DISTANCE_INSTANCE, "Visibility.Distance.Instances");
1128
1129 // visibility in BG
1130 validateVisibilityDistance(CONFIG_MAX_VISIBILITY_DISTANCE_BATTLEGROUND, "Visibility.Distance.BG");
1131
1132 // Visibility in Arenas
1133 validateVisibilityDistance(CONFIG_MAX_VISIBILITY_DISTANCE_ARENA, "Visibility.Distance.Arenas");
1134
1135 // No aggro from gray mobs
1137 {
1138 TC_LOG_ERROR("server.loading", "NoGrayAggro.Above ({}) must be in range 0..{}. Set to {}.", m_int_configs[CONFIG_NO_GRAY_AGGRO_ABOVE], m_int_configs[CONFIG_MAX_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL]);
1140 }
1142 {
1143 TC_LOG_ERROR("server.loading", "NoGrayAggro.Below ({}) must be in range 0..{}. Set to {}.", m_int_configs[CONFIG_NO_GRAY_AGGRO_BELOW], m_int_configs[CONFIG_MAX_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL]);
1145 }
1147 {
1148 TC_LOG_ERROR("server.loading", "NoGrayAggro.Below ({}) cannot be greater than NoGrayAggro.Above ({}). Set to {}.", m_int_configs[CONFIG_NO_GRAY_AGGRO_BELOW], m_int_configs[CONFIG_NO_GRAY_AGGRO_ABOVE], m_int_configs[CONFIG_NO_GRAY_AGGRO_ABOVE]);
1150 }
1151
1152 // Respawn Settings
1153 _guidWarningMsg = sConfigMgr->GetStringDefault("Respawn.WarningMessage"sv, "There will be an unscheduled server restart at 03:00. The server will be available again shortly after."sv);
1154 _alertRestartReason = sConfigMgr->GetStringDefault("Respawn.AlertRestartReason"sv, "Urgent Maintenance"sv);
1155
1157 std::string dataPath = sConfigMgr->GetStringDefault("DataDir"sv, "./"sv);
1158 if (dataPath.empty() || (dataPath.back() != '/' && dataPath.back() != '\\'))
1159 dataPath.push_back('/');
1160
1161 if (dataPath[0] == '~')
1162 {
1163#if TRINITY_PLATFORM != TRINITY_PLATFORM_WINDOWS
1164#define USER_HOME_DIRECTORY_VARIABLE "HOME"
1165#else
1166#define USER_HOME_DIRECTORY_VARIABLE "USERPROFILE"
1167#endif
1168 if (char const* home = std::getenv(USER_HOME_DIRECTORY_VARIABLE))
1169 dataPath.replace(0, 1, home);
1170#undef USER_HOME_DIRECTORY_VARIABLE
1171 }
1172
1173 if (reload)
1174 {
1175 if (dataPath != m_dataPath)
1176 TC_LOG_ERROR("server.loading", "DataDir option can't be changed at worldserver.conf reload, using current value ({}).", m_dataPath);
1177 }
1178 else
1179 {
1180 m_dataPath = std::move(dataPath);
1181 TC_LOG_INFO("server.loading", "Using DataDir {}", m_dataPath);
1182 }
1183
1184 TC_LOG_INFO("server.loading", "WORLD: MMap data directory is: {}mmaps", m_dataPath);
1185
1186 bool enableLOS = sConfigMgr->GetBoolDefault("vmap.enableLOS"sv, true);
1187 bool enableHeight = sConfigMgr->GetBoolDefault("vmap.enableHeight"sv, true);
1188
1189 if (!enableHeight)
1190 TC_LOG_ERROR("server.loading", "VMap height checking disabled! Creatures movements and other various things WILL be broken! Expect no support.");
1191
1194 TC_LOG_INFO("server.loading", "VMap support included. LineOfSight: {}, getHeight: {}, indoorCheck: {}", enableLOS, enableHeight, m_bool_configs[CONFIG_VMAP_INDOOR_CHECK]);
1195 TC_LOG_INFO("server.loading", "VMap data directory is: {}vmaps", m_dataPath);
1196
1198 TC_LOG_WARN("server.loading", "PlayerStart.AllSpells enabled - may not function as intended!");
1199
1200 //packet spoof punishment
1203
1204 _gameRules =
1205 {
1206 { .Rule = ::GameRule::TransmogEnabled, .Value = true },
1207 { .Rule = ::GameRule::HousingEnabled, .Value = true }
1208 };
1209
1210 if (reload)
1211 {
1212 sSupportMgr->SetSupportSystemStatus(m_bool_configs[CONFIG_SUPPORT_ENABLED]);
1217 sMapMgr->SetGridCleanUpDelay(m_int_configs[CONFIG_INTERVAL_GRIDCLEAN]);
1218 sMapMgr->SetMapUpdateInterval(m_int_configs[CONFIG_INTERVAL_MAPUPDATE]);
1229
1230 // call ScriptMgr if we're reloading the configuration
1231 sScriptMgr->OnConfigLoad(reload);
1232 }
1233}
1234
1237{
1238 sLog->SetRealmId(sRealmList->GetCurrentRealmId().Realm);
1239
1241 uint32 startupBegin = getMSTime();
1242
1244 srand((unsigned int)GameTime::GetGameTime());
1245
1247 dtAllocSetCustom(dtCustomAlloc, dtCustomFree);
1248
1253
1256
1259
1261 sObjectMgr->SetHighestGuids();
1262
1264 if (!TerrainMgr::ExistMapAndVMap(0, -6240.32f, 331.033f)
1265 || !TerrainMgr::ExistMapAndVMap(0, -8949.95f, -132.493f)
1266 || !TerrainMgr::ExistMapAndVMap(1, -618.518f, -4251.67f)
1267 || !TerrainMgr::ExistMapAndVMap(0, 1676.35f, 1677.45f)
1268 || !TerrainMgr::ExistMapAndVMap(1, 10311.3f, 832.463f)
1269 || !TerrainMgr::ExistMapAndVMap(1, -2917.58f, -257.98f)
1271 !TerrainMgr::ExistMapAndVMap(530, 10349.6f, -6357.29f) ||
1272 !TerrainMgr::ExistMapAndVMap(530, -3961.64f, -13931.2f))))
1273 {
1274 TC_LOG_FATAL("server.loading", "Unable to load map and vmap data for starting zones - server shutting down!");
1275 return false;
1276 }
1277
1279 sPoolMgr->Initialize();
1280
1282 sGameEventMgr->Initialize();
1283
1285
1286 TC_LOG_INFO("server.loading", "Loading Trinity strings...");
1287 if (!sObjectMgr->LoadTrinityStrings())
1288 return false; // Error message displayed in function already
1289
1291 //No SQL injection as values are treated as integers
1292
1293 // not send custom type REALM_FFA_PVP to realm list
1296
1297 LoginDatabase.PExecute("UPDATE realmlist SET icon = {}, timezone = {} WHERE id = '{}'", server_type, realm_zone, sRealmList->GetCurrentRealmId().Realm); // One-time query
1298
1299 TC_LOG_INFO("server.loading", "Loading GameObject models...");
1301 {
1302 TC_LOG_FATAL("server.loading", "Unable to load gameobject models (part of vmaps), objects using WMO models will crash the client - server shutting down!");
1303 return false;
1304 }
1305
1306 TC_LOG_INFO("server.loading", "Initialize data stores...");
1310 {
1311 TC_LOG_FATAL("server.loading", "Unable to load db2 files for {} locale specified in DBC.Locale config!", localeNames[m_defaultDbcLocale]);
1312 return false;
1313 }
1314
1315 TC_LOG_INFO("server.loading", "Loading hotfix blobs...");
1316 sDB2Manager.LoadHotfixBlob(m_availableDbcLocaleMask);
1317 TC_LOG_INFO("server.loading", "Loading hotfix info...");
1318 sDB2Manager.LoadHotfixData(m_availableDbcLocaleMask);
1319 TC_LOG_INFO("server.loading", "Loading hotfix optional data...");
1320 sDB2Manager.LoadHotfixOptionalData(m_availableDbcLocaleMask);
1321 TC_LOG_INFO("server.loading", "Indexing loaded data stores...");
1322 sDB2Manager.IndexLoadedStores();
1327
1328 //Load weighted graph on taxi nodes path
1330 // Load IP Location Database
1331 sIPLocation->Load();
1332
1333 // always use declined names in the russian client
1334 if (Cfg_CategoriesEntry const* category = sCfgCategoriesStore.LookupEntry(m_int_configs[CONFIG_REALM_ZONE]))
1335 if (category->GetCreateCharsetMask().HasFlag(CfgCategoriesCharsets::Russian))
1337
1338 std::unordered_map<uint32, std::vector<uint32>> mapData;
1339 for (MapEntry const* mapEntry : sMapStore)
1340 {
1341 mapData.emplace(std::piecewise_construct, std::forward_as_tuple(mapEntry->ID), std::forward_as_tuple());
1342 if (mapEntry->ParentMapID != -1)
1343 {
1344 ASSERT(mapEntry->CosmeticParentMapID == -1 || mapEntry->ParentMapID == mapEntry->CosmeticParentMapID,
1345 "Inconsistent parent map data for map %u (ParentMapID = %hd, CosmeticParentMapID = %hd)",
1346 mapEntry->ID, mapEntry->ParentMapID, mapEntry->CosmeticParentMapID);
1347
1348 mapData[mapEntry->ParentMapID].push_back(mapEntry->ID);
1349 }
1350 else if (mapEntry->CosmeticParentMapID != -1)
1351 mapData[mapEntry->CosmeticParentMapID].push_back(mapEntry->ID);
1352 }
1353
1354 sTerrainMgr.InitializeParentMapData(mapData);
1355
1356 vmmgr2->InitializeThreadUnsafe(mapData);
1357
1359 mmmgr->InitializeThreadUnsafe(mapData);
1360
1363
1364 TC_LOG_INFO("server.loading", "Initializing PlayerDump tables...");
1366
1367 TC_LOG_INFO("server.loading", "Loading SpellInfo store...");
1368 sSpellMgr->LoadSpellInfoStore();
1369
1370 TC_LOG_INFO("server.loading", "Loading serverside spells...");
1371 sSpellMgr->LoadSpellInfoServerside();
1372
1373 TC_LOG_INFO("server.loading", "Loading SpellInfo corrections...");
1374 sSpellMgr->LoadSpellInfoCorrections();
1375
1376 TC_LOG_INFO("server.loading", "Loading SkillLineAbilityMultiMap Data...");
1377 sSpellMgr->LoadSkillLineAbilityMap();
1378
1379 TC_LOG_INFO("server.loading", "Loading SpellInfo custom attributes...");
1380 sSpellMgr->LoadSpellInfoCustomAttributes();
1381
1382 TC_LOG_INFO("server.loading", "Loading SpellInfo diminishing infos...");
1383 sSpellMgr->LoadSpellInfoDiminishing();
1384
1385 TC_LOG_INFO("server.loading", "Loading SpellInfo immunity infos...");
1386 sSpellMgr->LoadSpellInfoImmunities();
1387
1388 TC_LOG_INFO("server.loading", "Loading SpellInfo target caps...");
1389 sSpellMgr->LoadSpellInfoTargetCaps();
1390
1391 TC_LOG_INFO("server.loading", "Loading PetFamilySpellsStore Data...");
1392 sSpellMgr->LoadPetFamilySpellsStore();
1393
1394 TC_LOG_INFO("server.loading", "Loading Spell Totem models...");
1395 sSpellMgr->LoadSpellTotemModel();
1396
1397 TC_LOG_INFO("server.loading", "Loading Traits...");
1399
1400 TC_LOG_INFO("server.loading", "Loading languages..."); // must be after LoadSpellInfoStore and LoadSkillLineAbilityMap
1401 sLanguageMgr->LoadLanguages();
1402
1403 TC_LOG_INFO("server.loading", "Loading languages words...");
1404 sLanguageMgr->LoadLanguagesWords();
1405
1406 TC_LOG_INFO("server.loading", "Loading Instance Template...");
1407 sObjectMgr->LoadInstanceTemplate();
1408
1409 // Must be called before `respawn` data
1410 TC_LOG_INFO("server.loading", "Loading instances...");
1411 sMapMgr->InitInstanceIds();
1412 sInstanceLockMgr.Load();
1413
1414 TC_LOG_INFO("server.loading", "Loading Localization strings...");
1415 uint32 oldMSTime = getMSTime();
1417 {
1418 sObjectMgr->LoadCreatureLocales();
1419 sObjectMgr->LoadGameObjectLocales();
1420 sObjectMgr->LoadQuestTemplateLocale();
1421 sObjectMgr->LoadQuestOfferRewardLocale();
1422 sObjectMgr->LoadQuestRequestItemsLocale();
1423 sObjectMgr->LoadQuestObjectivesLocale();
1424 sObjectMgr->LoadPageTextLocales();
1425 sObjectMgr->LoadGossipMenuItemsLocales();
1426 sObjectMgr->LoadPointOfInterestLocales();
1427 }
1428
1429 sObjectMgr->SetDBCLocaleIndex(GetDefaultDbcLocale()); // Get once for all the locale index of DBC language (console/broadcasts)
1430 TC_LOG_INFO("server.loading", ">> Localization strings loaded in {} ms", GetMSTimeDiffToNow(oldMSTime));
1431
1432 TC_LOG_INFO("server.loading", "Loading Account Roles and Permissions...");
1433 sAccountMgr->LoadRBAC();
1434
1435 TC_LOG_INFO("server.loading", "Loading Page Texts...");
1436 sObjectMgr->LoadPageTexts();
1437
1438 TC_LOG_INFO("server.loading", "Loading Game Object Templates..."); // must be after LoadPageTexts
1439 sObjectMgr->LoadDestructibleHitpoints();
1440 sObjectMgr->LoadGameObjectTemplate();
1441
1442 TC_LOG_INFO("server.loading", "Loading Game Object template addons...");
1443 sObjectMgr->LoadGameObjectTemplateAddons();
1444
1445 TC_LOG_INFO("server.loading", "Loading Transport templates...");
1446 sTransportMgr->LoadTransportTemplates();
1447
1448 TC_LOG_INFO("server.loading", "Loading Transport animations and rotations...");
1449 sTransportMgr->LoadTransportAnimationAndRotation();
1450
1451 TC_LOG_INFO("server.loading", "Loading Transport spawns...");
1452 sTransportMgr->LoadTransportSpawns();
1453
1454 TC_LOG_INFO("server.loading", "Loading Spell Rank Data...");
1455 sSpellMgr->LoadSpellRanks();
1456
1457 TC_LOG_INFO("server.loading", "Loading Spell Required Data...");
1458 sSpellMgr->LoadSpellRequired();
1459
1460 TC_LOG_INFO("server.loading", "Loading Spell Group types...");
1461 sSpellMgr->LoadSpellGroups();
1462
1463 TC_LOG_INFO("server.loading", "Loading Spell Learn Skills...");
1464 sSpellMgr->LoadSpellLearnSkills(); // must be after LoadSpellRanks
1465
1466 TC_LOG_INFO("server.loading", "Loading SpellInfo SpellSpecific and AuraState...");
1467 sSpellMgr->LoadSpellInfoSpellSpecificAndAuraState(); // must be after LoadSpellRanks
1468
1469 TC_LOG_INFO("server.loading", "Loading Spell Learn Spells...");
1470 sSpellMgr->LoadSpellLearnSpells();
1471
1472 TC_LOG_INFO("server.loading", "Loading Spell Proc conditions and data...");
1473 sSpellMgr->LoadSpellProcs();
1474
1475 TC_LOG_INFO("server.loading", "Loading Aggro Spells Definitions...");
1476 sSpellMgr->LoadSpellThreats();
1477
1478 TC_LOG_INFO("server.loading", "Loading Spell Group Stack Rules...");
1479 sSpellMgr->LoadSpellGroupStackRules();
1480
1481 TC_LOG_INFO("server.loading", "Loading NPC Texts...");
1482 sObjectMgr->LoadNPCText();
1483
1484 TC_LOG_INFO("server.loading", "Loading Enchant Spells Proc datas...");
1485 sSpellMgr->LoadSpellEnchantProcData();
1486
1487 TC_LOG_INFO("server.loading", "Loading item bonus data...");
1489
1490 TC_LOG_INFO("server.loading", "Loading Random item bonus list definitions...");
1492
1493 TC_LOG_INFO("server.loading", "Loading Disables"); // must be before loading quests and items
1495
1496 TC_LOG_INFO("server.loading", "Loading Items..."); // must be after LoadRandomEnchantmentsTable and LoadPageTexts
1497 sObjectMgr->LoadItemTemplates();
1498
1499 TC_LOG_INFO("server.loading", "Loading Item set names..."); // must be after LoadItemPrototypes
1500 sObjectMgr->LoadItemTemplateAddon();
1501
1502 TC_LOG_INFO("misc", "Loading Item Scripts..."); // must be after LoadItemPrototypes
1503 sObjectMgr->LoadItemScriptNames();
1504
1505 TC_LOG_INFO("server.loading", "Loading Creature Model Based Info Data...");
1506 sObjectMgr->LoadCreatureModelInfo();
1507
1508 TC_LOG_INFO("server.loading", "Loading Creature templates...");
1509 sObjectMgr->LoadCreatureTemplates();
1510
1511 TC_LOG_INFO("server.loading", "Loading Equipment templates..."); // must be after LoadCreatureTemplates
1512 sObjectMgr->LoadEquipmentTemplates();
1513
1514 TC_LOG_INFO("server.loading", "Loading Creature template addons...");
1515 sObjectMgr->LoadCreatureTemplateAddons();
1516
1517 TC_LOG_INFO("server.loading", "Loading Creature template difficulty...");
1518 sObjectMgr->LoadCreatureTemplateDifficulty();
1519
1520 TC_LOG_INFO("server.loading", "Loading Creature template sparring...");
1521 sObjectMgr->LoadCreatureTemplateSparring();
1522
1523 TC_LOG_INFO("server.loading", "Loading Reputation Reward Rates...");
1524 sObjectMgr->LoadReputationRewardRate();
1525
1526 TC_LOG_INFO("server.loading", "Loading Creature Reputation OnKill Data...");
1527 sObjectMgr->LoadReputationOnKill();
1528
1529 TC_LOG_INFO("server.loading", "Loading Reputation Spillover Data...");
1530 sObjectMgr->LoadReputationSpilloverTemplate();
1531
1532 TC_LOG_INFO("server.loading", "Loading Points Of Interest Data...");
1533 sObjectMgr->LoadPointsOfInterest();
1534
1535 TC_LOG_INFO("server.loading", "Loading Creature Base Stats...");
1536 sObjectMgr->LoadCreatureClassLevelStats();
1537
1538 TC_LOG_INFO("server.loading", "Loading Spawn Group Templates...");
1539 sObjectMgr->LoadSpawnGroupTemplates();
1540
1541 TC_LOG_INFO("server.loading", "Loading Creature Data...");
1542 sObjectMgr->LoadCreatures();
1543
1544 TC_LOG_INFO("server.loading", "Loading Temporary Summon Data...");
1545 sObjectMgr->LoadTempSummons(); // must be after LoadCreatureTemplates() and LoadGameObjectTemplates()
1546
1547 TC_LOG_INFO("server.loading", "Loading pet levelup spells...");
1548 sSpellMgr->LoadPetLevelupSpellMap();
1549
1550 TC_LOG_INFO("server.loading", "Loading pet default spells additional to levelup spells...");
1551 sSpellMgr->LoadPetDefaultSpells();
1552
1553 TC_LOG_INFO("server.loading", "Loading Creature Addon Data...");
1554 sObjectMgr->LoadCreatureAddons(); // must be after LoadCreatureTemplates() and LoadCreatures()
1555
1556 TC_LOG_INFO("server.loading", "Loading Creature Movement Overrides...");
1557 sObjectMgr->LoadCreatureMovementOverrides(); // must be after LoadCreatures()
1558
1559 TC_LOG_INFO("server.loading", "Loading Gameobject Data...");
1560 sObjectMgr->LoadGameObjects();
1561
1562 TC_LOG_INFO("server.loading", "Loading Spawn Group Data...");
1563 sObjectMgr->LoadSpawnGroups();
1564
1565 TC_LOG_INFO("server.loading", "Loading instance spawn groups...");
1566 sObjectMgr->LoadInstanceSpawnGroups();
1567
1568 TC_LOG_INFO("server.loading", "Loading GameObject Addon Data...");
1569 sObjectMgr->LoadGameObjectAddons(); // must be after LoadGameObjects()
1570
1571 TC_LOG_INFO("server.loading", "Loading GameObject faction and flags overrides...");
1572 sObjectMgr->LoadGameObjectOverrides(); // must be after LoadGameObjects()
1573
1574 TC_LOG_INFO("server.loading", "Loading GameObject Quest Items...");
1575 sObjectMgr->LoadGameObjectQuestItems();
1576
1577 TC_LOG_INFO("server.loading", "Loading Creature Quest Items...");
1578 sObjectMgr->LoadCreatureQuestItems();
1579
1580 TC_LOG_INFO("server.loading", "Loading Creature Quest Currencies...");
1581 sObjectMgr->LoadCreatureQuestCurrencies();
1582
1583 TC_LOG_INFO("server.loading", "Loading Creature Linked Respawn...");
1584 sObjectMgr->LoadLinkedRespawn(); // must be after LoadCreatures(), LoadGameObjects()
1585
1586 TC_LOG_INFO("server.loading", "Loading Weather Data...");
1588
1589 TC_LOG_INFO("server.loading", "Loading Quests...");
1591 sObjectMgr->LoadQuests(); // must be loaded after DBCs, creature_template, items, gameobject tables
1592
1593 TC_LOG_INFO("server.loading", "Checking Quest Disables");
1594 DisableMgr::CheckQuestDisables(); // must be after loading quests
1595
1596 TC_LOG_INFO("server.loading", "Loading Quest POI");
1597 sObjectMgr->LoadQuestPOI();
1598
1599 TC_LOG_INFO("server.loading", "Loading Quests Starters and Enders...");
1600 sObjectMgr->LoadQuestStartersAndEnders(); // must be after quest load
1601
1602 TC_LOG_INFO("server.loading", "Loading Quest Greetings...");
1603 sObjectMgr->LoadQuestGreetings();
1604
1606 sObjectMgr->LoadQuestGreetingLocales();
1607
1608 TC_LOG_INFO("server.loading", "Loading Objects Pooling Data...");
1609 sPoolMgr->LoadFromDB();
1610 TC_LOG_INFO("server.loading", "Loading Quest Pooling Data...");
1611 sQuestPoolMgr->LoadFromDB(); // must be after quest templates
1612
1613 TC_LOG_INFO("server.loading", "Loading World State templates...");
1614 WorldStateMgr::LoadFromDB(); // must be loaded before battleground, outdoor PvP, game events and conditions
1615
1616 TC_LOG_INFO("server.loading", "Loading Game Event Data..."); // must be after loading pools fully
1617 sGameEventMgr->LoadFromDB();
1618
1619 TC_LOG_INFO("server.loading", "Loading creature summoned data...");
1620 sObjectMgr->LoadCreatureSummonedData(); // must be after LoadCreatureTemplates() and LoadQuests()
1621
1622 TC_LOG_INFO("server.loading", "Loading UNIT_NPC_FLAG_SPELLCLICK Data..."); // must be after LoadQuests
1623 sObjectMgr->LoadNPCSpellClickSpells();
1624
1625 TC_LOG_INFO("server.loading", "Loading Vehicle Templates...");
1626 sObjectMgr->LoadVehicleTemplate(); // must be after LoadCreatureTemplates()
1627
1628 TC_LOG_INFO("server.loading", "Loading Vehicle Template Accessories...");
1629 sObjectMgr->LoadVehicleTemplateAccessories(); // must be after LoadCreatureTemplates() and LoadNPCSpellClickSpells()
1630
1631 TC_LOG_INFO("server.loading", "Loading Vehicle Accessories...");
1632 sObjectMgr->LoadVehicleAccessories(); // must be after LoadCreatureTemplates() and LoadNPCSpellClickSpells()
1633
1634 TC_LOG_INFO("server.loading", "Loading Vehicle Seat Addon Data...");
1635 sObjectMgr->LoadVehicleSeatAddon(); // must be after loading DBC
1636
1637 TC_LOG_INFO("server.loading", "Loading SpellArea Data..."); // must be after quest load
1638 sSpellMgr->LoadSpellAreas();
1639
1640 TC_LOG_INFO("server.loading", "Loading World locations...");
1641 sObjectMgr->LoadWorldSafeLocs(); // must be before LoadAreaTriggerTeleports and LoadGraveyardZones
1642
1643 TC_LOG_INFO("server.loading", "Loading Area Trigger Teleports definitions...");
1644 sObjectMgr->LoadAreaTriggerTeleports();
1645
1646 TC_LOG_INFO("server.loading", "Loading Area Trigger Polygon data...");
1647 sObjectMgr->LoadAreaTriggerPolygons();
1648
1649 TC_LOG_INFO("server.loading", "Loading Access Requirements...");
1650 sObjectMgr->LoadAccessRequirements(); // must be after item template load
1651
1652 TC_LOG_INFO("server.loading", "Loading Quest Area Triggers...");
1653 sObjectMgr->LoadQuestAreaTriggers(); // must be after LoadQuests
1654
1655 TC_LOG_INFO("server.loading", "Loading Tavern Area Triggers...");
1656 sObjectMgr->LoadTavernAreaTriggers();
1657
1658 TC_LOG_INFO("server.loading", "Loading AreaTrigger script names...");
1659 sObjectMgr->LoadAreaTriggerScripts();
1660
1661 TC_LOG_INFO("server.loading", "Loading LFG entrance positions..."); // Must be after areatriggers
1662 sLFGMgr->LoadLFGDungeons();
1663
1664 TC_LOG_INFO("server.loading", "Loading LFG rewards...");
1665 sLFGMgr->LoadRewards();
1666
1667 TC_LOG_INFO("server.loading", "Loading Graveyard-zone links...");
1668 sObjectMgr->LoadGraveyardZones();
1669
1670 TC_LOG_INFO("server.loading", "Loading spell pet auras...");
1671 sSpellMgr->LoadSpellPetAuras();
1672
1673 TC_LOG_INFO("server.loading", "Loading Spell target coordinates...");
1674 sSpellMgr->LoadSpellTargetPositions();
1675
1676 TC_LOG_INFO("server.loading", "Loading linked spells...");
1677 sSpellMgr->LoadSpellLinked();
1678
1679 TC_LOG_INFO("server.loading", "Loading Scenes Templates..."); // must be before LoadPlayerInfo
1680 sObjectMgr->LoadSceneTemplates();
1681
1682 TC_LOG_INFO("server.loading", "Loading Player Create Data...");
1683 sObjectMgr->LoadPlayerInfo();
1684
1685 TC_LOG_INFO("server.loading", "Loading Exploration BaseXP Data...");
1686 sObjectMgr->LoadExplorationBaseXP();
1687
1688 TC_LOG_INFO("server.loading", "Loading Pet Name Parts...");
1689 sObjectMgr->LoadPetNames();
1690
1691 TC_LOG_INFO("server.loading", "Loading AreaTrigger Templates...");
1692 sAreaTriggerDataStore->LoadAreaTriggerTemplates();
1693
1694 TC_LOG_INFO("server.loading", "Loading AreaTrigger Spawns...");
1695 sAreaTriggerDataStore->LoadAreaTriggerSpawns();
1696
1697 TC_LOG_INFO("server.loading", "Loading Conversation Templates...");
1698 sConversationDataStore->LoadConversationTemplates();
1699
1700 TC_LOG_INFO("server.loading", "Loading Player Choices...");
1701 sObjectMgr->LoadPlayerChoices();
1702
1703 TC_LOG_INFO("server.loading", "Loading Spawn Tracking Templates...");
1704 sObjectMgr->LoadSpawnTrackingTemplates();
1705
1706 TC_LOG_INFO("server.loading", "Loading Spawn Tracking Quest Objectives...");
1707 sObjectMgr->LoadSpawnTrackingQuestObjectives();
1708
1709 TC_LOG_INFO("server.loading", "Loading Spawn Tracking Spawns...");
1710 sObjectMgr->LoadSpawnTrackings();
1711
1712 TC_LOG_INFO("server.loading", "Loading Spawn Tracking Spawn States...");
1713 sObjectMgr->LoadSpawnTrackingStates();
1714
1716 {
1717 TC_LOG_INFO("server.loading", "Loading Player Choices Locales...");
1718 sObjectMgr->LoadPlayerChoicesLocale();
1719 }
1720
1721 TC_LOG_INFO("server.loading", "Loading UIMap questlines...");
1722 sObjectMgr->LoadUiMapQuestLines();
1723
1724 TC_LOG_INFO("server.loading", "Loading UIMap quests...");
1725 sObjectMgr->LoadUiMapQuests();
1726
1727 TC_LOG_INFO("server.loading", "Loading Jump Charge Params...");
1728 sObjectMgr->LoadJumpChargeParams();
1729
1731
1732 TC_LOG_INFO("server.loading", "Loading the max pet number...");
1733 sObjectMgr->LoadPetNumber();
1734
1735 TC_LOG_INFO("server.loading", "Loading pet level stats...");
1736 sObjectMgr->LoadPetLevelInfo();
1737
1738 TC_LOG_INFO("server.loading", "Loading Player level dependent mail rewards...");
1739 sObjectMgr->LoadMailLevelRewards();
1740
1741 // Loot tables
1743
1744 TC_LOG_INFO("server.loading", "Loading Skill Discovery Table...");
1746
1747 TC_LOG_INFO("server.loading", "Loading Skill Extra Item Table...");
1749
1750 TC_LOG_INFO("server.loading", "Loading Skill Perfection Data Table...");
1752
1753 TC_LOG_INFO("server.loading", "Loading Skill Fishing base level requirements...");
1754 sObjectMgr->LoadFishingBaseSkillLevel();
1755
1756 TC_LOG_INFO("server.loading", "Loading skill tier info...");
1757 sObjectMgr->LoadSkillTiers();
1758
1759 TC_LOG_INFO("server.loading", "Loading Criteria Modifier trees...");
1760 sCriteriaMgr->LoadCriteriaModifiersTree();
1761 TC_LOG_INFO("server.loading", "Loading Criteria Lists...");
1762 sCriteriaMgr->LoadCriteriaList();
1763 TC_LOG_INFO("server.loading", "Loading Criteria Data...");
1764 sCriteriaMgr->LoadCriteriaData();
1765 TC_LOG_INFO("server.loading", "Loading Achievements...");
1766 sAchievementMgr->LoadAchievementReferenceList();
1767 TC_LOG_INFO("server.loading", "Loading Achievements Scripts...");
1768 sAchievementMgr->LoadAchievementScripts();
1769 TC_LOG_INFO("server.loading", "Loading Achievement Rewards...");
1770 sAchievementMgr->LoadRewards();
1771
1773 {
1774 TC_LOG_INFO("server.loading", "Loading Achievement Reward Locales...");
1775 sAchievementMgr->LoadRewardLocales();
1776 }
1777 TC_LOG_INFO("server.loading", "Loading Completed Achievements...");
1778 sAchievementMgr->LoadCompletedAchievements();
1779
1780 // Load before guilds and arena teams
1781 TC_LOG_INFO("server.loading", "Loading character cache store...");
1782 sCharacterCache->LoadCharacterCacheStorage();
1783
1785 TC_LOG_INFO("server.loading", "Loading Auctions...");
1786 sAuctionMgr->LoadAuctions();
1787
1789 {
1790 TC_LOG_INFO("server.loading", "Loading Black Market Templates...");
1791 sBlackMarketMgr->LoadTemplates();
1792
1793 TC_LOG_INFO("server.loading", "Loading Black Market Auctions...");
1794 sBlackMarketMgr->LoadAuctions();
1795 }
1796
1797 TC_LOG_INFO("server.loading", "Loading Guild rewards...");
1798 sGuildMgr->LoadGuildRewards();
1799
1800 TC_LOG_INFO("server.loading", "Loading Guilds...");
1801 sGuildMgr->LoadGuilds();
1802
1803 TC_LOG_INFO("server.loading", "Loading ArenaTeams...");
1804 sArenaTeamMgr->LoadArenaTeams();
1805
1806 TC_LOG_INFO("server.loading", "Loading Groups...");
1807 sGroupMgr->LoadGroups();
1808
1809 TC_LOG_INFO("server.loading", "Loading ReservedNames...");
1810 sObjectMgr->LoadReservedPlayersNames();
1811
1812 TC_LOG_INFO("server.loading", "Loading GameObjects for quests...");
1813 sObjectMgr->LoadGameObjectForQuests();
1814
1815 TC_LOG_INFO("server.loading", "Loading BattleMasters...");
1816 sBattlegroundMgr->LoadBattleMastersEntry(); // must be after load CreatureTemplate
1817
1818 TC_LOG_INFO("server.loading", "Loading GameTeleports...");
1819 sObjectMgr->LoadGameTele();
1820
1821 TC_LOG_INFO("server.loading", "Loading Trainers...");
1822 sObjectMgr->LoadTrainers(); // must be after load CreatureTemplate
1823
1824 TC_LOG_INFO("server.loading", "Loading Gossip menu...");
1825 sObjectMgr->LoadGossipMenu();
1826
1827 TC_LOG_INFO("server.loading", "Loading Gossip menu options...");
1828 sObjectMgr->LoadGossipMenuItems();
1829
1830 TC_LOG_INFO("server.loading", "Loading Gossip menu addon...");
1831 sObjectMgr->LoadGossipMenuAddon();
1832
1833 TC_LOG_INFO("server.loading", "Loading Creature Template Gossip...");
1834 sObjectMgr->LoadCreatureTemplateGossip();
1835
1836 TC_LOG_INFO("server.loading", "Loading Creature trainers...");
1837 sObjectMgr->LoadCreatureTrainers(); // must be after LoadGossipMenuItems
1838
1839 TC_LOG_INFO("server.loading", "Loading Vendors...");
1840 sObjectMgr->LoadVendors(); // must be after load CreatureTemplate and ItemTemplate
1841
1842 TC_LOG_INFO("server.loading", "Loading Waypoint paths...");
1843 sWaypointMgr->LoadPaths();
1844
1845 TC_LOG_INFO("server.loading", "Loading Creature Formations...");
1846 sFormationMgr->LoadCreatureFormations();
1847
1848 TC_LOG_INFO("server.loading", "Loading Persistend World Variables...");
1850
1853
1854 sObjectMgr->LoadPhases();
1855
1856 TC_LOG_INFO("server.loading", "Loading Conditions...");
1857 sConditionMgr->LoadConditions();
1858
1859 TC_LOG_INFO("server.loading", "Loading faction change achievement pairs...");
1860 sObjectMgr->LoadFactionChangeAchievements();
1861
1862 TC_LOG_INFO("server.loading", "Loading faction change spell pairs...");
1863 sObjectMgr->LoadFactionChangeSpells();
1864
1865 TC_LOG_INFO("server.loading", "Loading faction change quest pairs...");
1866 sObjectMgr->LoadFactionChangeQuests();
1867
1868 TC_LOG_INFO("server.loading", "Loading faction change item pairs...");
1869 sObjectMgr->LoadFactionChangeItems();
1870
1871 TC_LOG_INFO("server.loading", "Loading faction change reputation pairs...");
1872 sObjectMgr->LoadFactionChangeReputations();
1873
1874 TC_LOG_INFO("server.loading", "Loading faction change title pairs...");
1875 sObjectMgr->LoadFactionChangeTitles();
1876
1877 TC_LOG_INFO("server.loading", "Loading mount definitions...");
1879
1880 TC_LOG_INFO("server.loading", "Loading warband scene definitions...");
1882
1883 TC_LOG_INFO("server.loading", "Loading GM bugs...");
1884 sSupportMgr->LoadBugTickets();
1885
1886 TC_LOG_INFO("server.loading", "Loading GM complaints...");
1887 sSupportMgr->LoadComplaintTickets();
1888
1889 TC_LOG_INFO("server.loading", "Loading GM suggestions...");
1890 sSupportMgr->LoadSuggestionTickets();
1891
1892 /*TC_LOG_INFO("server.loading", "Loading GM surveys...");
1893 sSupportMgr->LoadSurveys();*/
1894
1895 TC_LOG_INFO("server.loading", "Loading garrison info...");
1896 sGarrisonMgr.Initialize();
1897
1899 TC_LOG_INFO("server.loading", "Returning old mails...");
1900 sObjectMgr->ReturnOrDeleteOldMails(false);
1901
1902 TC_LOG_INFO("server.loading", "Loading Autobroadcasts...");
1904
1906 sObjectMgr->LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data)
1907
1908 TC_LOG_INFO("server.loading", "Loading spell script names...");
1909 sObjectMgr->LoadSpellScriptNames();
1910
1911 TC_LOG_INFO("server.loading", "Loading Creature Texts...");
1912 sCreatureTextMgr->LoadCreatureTexts();
1913
1915 {
1916 TC_LOG_INFO("server.loading", "Loading Creature Text Locales...");
1917 sCreatureTextMgr->LoadCreatureTextLocales();
1918 }
1919
1920 TC_LOG_INFO("server.loading", "Loading creature StaticFlags overrides...");
1921 sObjectMgr->LoadCreatureStaticFlagsOverride(); // must be after LoadCreatures
1922
1923 TC_LOG_INFO("server.loading", "Initializing Scripts...");
1924 sScriptMgr->Initialize();
1925 sScriptMgr->OnConfigLoad(false); // must be done after the ScriptMgr has been properly initialized
1926
1927 TC_LOG_INFO("server.loading", "Validating spell scripts...");
1928 sObjectMgr->ValidateSpellScripts();
1929
1930 TC_LOG_INFO("server.loading", "Loading SmartAI scripts...");
1931 sSmartScriptMgr->LoadSmartAIFromDB();
1932
1933 TC_LOG_INFO("server.loading", "Loading Calendar data...");
1934 sCalendarMgr->LoadFromDB();
1935
1936 TC_LOG_INFO("server.loading", "Loading Petitions...");
1937 sPetitionMgr->LoadPetitions();
1938
1939 TC_LOG_INFO("server.loading", "Loading Signatures...");
1940 sPetitionMgr->LoadSignatures();
1941
1942 TC_LOG_INFO("server.loading", "Loading Item loot...");
1943 sLootItemStorage->LoadStorageFromDB();
1944
1945 TC_LOG_INFO("server.loading", "Initialize query data...");
1946 sObjectMgr->InitializeQueriesData(QUERY_DATA_ALL);
1947
1948 TC_LOG_INFO("server.loading", "Initialize commands...");
1950
1952 TC_LOG_INFO("server.loading", "Initialize game time and timers");
1954
1955 LoginDatabase.PExecute("INSERT INTO uptime (realmid, starttime, uptime, revision) VALUES({}, {}, 0, '{}')",
1956 sRealmList->GetCurrentRealmId().Realm, uint32(GameTime::GetStartTime()), GitRevision::GetFullVersion()); // One-time query
1957
1961 //Update "uptime" table based on configuration entry in minutes.
1963 //erase corpses every 20 minutes
1965 // clean logs table every 14 days by default
1967 m_timers[WUPDATE_DELETECHARS].SetInterval(DAY*IN_MILLISECONDS); // check for chars to delete every day
1968
1969 // for AhBot
1971
1973
1975
1977
1979
1981
1983
1984 //to set mailtimer to return mails every day between 4 and 5 am
1985 //mailtimer is increased when updating auctions
1986 //one second is 1000 -(tested on win system)
1988 tm localTm;
1989 time_t gameTime = GameTime::GetGameTime();
1990 localtime_r(&gameTime, &localTm);
1991 uint8 CleanOldMailsTime = getIntConfig(CONFIG_CLEAN_OLD_MAIL_TIME);
1992 mail_timer = ((((localTm.tm_hour + (24 - CleanOldMailsTime)) % 24)* HOUR * IN_MILLISECONDS) / m_timers[WUPDATE_AUCTIONS].GetInterval());
1993 //1440
1995 TC_LOG_INFO("server.loading", "Mail timer set to: {}, mail return is called every {} minutes", uint64(mail_timer), uint64(mail_timer_expires));
1996
1998 TC_LOG_INFO("server.loading", "Starting Map System");
1999 sMapMgr->Initialize();
2000
2001 TC_LOG_INFO("server.loading", "Starting Game Event system...");
2002 uint32 nextGameEvent = sGameEventMgr->StartSystem();
2003 m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent); //depend on next event
2004
2005 // Delete all characters which have been deleted X days before
2007
2008 TC_LOG_INFO("server.loading", "Initialize AuctionHouseBot...");
2009 sAuctionBot->Initialize();
2010
2011 TC_LOG_INFO("server.loading", "Initializing chat channels...");
2013
2014 TC_LOG_INFO("server.loading", "Initializing Opcodes...");
2018
2019 TC_LOG_INFO("server.loading", "Starting Arena Season...");
2020 sGameEventMgr->StartArenaSeason();
2021
2022 sSupportMgr->Initialize();
2023
2025 TC_LOG_INFO("server.loading", "Starting Battleground System");
2026 sBattlegroundMgr->LoadBattlegroundTemplates();
2027 sBattlegroundMgr->LoadBattlegroundScriptTemplate();
2028
2030 TC_LOG_INFO("server.loading", "Starting Outdoor PvP System");
2031 sOutdoorPvPMgr->InitOutdoorPvP();
2032
2034 TC_LOG_INFO("server.loading", "Starting Battlefield System");
2035 sBattlefieldMgr->InitBattlefield();
2036
2037 TC_LOG_INFO("server.loading", "Deleting expired bans...");
2038 LoginDatabase.Execute("DELETE FROM ip_banned WHERE unbandate <= UNIX_TIMESTAMP() AND unbandate<>bandate"); // One-time query
2039
2040 TC_LOG_INFO("server.loading", "Initializing quest reset times...");
2043
2044 TC_LOG_INFO("server.loading", "Calculate random battleground reset time...");
2046
2047 TC_LOG_INFO("server.loading", "Calculate deletion of old calendar events time...");
2049
2050 TC_LOG_INFO("server.loading", "Calculate guild limitation(s) reset time...");
2052
2053 TC_LOG_INFO("server.loading", "Calculate next currency reset time...");
2055
2056 TC_LOG_INFO("server.loading", "Loading race and class expansion requirements...");
2057 sObjectMgr->LoadRaceAndClassExpansionRequirements();
2058
2059 TC_LOG_INFO("server.loading", "Loading character templates...");
2060 sCharacterTemplateDataStore->LoadCharacterTemplates();
2061
2062 TC_LOG_INFO("server.loading", "Loading battle pets info...");
2064
2065 TC_LOG_INFO("server.loading", "Loading scenarios");
2066 sScenarioMgr->LoadDB2Data();
2067 sScenarioMgr->LoadDBData();
2068
2069 TC_LOG_INFO("server.loading", "Loading scenario poi data");
2070 sScenarioMgr->LoadScenarioPOI();
2071
2072 TC_LOG_INFO("server.loading", "Loading phase names...");
2073 sObjectMgr->LoadPhaseNames();
2074
2075 TC_LOG_INFO("server.loading", "Loading transmog data...");
2077
2078 uint32 startupDuration = GetMSTimeDiffToNow(startupBegin);
2079
2080 TC_LOG_INFO("server.worldserver", "World initialized in {} minutes {} seconds", startupDuration / 60000, startupDuration % 60000 / 1000);
2081
2082 TC_METRIC_EVENT("events", "World initialized", Trinity::StringFormat("World initialized in {} minutes {} seconds", startupDuration / 60000, startupDuration % 60000 / 1000));
2083 return true;
2084}
2085
2087{
2088 WorldStateMgr::SetValueAndSaveInDb(WS_WAR_MODE_HORDE_BUFF_VALUE, 10 + (team == TEAM_ALLIANCE ? reward : 0), false, nullptr);
2089 WorldStateMgr::SetValueAndSaveInDb(WS_WAR_MODE_ALLIANCE_BUFF_VALUE, 10 + (team == TEAM_HORDE ? reward : 0), false, nullptr);
2090}
2091
2096
2098{
2099 uint32 oldMSTime = getMSTime();
2100
2101 m_Autobroadcasts.clear();
2102
2104 stmt->setInt32(0, sRealmList->GetCurrentRealmId().Realm);
2105 PreparedQueryResult result = LoginDatabase.Query(stmt);
2106
2107 if (!result)
2108 {
2109 TC_LOG_INFO("server.loading", ">> Loaded 0 autobroadcasts definitions. DB table `autobroadcast` is empty for this realm!");
2110 return;
2111 }
2112
2113 do
2114 {
2115 Field* fields = result->Fetch();
2116 uint8 id = fields[0].GetUInt8();
2117
2118 m_Autobroadcasts[id] = { .Message = fields[2].GetString(), .Weight = fields[1].GetUInt8() };
2119
2120 } while (result->NextRow());
2121
2122 TC_LOG_INFO("server.loading", ">> Loaded {} autobroadcast definitions in {} ms", m_Autobroadcasts.size(), GetMSTimeDiffToNow(oldMSTime));
2123}
2124
2127{
2128 TC_METRIC_TIMER("world_update_time_total");
2131 time_t currentGameTime = GameTime::GetGameTime();
2132
2134
2136 for (int i = 0; i < WUPDATE_COUNT; ++i)
2137 {
2138 if (m_timers[i].GetCurrent() >= 0)
2139 m_timers[i].Update(diff);
2140 else
2141 m_timers[i].SetCurrent(0);
2142 }
2143
2145 if (m_timers[WUPDATE_WHO_LIST].Passed())
2146 {
2147 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update who list"));
2149 sWhoListStorageMgr->Update();
2150 }
2151
2152 if (IsStopped() || m_timers[WUPDATE_CHANNEL_SAVE].Passed())
2153 {
2155
2157 {
2158 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Save custom channels"));
2160 mgr1->SaveToDB();
2162 if (mgr1 != mgr2)
2163 mgr2->SaveToDB();
2165 if (mgr1 != mgr3)
2166 mgr3->SaveToDB();
2167 }
2168 }
2169
2170 {
2171 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Check daily reset times"));
2173 }
2174
2175 if (currentGameTime > m_NextRandomBGReset)
2176 {
2177 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Reset random BG"));
2178 ResetRandomBG();
2179 }
2180
2181 if (currentGameTime > m_NextCalendarOldEventsDeletionTime)
2182 {
2183 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Delete old calendar events"));
2185 }
2186
2187 if (currentGameTime > m_NextGuildReset)
2188 {
2189 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Reset guild cap"));
2190 ResetGuildCap();
2191 }
2192
2193 if (currentGameTime > m_NextCurrencyReset)
2194 {
2195 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Reset currency weekly cap"));
2197 }
2198
2200 if (m_timers[WUPDATE_AUCTIONS].Passed())
2201 {
2202 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update expired auctions"));
2204
2206 //(tested... works on win)
2208 {
2209 mail_timer = 0;
2210 sObjectMgr->ReturnOrDeleteOldMails(true);
2211 }
2212
2214 sAuctionMgr->Update();
2215 }
2216
2217 if (m_timers[WUPDATE_AUCTIONS_PENDING].Passed())
2218 {
2219 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update pending auctions"));
2221
2222 sAuctionMgr->UpdatePendingAuctions();
2223 }
2224
2225 if (m_timers[WUPDATE_BLACKMARKET].Passed())
2226 {
2227 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update pending black market auctions"));
2229
2231 if ((blackmarket_timer * m_timers[WUPDATE_BLACKMARKET].GetInterval() >=
2234 {
2235 sBlackMarketMgr->RefreshAuctions();
2236 blackmarket_timer = 1; // timer is 0 on startup
2237 }
2238 else
2239 {
2241 sBlackMarketMgr->Update();
2242 }
2243 }
2244
2246 if (m_timers[WUPDATE_AHBOT].Passed())
2247 {
2248 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update AHBot"));
2249 sAuctionBot->Update();
2251 }
2252
2254 sScriptMgr->SyncScripts();
2255
2257 if (m_timers[WUPDATE_CHECK_FILECHANGES].Passed())
2258 {
2259 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update HotSwap"));
2260 sScriptReloadMgr->Update();
2262 }
2263
2264 {
2266 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update sessions"));
2267 UpdateSessions(diff);
2268 }
2269
2271 if (m_timers[WUPDATE_UPTIME].Passed())
2272 {
2273 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update uptime"));
2274 uint32 tmpDiff = GameTime::GetUptime();
2275 uint32 maxOnlinePlayers = GetMaxPlayerCount();
2276
2278
2280
2281 stmt->setUInt32(0, tmpDiff);
2282 stmt->setUInt16(1, uint16(maxOnlinePlayers));
2283 stmt->setUInt32(2, sRealmList->GetCurrentRealmId().Realm);
2285
2286 LoginDatabase.Execute(stmt);
2287 }
2288
2290 if (getIntConfig(CONFIG_LOGDB_CLEARTIME) > 0) // if not enabled, ignore the timer
2291 {
2292 if (m_timers[WUPDATE_CLEANDB].Passed())
2293 {
2294 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Clean logs table"));
2296
2298
2301 stmt->setUInt32(2, sRealmList->GetCurrentRealmId().Realm);
2302
2303 LoginDatabase.Execute(stmt);
2304 }
2305 }
2306
2309 {
2310 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update maps"));
2311 sMapMgr->Update(diff);
2312 }
2313
2314 {
2315 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Terrain data cleanup"));
2316 sTerrainMgr.Update(diff);
2317 }
2318
2320 {
2321 if (m_timers[WUPDATE_AUTOBROADCAST].Passed())
2322 {
2323 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Send autobroadcast"));
2326 }
2327 }
2328
2329 {
2330 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update battlegrounds"));
2331 sBattlegroundMgr->Update(diff);
2332 }
2333
2334 {
2335 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update outdoor pvp"));
2336 sOutdoorPvPMgr->Update(diff);
2337 }
2338
2339 {
2340 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update battlefields"));
2341 sBattlefieldMgr->Update(diff);
2342 }
2343
2345 if (m_timers[WUPDATE_DELETECHARS].Passed())
2346 {
2347 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Delete old characters"));
2350 }
2351
2352 {
2353 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update groups"));
2354 sGroupMgr->Update(diff);
2355 }
2356
2357 {
2358 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update LFG"));
2359 sLFGMgr->Update(diff);
2360 }
2361
2362 {
2363 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Process query callbacks"));
2364 // execute callbacks from sql queries that were queued recently
2366 }
2367
2369 if (m_timers[WUPDATE_CORPSES].Passed())
2370 {
2371 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Remove old corpses"));
2373 sMapMgr->DoForAllMaps([](Map* map)
2374 {
2375 map->RemoveOldCorpses();
2376 });
2377 }
2378
2380 if (m_timers[WUPDATE_EVENTS].Passed())
2381 {
2382 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update game events"));
2383 m_timers[WUPDATE_EVENTS].Reset(); // to give time for Update() to be processed
2384 uint32 nextGameEvent = sGameEventMgr->Update();
2385 m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent);
2387 }
2388
2390 if (m_timers[WUPDATE_PINGDB].Passed())
2391 {
2392 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Ping MySQL"));
2394 TC_LOG_DEBUG("sql.driver", "Ping MySQL to keep connection alive");
2395 CharacterDatabase.KeepAlive();
2396 LoginDatabase.KeepAlive();
2397 WorldDatabase.KeepAlive();
2398 HotfixDatabase.KeepAlive();
2399 }
2400
2401 if (m_timers[WUPDATE_GUILDSAVE].Passed())
2402 {
2403 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Save guilds"));
2405 sGuildMgr->SaveGuilds();
2406 }
2407
2408 // Check for shutdown warning
2409 if (_guidWarn && !_guidAlert)
2410 {
2411 _warnDiff += diff;
2416 }
2417
2419
2420 {
2421 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Process cli commands"));
2422 // And last, but not least handle the issued cli commands
2424 }
2425
2426 {
2427 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update world scripts"));
2428 sScriptMgr->OnWorldUpdate(diff);
2429 }
2430
2431 {
2432 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update metrics"));
2433 // Stats logger update
2434 sMetric->Update();
2435 TC_METRIC_VALUE("update_time_diff", diff);
2436 }
2437}
2438
2440{
2441 m_timers[WUPDATE_EVENTS].Reset(); // to give time for Update() to be processed
2442 uint32 nextGameEvent = sGameEventMgr->Update();
2443 m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent);
2445}
2446
2449{
2450 SessionMap::const_iterator itr;
2451 for (itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
2452 {
2453 if (itr->second &&
2454 itr->second->GetPlayer() &&
2455 itr->second->GetPlayer()->IsInWorld() &&
2456 itr->second != self &&
2457 (!team || itr->second->GetPlayer()->GetTeam() == team))
2458 {
2459 itr->second->SendPacket(packet);
2460 }
2461 }
2462}
2463
2466{
2467 for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
2468 {
2469 // check if session and can receive global GM Messages and its not self
2470 WorldSession* session = itr->second;
2471 if (!session || session == self || !session->HasPermission(rbac::RBAC_PERM_RECEIVE_GLOBAL_GM_TEXTMESSAGE))
2472 continue;
2473
2474 // Player should be in world
2475 Player* player = session->GetPlayer();
2476 if (!player || !player->IsInWorld())
2477 continue;
2478
2479 // Send only to same team, if team is given
2480 if (!team || player->GetTeam() == team)
2481 session->SendPacket(packet);
2482 }
2483}
2484
2485namespace Trinity
2486{
2488 {
2490 {
2491 public:
2492 void operator()(Player const* receiver) const
2493 {
2494 for (std::unique_ptr<WorldPackets::Packet> const& packet : Packets)
2495 receiver->SendDirectMessage(packet->GetRawPacket());
2496 }
2497
2498 std::vector<std::unique_ptr<WorldPackets::Packet>> Packets;
2499 };
2500
2501 public:
2502 static size_t const BufferSize = 2048;
2503
2504 explicit WorldWorldTextBuilder(uint32 textId, va_list* args = nullptr) : i_textId(textId), i_args(args) { }
2505
2507 {
2508 char const* text = sObjectMgr->GetTrinityString(i_textId, locale);
2509
2510 char strBuffer[BufferSize];
2511 if (i_args)
2512 {
2513 // we need copy va_list before use or original va_list will corrupted
2514 va_list ap;
2515 va_copy(ap, *i_args);
2516 vsnprintf(strBuffer, BufferSize, text, ap);
2517 va_end(ap);
2518 }
2519 else
2520 {
2521 std::strncpy(strBuffer, text, BufferSize);
2522 strBuffer[BufferSize - 1] = '\0';
2523 }
2524
2526 do_helper(sender->Packets, strBuffer);
2527 return sender;
2528 }
2529
2530 private:
2531 void do_helper(std::vector<std::unique_ptr<WorldPackets::Packet>>& dataList, char* text)
2532 {
2533 while (char* line = ChatHandler::LineFromMessage(text))
2534 {
2536 packet->Initialize(CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, line);
2537 packet->Write();
2538 dataList.emplace_back(packet);
2539 }
2540 }
2541
2543 va_list* i_args;
2544 };
2545} // namespace Trinity
2546
2548void World::SendWorldText(uint32 string_id, ...)
2549{
2550 va_list ap;
2551 va_start(ap, string_id);
2552
2553 Trinity::WorldWorldTextBuilder wt_builder(string_id, &ap);
2555 for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
2556 {
2557 if (!itr->second || !itr->second->GetPlayer() || !itr->second->GetPlayer()->IsInWorld())
2558 continue;
2559
2560 wt_do(itr->second->GetPlayer());
2561 }
2562
2563 va_end(ap);
2564}
2565
2567void World::SendGMText(uint32 string_id, ...)
2568{
2569 va_list ap;
2570 va_start(ap, string_id);
2571
2572 Trinity::WorldWorldTextBuilder wt_builder(string_id, &ap);
2574 for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
2575 {
2576 // Session should have permissions to receive global gm messages
2577 WorldSession* session = itr->second;
2579 continue;
2580
2581 // Player should be in world
2582 Player* player = session->GetPlayer();
2583 if (!player || !player->IsInWorld())
2584 continue;
2585
2586 wt_do(player);
2587 }
2588
2589 va_end(ap);
2590}
2591
2593void World::SendGlobalText(char const* text, WorldSession* self)
2594{
2595 // need copy to prevent corruption by strtok call in LineFromMessage original string
2596 char* buf = strdup(text);
2597 char* pos = buf;
2598
2599 while (char* line = ChatHandler::LineFromMessage(pos))
2600 {
2602 packet.Initialize(CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, line);
2603 SendGlobalMessage(packet.Write(), self);
2604 }
2605
2606 free(buf);
2607}
2608
2611{
2612 m_QueuedPlayer.clear(); // prevent send queue update packet and login queued sessions
2613
2614 // session not removed at kick and will removed in next update tick
2615 for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
2616 itr->second->KickPlayer("World::KickAll");
2617}
2618
2621{
2622 // session not removed at kick and will removed in next update tick
2623 for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
2624 if (itr->second->GetSecurity() < sec)
2625 itr->second->KickPlayer("World::KickAllLess");
2626}
2627
2629BanReturn World::BanAccount(BanMode mode, std::string const& nameOrIP, std::string const& duration, std::string const& reason, std::string const& author)
2630{
2631 uint32 duration_secs = TimeStringToSecs(duration);
2632 return BanAccount(mode, nameOrIP, duration_secs, reason, author);
2633}
2634
2636BanReturn World::BanAccount(BanMode mode, std::string const& nameOrIP, uint32 duration_secs, std::string const& reason, std::string const& author)
2637{
2638 PreparedQueryResult resultAccounts = PreparedQueryResult(nullptr); //used for kicking
2639
2640 // Prevent banning an already banned account
2641 if (mode == BAN_ACCOUNT && AccountMgr::IsBannedAccount(nameOrIP))
2642 return BAN_EXISTS;
2643
2645 switch (mode)
2646 {
2647 case BAN_IP:
2648 {
2649 // No SQL injection with prepared statements
2651 stmt->setString(0, nameOrIP);
2652 resultAccounts = LoginDatabase.Query(stmt);
2653 stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_IP_BANNED);
2654 stmt->setString(0, nameOrIP);
2655 stmt->setUInt32(1, duration_secs);
2656 stmt->setString(2, author);
2657 stmt->setString(3, reason);
2658 LoginDatabase.Execute(stmt);
2659 break;
2660 }
2661 case BAN_ACCOUNT:
2662 {
2663 // No SQL injection with prepared statements
2665 stmt->setString(0, nameOrIP);
2666 resultAccounts = LoginDatabase.Query(stmt);
2667 break;
2668 }
2669 case BAN_CHARACTER:
2670 {
2671 // No SQL injection with prepared statements
2673 stmt->setString(0, nameOrIP);
2674 resultAccounts = CharacterDatabase.Query(stmt);
2675 break;
2676 }
2677 default:
2678 return BAN_SYNTAX_ERROR;
2679 }
2680
2681 if (!resultAccounts)
2682 {
2683 if (mode == BAN_IP)
2684 return BAN_SUCCESS; // ip correctly banned but nobody affected (yet)
2685 else
2686 return BAN_NOTFOUND; // Nobody to ban
2687 }
2688
2690 LoginDatabaseTransaction trans = LoginDatabase.BeginTransaction();
2691 do
2692 {
2693 Field* fieldsAccount = resultAccounts->Fetch();
2694 uint32 account = fieldsAccount[0].GetUInt32();
2695
2696 if (mode != BAN_IP)
2697 {
2698 // make sure there is only one active ban
2700 stmt->setUInt32(0, account);
2701 trans->Append(stmt);
2702 // No SQL injection with prepared statements
2703 stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ACCOUNT_BANNED);
2704 stmt->setUInt32(0, account);
2705 stmt->setUInt32(1, duration_secs);
2706 stmt->setString(2, author);
2707 stmt->setString(3, reason);
2708 trans->Append(stmt);
2709 }
2710
2711 if (WorldSession* sess = FindSession(account))
2712 if (std::string(sess->GetPlayerName()) != author)
2713 sess->KickPlayer("World::BanAccount Banning account");
2714 } while (resultAccounts->NextRow());
2715
2716 LoginDatabase.CommitTransaction(trans);
2717
2718 return BAN_SUCCESS;
2719}
2720
2722bool World::RemoveBanAccount(BanMode mode, std::string const& nameOrIP)
2723{
2724 LoginDatabasePreparedStatement* stmt = nullptr;
2725 if (mode == BAN_IP)
2726 {
2727 stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_IP_NOT_BANNED);
2728 stmt->setString(0, nameOrIP);
2729 LoginDatabase.Execute(stmt);
2730 }
2731 else
2732 {
2733 uint32 account = 0;
2734 if (mode == BAN_ACCOUNT)
2735 account = AccountMgr::GetId(nameOrIP);
2736 else if (mode == BAN_CHARACTER)
2737 account = sCharacterCache->GetCharacterAccountIdByName(nameOrIP);
2738
2739 if (!account)
2740 return false;
2741
2742 //NO SQL injection as account is uint32
2743 stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_NOT_BANNED);
2744 stmt->setUInt32(0, account);
2745 LoginDatabase.Execute(stmt);
2746 }
2747 return true;
2748}
2749
2751BanReturn World::BanCharacter(std::string const& name, std::string const& duration, std::string const& reason, std::string const& author)
2752{
2754 ObjectGuid guid;
2755
2756 uint32 duration_secs = TimeStringToSecs(duration);
2757
2759 if (!banned)
2760 {
2761 guid = sCharacterCache->GetCharacterGuidByName(name);
2762 if (guid.IsEmpty())
2763 return BAN_NOTFOUND; // Nobody to ban
2764 }
2765 else
2766 guid = banned->GetGUID();
2767
2768 //Use transaction in order to ensure the order of the queries
2769 CharacterDatabaseTransaction trans = CharacterDatabase.BeginTransaction();
2770 // make sure there is only one active ban
2772 stmt->setUInt64(0, guid.GetCounter());
2773 trans->Append(stmt);
2774
2775 stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_BAN);
2776 stmt->setUInt64(0, guid.GetCounter());
2777 stmt->setInt64(1, duration_secs);
2778 stmt->setString(2, author);
2779 stmt->setString(3, reason);
2780 trans->Append(stmt);
2781 CharacterDatabase.CommitTransaction(trans);
2782
2783 if (banned)
2784 banned->GetSession()->KickPlayer("World::BanCharacter Banning character");
2785
2786 return BAN_SUCCESS;
2787}
2788
2790bool World::RemoveBanCharacter(std::string const& name)
2791{
2793 ObjectGuid guid;
2794
2796 if (!banned)
2797 {
2798 guid = sCharacterCache->GetCharacterGuidByName(name);
2799 if (guid.IsEmpty())
2800 return false; // Nobody to ban
2801 }
2802 else
2803 guid = banned->GetGUID();
2804
2806 stmt->setUInt64(0, guid.GetCounter());
2807 CharacterDatabase.Execute(stmt);
2808 return true;
2809}
2810
2813{
2815 time_t lastGameTime = GameTime::GetGameTime();
2817
2818 uint32 elapsed = uint32(GameTime::GetGameTime() - lastGameTime);
2819
2821 if (!IsStopped() && m_ShutdownTimer > 0 && elapsed > 0)
2822 {
2824 if (m_ShutdownTimer <= elapsed)
2825 {
2827 m_stopEvent = true; // exist code already set
2828 else
2829 m_ShutdownTimer = 1; // minimum timer value to wait idle state
2830 }
2832 else
2833 {
2834 m_ShutdownTimer -= elapsed;
2835
2836 ShutdownMsg();
2837 }
2838 }
2839}
2840
2842void World::ShutdownServ(uint32 time, uint32 options, uint8 exitcode, const std::string& reason)
2843{
2844 // ignore if server shutdown at next tick
2845 if (IsStopped())
2846 return;
2847
2848 m_ShutdownMask = options;
2849 m_ExitCode = exitcode;
2850
2852 if (time == 0)
2853 m_ShutdownTimer = 1;
2855 else
2856 {
2857 m_ShutdownTimer = time;
2858 ShutdownMsg(true, nullptr, reason);
2859 }
2860
2861 sScriptMgr->OnShutdownInitiate(ShutdownExitCode(exitcode), ShutdownMask(options));
2862}
2863
2865void World::ShutdownMsg(bool show, Player* player, const std::string& reason)
2866{
2867 // not show messages for idle shutdown mode
2869 return;
2870
2872 if (show ||
2873 (m_ShutdownTimer < 5* MINUTE && (m_ShutdownTimer % 15) == 0) || // < 5 min; every 15 sec
2874 (m_ShutdownTimer < 15 * MINUTE && (m_ShutdownTimer % MINUTE) == 0) || // < 15 min ; every 1 min
2875 (m_ShutdownTimer < 30 * MINUTE && (m_ShutdownTimer % (5 * MINUTE)) == 0) || // < 30 min ; every 5 min
2876 (m_ShutdownTimer < 12 * HOUR && (m_ShutdownTimer % HOUR) == 0) || // < 12 h ; every 1 h
2877 (m_ShutdownTimer > 12 * HOUR && (m_ShutdownTimer % (12 * HOUR)) == 0)) // > 12 h ; every 12 h
2878 {
2880 if (!reason.empty())
2881 str += " - " + reason;
2882
2884
2885 SendServerMessage(msgid, str, player);
2886 TC_LOG_DEBUG("misc", "Server is {} in {}", (m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown"), str);
2887 }
2888}
2889
2892{
2893 // nothing cancel or too late
2895 return 0;
2896
2898
2899 uint32 oldTimer = m_ShutdownTimer;
2900 m_ShutdownMask = 0;
2901 m_ShutdownTimer = 0;
2902 m_ExitCode = SHUTDOWN_EXIT_CODE; // to default value
2903 SendServerMessage(msgid);
2904
2905 TC_LOG_DEBUG("misc", "Server {} cancelled.", (m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shutdown"));
2906
2907 sScriptMgr->OnShutdownCancel();
2908 return oldTimer;
2909}
2910
2912void World::SendServerMessage(ServerMessageType messageID, std::string_view stringParam /*= {}*/, Player const* player /*= nullptr*/)
2913{
2914 ServerMessagesEntry const* serverMessage = sServerMessagesStore.LookupEntry(messageID);
2915 if (!serverMessage)
2916 return;
2917
2918 WorldPackets::Chat::ChatServerMessage chatServerMessage;
2919 chatServerMessage.MessageID = int32(messageID);
2920 if (strstr(serverMessage->Text[player ? player->GetSession()->GetSessionDbcLocale() : GetDefaultDbcLocale()], "%s"))
2921 chatServerMessage.StringParam = stringParam;
2922
2923 if (player)
2924 player->SendDirectMessage(chatServerMessage.Write());
2925 else
2926 SendGlobalMessage(chatServerMessage.Write());
2927}
2928
2930{
2931 {
2932 TC_METRIC_DETAILED_NO_THRESHOLD_TIMER("world_update_time",
2933 TC_METRIC_TAG("type", "Add sessions"),
2934 TC_METRIC_TAG("parent_type", "Update sessions"));
2936 WorldSession* sess = nullptr;
2937 while (addSessQueue.next(sess))
2938 AddSession_(sess);
2939 }
2940
2941 {
2942 std::pair<std::weak_ptr<WorldSocket>, uint64> linkInfo;
2943 while (_linkSocketQueue.next(linkInfo))
2944 {
2945 WorldSession::ConnectToKey key = { .Raw = linkInfo.second };
2947 }
2948 }
2949
2951 for (SessionMap::iterator itr = m_sessions.begin(), next; itr != m_sessions.end(); itr = next)
2952 {
2953 next = itr;
2954 ++next;
2955
2957 WorldSession* pSession = itr->second;
2958 WorldSessionFilter updater(pSession);
2959
2960 [[maybe_unused]] uint32 currentSessionId = itr->first;
2961 TC_METRIC_DETAILED_TIMER("world_update_sessions_time", TC_METRIC_TAG("account_id", std::to_string(currentSessionId)));
2962
2963 if (!pSession->Update(diff, updater)) // As interval = 0
2964 {
2965 if (!RemoveQueuedPlayer(itr->second) && itr->second && getIntConfig(CONFIG_INTERVAL_DISCONNECT_TOLERANCE))
2966 m_disconnects[itr->second->GetAccountId()] = GameTime::GetGameTime();
2967 RemoveQueuedPlayer(pSession);
2968 m_sessions.erase(itr);
2970 delete pSession;
2971 }
2972 }
2973}
2974
2975// This handles the issued and queued CLI commands
2977{
2978 CliCommandHolder::Print zprint = nullptr;
2979 void* callbackArg = nullptr;
2980 CliCommandHolder* command = nullptr;
2981 while (cliCmdQueue.next(command))
2982 {
2983 TC_LOG_INFO("misc", "CLI command under processing...");
2984 zprint = command->m_print;
2985 callbackArg = command->m_callbackArg;
2986 CliHandler handler(callbackArg, zprint);
2987 handler.ParseCommands(command->m_command);
2988 if (command->m_commandFinished)
2989 command->m_commandFinished(callbackArg, !handler.HasSentErrorMessage());
2990 delete command;
2991 }
2992}
2993
2995{
2996 if (m_Autobroadcasts.empty())
2997 return;
2998
2999 auto itr = Trinity::Containers::SelectRandomWeightedContainerElement(m_Autobroadcasts, [](AutobroadcastContainer::value_type const& pair)
3000 {
3001 return pair.second.Weight;
3002 });
3003
3005
3006 if (abcenter == 0)
3007 SendWorldText(LANG_AUTO_BROADCAST, itr->second.Message.c_str());
3008 else if (abcenter == 1)
3010 else if (abcenter == 2)
3011 {
3012 SendWorldText(LANG_AUTO_BROADCAST, itr->second.Message.c_str());
3014 }
3015
3016 TC_LOG_DEBUG("misc", "AutoBroadcast: '{}'", itr->second.Message);
3017}
3018
3020{
3022 stmt->setUInt32(0, accountId);
3023 _queryProcessor.AddCallback(CharacterDatabase.AsyncQuery(stmt).WithPreparedCallback([this](PreparedQueryResult result)
3024 {
3025 _UpdateRealmCharCount(std::move(result));
3026 }));
3027}
3028
3030{
3031 if (resultCharCount)
3032 {
3033 Field* fields = resultCharCount->Fetch();
3034 uint32 accountId = fields[0].GetUInt32();
3035 uint8 charCount = uint8(fields[1].GetUInt64());
3036
3037 LoginDatabaseTransaction trans = LoginDatabase.BeginTransaction();
3038
3040 stmt->setUInt8(0, charCount);
3041 stmt->setUInt32(1, accountId);
3042 stmt->setUInt32(2, sRealmList->GetCurrentRealmId().Realm);
3043 trans->Append(stmt);
3044
3045 LoginDatabase.CommitTransaction(trans);
3046 }
3047}
3048
3055
3056static time_t GetNextDailyResetTime(time_t t)
3057{
3058 return GetLocalHourTimestamp(t, sWorld->getIntConfig(CONFIG_DAILY_QUEST_RESET_TIME_HOUR), true);
3059}
3060
3062{
3063 // reset all saved quest status
3065 CharacterDatabase.Execute(stmt);
3066
3068 stmt->setUInt32(0, 1);
3069 CharacterDatabase.Execute(stmt);
3070
3071 // reset all quest status in memory
3072 for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
3073 if (Player* player = itr->second->GetPlayer())
3074 player->DailyReset();
3075
3076 // reselect pools
3077 sQuestPoolMgr->ChangeDailyQuests();
3078
3079 // store next reset time
3080 time_t now = GameTime::GetGameTime();
3081 time_t next = GetNextDailyResetTime(now);
3082 ASSERT(now < next);
3083
3084 m_NextDailyQuestReset = next;
3086
3087 TC_LOG_INFO("misc", "Daily quests for all characters have been reset.");
3088}
3089
3090static time_t GetNextWeeklyResetTime(time_t t)
3091{
3092 t = GetNextDailyResetTime(t);
3093 tm time = TimeBreakdown(t);
3094 int wday = time.tm_wday;
3095 int target = sWorld->getIntConfig(CONFIG_WEEKLY_QUEST_RESET_TIME_WDAY);
3096 if (target < wday)
3097 wday -= 7;
3098 t += (DAY * (target - wday));
3099 return t;
3100}
3101
3103{
3104 // reset all saved quest status
3106 CharacterDatabase.Execute(stmt);
3107 // reset all quest status in memory
3108 for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
3109 if (Player* player = itr->second->GetPlayer())
3110 player->ResetWeeklyQuestStatus();
3111
3112 // reselect pools
3113 sQuestPoolMgr->ChangeWeeklyQuests();
3114
3115 // Update faction balance
3117
3118 // store next reset time
3119 time_t now = GameTime::GetGameTime();
3120 time_t next = GetNextWeeklyResetTime(now);
3121 ASSERT(now < next);
3122
3125
3126 TC_LOG_INFO("misc", "Weekly quests for all characters have been reset.");
3127}
3128
3129static time_t GetNextMonthlyResetTime(time_t t)
3130{
3131 t = GetNextDailyResetTime(t);
3132 tm time = TimeBreakdown(t);
3133 if (time.tm_mday == 1)
3134 return t;
3135
3136 time.tm_mday = 1;
3137 time.tm_mon += 1;
3138 return mktime(&time);
3139}
3140
3142{
3143 // reset all saved quest status
3145 CharacterDatabase.Execute(stmt);
3146 // reset all quest status in memory
3147 for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
3148 if (Player* player = itr->second->GetPlayer())
3149 player->ResetMonthlyQuestStatus();
3150
3151 // reselect pools
3152 sQuestPoolMgr->ChangeMonthlyQuests();
3153
3154 // store next reset time
3155 time_t now = GameTime::GetGameTime();
3156 time_t next = GetNextMonthlyResetTime(now);
3157 ASSERT(now < next);
3158
3161
3162 TC_LOG_INFO("misc", "Monthly quests for all characters have been reset.");
3163}
3164
3166{
3167 time_t const now = GameTime::GetGameTime();
3168 if (m_NextDailyQuestReset <= now)
3169 DailyReset();
3170 if (m_NextWeeklyQuestReset <= now)
3172 if (m_NextMonthlyQuestReset <= now)
3174}
3175
3177{
3179 if (!bgtime)
3180 m_NextRandomBGReset = GameTime::GetGameTime(); // game time not yet init
3181
3182 // generate time by config
3183 time_t curTime = GameTime::GetGameTime();
3184 tm localTm;
3185 localtime_r(&curTime, &localTm);
3186 localTm.tm_hour = getIntConfig(CONFIG_RANDOM_BG_RESET_HOUR);
3187 localTm.tm_min = 0;
3188 localTm.tm_sec = 0;
3189
3190 // current day reset time
3191 time_t nextDayResetTime = mktime(&localTm);
3192
3193 // next reset time before current moment
3194 if (curTime >= nextDayResetTime)
3195 nextDayResetTime += DAY;
3196
3197 // normalize reset time
3198 m_NextRandomBGReset = bgtime < curTime ? nextDayResetTime - DAY : nextDayResetTime;
3199
3200 if (!bgtime)
3202}
3203
3205{
3206 time_t now = GameTime::GetGameTime();
3209
3210 // If the reset time saved in the worldstate is before now it means the server was offline when the reset was supposed to occur.
3211 // In this case we set the reset time in the past and next world update will do the reset and schedule next one in the future.
3212 if (currentDeletionTime < now)
3213 m_NextCalendarOldEventsDeletionTime = nextDeletionTime - DAY;
3214 else
3215 m_NextCalendarOldEventsDeletionTime = nextDeletionTime;
3216
3217 if (!currentDeletionTime)
3219}
3220
3222{
3224 if (!gtime)
3225 m_NextGuildReset = GameTime::GetGameTime(); // game time not yet init
3226
3227 // generate time by config
3228 time_t curTime = GameTime::GetGameTime();
3229 tm localTm;
3230 localtime_r(&curTime, &localTm);
3231 localTm.tm_hour = getIntConfig(CONFIG_GUILD_RESET_HOUR);
3232 localTm.tm_min = 0;
3233 localTm.tm_sec = 0;
3234
3235 // current day reset time
3236 time_t nextDayResetTime = mktime(&localTm);
3237
3238 // next reset time before current moment
3239 if (curTime >= nextDayResetTime)
3240 nextDayResetTime += DAY;
3241
3242 // normalize reset time
3243 m_NextGuildReset = gtime < curTime ? nextDayResetTime - DAY : nextDayResetTime;
3244
3245 if (!gtime)
3247}
3248
3250{
3252 if (!currencytime)
3253 m_NextCurrencyReset = GameTime::GetGameTime(); // game time not yet init
3254
3255 // generate time by config
3256 time_t curTime = GameTime::GetGameTime();
3257 tm localTm;
3258 localtime_r(&curTime, &localTm);
3259
3260 localTm.tm_wday = getIntConfig(CONFIG_CURRENCY_RESET_DAY);
3261 localTm.tm_hour = getIntConfig(CONFIG_CURRENCY_RESET_HOUR);
3262 localTm.tm_min = 0;
3263 localTm.tm_sec = 0;
3264
3265 // current week reset time
3266 time_t nextWeekResetTime = mktime(&localTm);
3267
3268 // next reset time before current moment
3269 if (curTime >= nextWeekResetTime)
3270 nextWeekResetTime += getIntConfig(CONFIG_CURRENCY_RESET_INTERVAL) * DAY;
3271
3272 // normalize reset time
3273 m_NextCurrencyReset = currencytime < curTime ? nextWeekResetTime - getIntConfig(CONFIG_CURRENCY_RESET_INTERVAL) * DAY : nextWeekResetTime;
3274
3275 if (!currencytime)
3277}
3278
3280{
3281 CharacterDatabase.Execute("UPDATE `character_currency` SET `WeeklyQuantity` = 0");
3282
3283 for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
3284 if (itr->second->GetPlayer())
3285 itr->second->GetPlayer()->ResetCurrencyWeekCap();
3286
3289}
3290
3291void World::ResetEventSeasonalQuests(uint16 event_id, time_t eventStartTime)
3292{
3293 TC_LOG_INFO("misc", "Seasonal quests reset for all characters.");
3294
3296 stmt->setUInt16(0, event_id);
3297 stmt->setInt64(1, eventStartTime);
3298 CharacterDatabase.Execute(stmt);
3299
3300 for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
3301 if (itr->second->GetPlayer())
3302 itr->second->GetPlayer()->ResetSeasonalQuestStatus(event_id, eventStartTime);
3303}
3304
3306{
3307 TC_LOG_INFO("misc", "Random BG status reset for all characters.");
3308
3310 CharacterDatabase.Execute(stmt);
3311
3312 for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
3313 if (itr->second->GetPlayer())
3314 itr->second->GetPlayer()->SetRandomWinner(false);
3315
3318}
3319
3328
3330{
3334 week = week < 7 ? week + 1 : 1;
3335
3336 TC_LOG_INFO("misc", "Guild Daily Cap reset. Week: {}", week == 1);
3338 sGuildMgr->ResetTimes(week == 1);
3339}
3340
3346
3348{
3349 if (QueryResult result = WorldDatabase.Query("SELECT db_version, cache_id FROM version LIMIT 1"))
3350 {
3351 Field* fields = result->Fetch();
3352
3353 m_DBVersion = fields[0].GetString();
3354 // will be overwrite by config values if different and non-0
3356 }
3357
3358 if (m_DBVersion.empty())
3359 m_DBVersion = "Unknown world database.";
3360}
3361
3363{
3364 SessionMap::const_iterator itr;
3365 for (itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
3366 if (itr->second && itr->second->GetPlayer() && itr->second->GetPlayer()->IsInWorld())
3367 {
3368 itr->second->GetPlayer()->UpdateAreaDependentAuras(itr->second->GetPlayer()->GetAreaId());
3369 itr->second->GetPlayer()->UpdateZoneDependentAuras(itr->second->GetPlayer()->GetZoneId());
3370 }
3371}
3372
3374{
3375 for (auto&& sessionForBnet : Trinity::Containers::MapEqualRange(m_sessionsByBnetGuid, battlenetAccountGuid))
3376 if (sessionForBnet.second->GetBattlePetMgr()->HasJournalLock())
3377 return true;
3378
3379 return false;
3380}
3381
3386
3391
3393{
3395 return *value;
3396
3397 return 0;
3398}
3399
3401{
3402 m_worldVariables[var.Id] = value;
3403
3405 stmt->setString(0, var.Id);
3406 stmt->setInt32(1, value);
3407 CharacterDatabase.Execute(stmt);
3408}
3409
3411{
3412 uint32 oldMSTime = getMSTime();
3413
3414 if (QueryResult result = CharacterDatabase.Query("SELECT ID, Value FROM world_variable"))
3415 {
3416 do
3417 {
3418 Field* fields = result->Fetch();
3419 m_worldVariables[fields[0].GetString()] = fields[1].GetInt32();
3420 } while (result->NextRow());
3421 }
3422
3423 TC_LOG_INFO("server.loading", ">> Loaded {} world variables in {} ms", m_worldVariables.size(), GetMSTimeDiffToNow(oldMSTime));
3424}
3425
3430
3432{
3433 // Passive reload, we mark the data as invalidated and next time a permission is checked it will be reloaded
3434 TC_LOG_INFO("rbac", "World::ReloadRBAC()");
3435 for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
3436 if (WorldSession* session = itr->second)
3437 session->InvalidateRBACData();
3438}
3439
3444
3446{
3447 std::array<int64, 2> warModeEnabledFaction = { };
3448
3449 // Search for characters that have war mode enabled and played during the last week
3453 if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
3454 {
3455 do
3456 {
3457 Field* fields = result->Fetch();
3458 uint8 race = fields[0].GetUInt8();
3459 if (ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(race))
3460 {
3461 if (FactionTemplateEntry const* raceFaction = sFactionTemplateStore.AssertEntry(raceEntry->FactionID))
3462 {
3463 if (raceFaction->FactionGroup & FACTION_MASK_ALLIANCE)
3464 warModeEnabledFaction[TEAM_ALLIANCE] += fields[1].GetInt64();
3465 else if (raceFaction->FactionGroup & FACTION_MASK_HORDE)
3466 warModeEnabledFaction[TEAM_HORDE] += fields[1].GetInt64();
3467 }
3468 }
3469
3470 } while (result->NextRow());
3471 }
3472
3473 TeamId dominantFaction = TEAM_ALLIANCE;
3474 int32 outnumberedFactionReward = 0;
3475
3476 if (std::any_of(warModeEnabledFaction.begin(), warModeEnabledFaction.end(), [](int64 val) { return val != 0; }))
3477 {
3478 int64 dominantFactionCount = warModeEnabledFaction[TEAM_ALLIANCE];
3479 if (warModeEnabledFaction[TEAM_ALLIANCE] < warModeEnabledFaction[TEAM_HORDE])
3480 {
3481 dominantFactionCount = warModeEnabledFaction[TEAM_HORDE];
3482 dominantFaction = TEAM_HORDE;
3483 }
3484
3485 double total = warModeEnabledFaction[TEAM_ALLIANCE] + warModeEnabledFaction[TEAM_HORDE];
3486 double pct = dominantFactionCount / total;
3487
3489 outnumberedFactionReward = 20;
3491 outnumberedFactionReward = 10;
3493 outnumberedFactionReward = 5;
3494 }
3495
3496 WorldStateMgr::SetValueAndSaveInDb(WS_WAR_MODE_HORDE_BUFF_VALUE, 10 + (dominantFaction == TEAM_ALLIANCE ? outnumberedFactionReward : 0), false, nullptr);
3497 WorldStateMgr::SetValueAndSaveInDb(WS_WAR_MODE_ALLIANCE_BUFF_VALUE, 10 + (dominantFaction == TEAM_HORDE ? outnumberedFactionReward : 0), false, nullptr);
3498}
3499
3501{
3502 return sRealmList->GetCurrentRealmId().GetAddress();
3503}
3504
3505CliCommandHolder::CliCommandHolder(void* callbackArg, char const* command, Print zprint, CommandFinished commandFinished)
3506 : m_callbackArg(callbackArg), m_command(strdup(command)), m_print(zprint), m_commandFinished(commandFinished)
3507{
3508}
3509
#define sAccountMgr
Definition AccountMgr.h:105
#define sAchievementMgr
#define sAreaTriggerDataStore
#define sArenaTeamMgr
#define sAuctionBot
#define sAuctionMgr
#define sBattlefieldMgr
#define sBattlegroundMgr
#define sBlackMarketMgr
#define sCalendarMgr
#define sCharacterCache
@ CHAR_DEL_RESET_CHARACTER_QUESTSTATUS_MONTHLY
@ CHAR_INS_CHARACTER_BAN
@ CHAR_UPD_CHARACTER_BAN
@ CHAR_SEL_ACCOUNT_BY_NAME
@ CHAR_SEL_CHARACTER_COUNT
@ CHAR_DEL_RESET_CHARACTER_QUESTSTATUS_SEASONAL_BY_EVENT
@ CHAR_DEL_RESET_CHARACTER_QUESTSTATUS_DAILY
@ CHAR_REP_WORLD_VARIABLE
@ CHAR_DEL_BATTLEGROUND_RANDOM_ALL
@ CHAR_UPD_CHARACTER_GARRISON_FOLLOWER_ACTIVATIONS
@ CHAR_DEL_RESET_CHARACTER_QUESTSTATUS_WEEKLY
@ CHAR_SEL_WAR_MODE_TUNING
#define sCharacterTemplateDataStore
char const * localeNames[TOTAL_LOCALES]
Definition Common.cpp:20
LocaleConstant
Definition Common.h:51
@ LOCALE_none
Definition Common.h:61
@ TOTAL_LOCALES
Definition Common.h:65
@ LOCALE_enUS
Definition Common.h:52
@ IN_MILLISECONDS
Definition Common.h:38
@ MINUTE
Definition Common.h:32
@ HOUR
Definition Common.h:33
@ DAY
Definition Common.h:34
AccountTypes
Definition Common.h:42
@ SEC_PLAYER
Definition Common.h:43
@ SEC_ADMINISTRATOR
Definition Common.h:46
@ SEC_CONSOLE
Definition Common.h:47
#define sConditionMgr
#define sConfigMgr
Definition Config.h:64
#define sConversationDataStore
#define sFormationMgr
#define sCreatureTextMgr
#define sCriteriaMgr
DB2Storage< MapEntry > sMapStore("Map.db2", &MapLoadInfo::Instance)
DB2Storage< ServerMessagesEntry > sServerMessagesStore("ServerMessages.db2", &ServerMessagesLoadInfo::Instance)
DB2Storage< Cfg_CategoriesEntry > sCfgCategoriesStore("Cfg_Categories.db2", &CfgCategoriesLoadInfo::Instance)
DB2Storage< ChrRacesEntry > sChrRacesStore("ChrRaces.db2", &ChrRacesLoadInfo::Instance)
DB2Storage< FactionTemplateEntry > sFactionTemplateStore("FactionTemplate.db2", &FactionTemplateLoadInfo::Instance)
#define sDB2Manager
Definition DB2Stores.h:579
@ HousingEnabled
@ TransmogEnabled
@ MAX_LEVEL
Definition DBCEnums.h:45
@ STRONG_MAX_LEVEL
Definition DBCEnums.h:49
@ FACTION_MASK_ALLIANCE
Definition DBCEnums.h:1012
@ FACTION_MASK_HORDE
Definition DBCEnums.h:1013
SQLTransaction< CharacterDatabaseConnection > CharacterDatabaseTransaction
SQLTransaction< LoginDatabaseConnection > LoginDatabaseTransaction
std::shared_ptr< ResultSet > QueryResult
std::shared_ptr< PreparedResultSet > PreparedQueryResult
DatabaseWorkerPool< LoginDatabaseConnection > LoginDatabase
Accessor to the realm/login database.
DatabaseWorkerPool< HotfixDatabaseConnection > HotfixDatabase
Accessor to the hotfix database.
DatabaseWorkerPool< CharacterDatabaseConnection > CharacterDatabase
Accessor to the character database.
DatabaseWorkerPool< WorldDatabaseConnection > WorldDatabase
Accessor to the world database.
#define TC_GAME_API
Definition Define.h:129
uint8_t uint8
Definition Define.h:156
int64_t int64
Definition Define.h:149
int32_t int32
Definition Define.h:150
uint64_t uint64
Definition Define.h:153
uint16_t uint16
Definition Define.h:155
uint32_t uint32
Definition Define.h:154
void dtCustomFree(void *ptr)
void * dtCustomAlloc(size_t size, dtAllocHint)
#define ASSERT_NOTNULL(pointer)
Definition Errors.h:74
#define ASSERT
Definition Errors.h:72
#define sGameEventMgr
bool LoadGameObjectModelList(std::string const &dataPath)
void LoadGameTables(std::string const &dataPath)
#define sGarrisonMgr
Definition GarrisonMgr.h:95
#define MIN_GRID_DELAY
Definition GridDefines.h:45
#define MIN_MAP_UPDATE_DELAY
Definition GridDefines.h:46
#define sGroupMgr
Definition GroupMgr.h:66
#define sGuildMgr
Definition GuildMgr.h:76
#define sIPLocation
Definition IPLocation.h:56
#define sInstanceLockMgr
void LoadItemRandomBonusListTemplates()
#define sLFGMgr
Definition LFGMgr.h:515
#define sLanguageMgr
Definition LanguageMgr.h:97
@ LANG_AUTO_BROADCAST
Definition Language.h:1227
#define TC_LOG_DEBUG(filterType__, message__,...)
Definition Log.h:173
#define TC_LOG_ERROR(filterType__, message__,...)
Definition Log.h:182
#define TC_LOG_FATAL(filterType__, message__,...)
Definition Log.h:185
#define TC_LOG_INFO(filterType__, message__,...)
Definition Log.h:176
#define sLog
Definition Log.h:156
#define TC_LOG_WARN(filterType__, message__,...)
Definition Log.h:179
@ LOGIN_INS_ACCOUNT_BANNED
@ LOGIN_UPD_REALM_POPULATION
@ LOGIN_SEL_ACCOUNT_BY_IP
@ LOGIN_UPD_UPTIME_PLAYERS
@ LOGIN_DEL_IP_NOT_BANNED
@ LOGIN_REP_REALM_CHARACTERS
@ LOGIN_INS_IP_BANNED
@ LOGIN_UPD_ACCOUNT_NOT_BANNED
@ LOGIN_SEL_AUTOBROADCAST
@ LOGIN_SEL_ACCOUNT_ID_BY_NAME
@ LOGIN_DEL_OLD_LOGS
#define sLootItemStorage
void LoadLootTables()
Definition LootMgr.cpp:1460
TC_GAME_API void LoadM2Cameras(std::string const &dataPath)
Definition M2Stores.cpp:175
#define sMapMgr
Definition MapManager.h:186
#define TC_METRIC_DETAILED_TIMER(category,...)
Definition Metric.h:240
#define sMetric
Definition Metric.h:160
#define TC_METRIC_VALUE(category, value,...)
Definition Metric.h:206
#define TC_METRIC_EVENT(category, title, description)
Definition Metric.h:201
#define TC_METRIC_TAG(name, value)
Definition Metric.h:187
#define TC_METRIC_DETAILED_NO_THRESHOLD_TIMER(category,...)
Definition Metric.h:241
#define TC_METRIC_TIMER(category,...)
Definition Metric.h:221
#define DEFAULT_VISIBILITY_NOTIFY_PERIOD
Definition NGrid.h:29
#define MAX_VISIBILITY_DISTANCE
#define DEFAULT_VISIBILITY_DISTANCE
#define DEFAULT_VISIBILITY_BGARENAS
#define DEFAULT_VISIBILITY_INSTANCE
#define MAX_PLAYER_NAME
Definition ObjectMgr.h:887
#define MAX_CHARTER_NAME
Definition ObjectMgr.h:890
@ QUERY_DATA_ALL
Definition ObjectMgr.h:956
#define sObjectMgr
Definition ObjectMgr.h:1873
#define MAX_PET_NAME
Definition ObjectMgr.h:889
OpcodeTable opcodeTable
Definition Opcodes.cpp:37
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition Optional.h:25
#define sOutdoorPvPMgr
#define sPetitionMgr
Definition PetitionMgr.h:91
@ PLAYER_FLAGS_WAR_MODE_DESIRED
Definition Player.h:523
constexpr uint64 MAX_MONEY_AMOUNT
Definition Player.h:1028
#define sPoolMgr
Definition PoolMgr.h:179
#define sQuestPoolMgr
Definition QuestPools.h:68
#define sRealmList
Definition RealmList.h:95
constexpr uint32 HARDCODED_DEVELOPMENT_REALM_CATEGORY_ID
Definition Realm.h:135
@ REALM_TYPE_FFA_PVP
Definition Realm.h:131
@ REALM_TYPE_RPPVP
Definition Realm.h:127
@ REALM_TYPE_PVP
Definition Realm.h:124
#define sScenarioMgr
#define sScriptMgr
Definition ScriptMgr.h:1449
#define sScriptReloadMgr
#define CURRENT_EXPANSION
@ LANG_UNIVERSAL
constexpr uint32 GetMaxLevelForExpansion(uint32 expansion)
BanReturn
Ban function return codes.
@ BAN_EXISTS
@ BAN_SYNTAX_ERROR
@ BAN_NOTFOUND
@ BAN_SUCCESS
@ TEAM_ALLIANCE
@ TEAM_HORDE
#define MAX_CHARACTERS_PER_REALM
@ PANDARIA_NEUTRAL
@ ALLIANCE
@ HORDE
@ GUILD_BANKLOG_MAX_RECORDS
@ GUILD_EVENTLOG_MAX_RECORDS
@ GUILD_NEWSLOG_MAX_RECORDS
@ MAX_EXPANSIONS
@ CHAT_MSG_SYSTEM
@ WS_WAR_MODE_HORDE_BUFF_VALUE
@ WS_WAR_MODE_ALLIANCE_BUFF_VALUE
@ WS_PREVIOUS_PVP_SEASON_ID
@ WS_CURRENT_PVP_SEASON_ID
BanMode
Ban function modes.
@ BAN_ACCOUNT
@ BAN_IP
@ BAN_CHARACTER
void LoadSkillDiscoveryTable()
void LoadSkillPerfectItemTable()
void LoadSkillExtraItemTable()
#define sSmartScriptMgr
#define sSpellMgr
Definition SpellMgr.h:812
#define sSupportMgr
Definition SupportMgr.h:327
#define sTerrainMgr
Definition TerrainMgr.h:167
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
Definition Timer.h:57
uint32 getMSTime()
Definition Timer.h:33
#define sTransportMgr
#define MAX_MOVE_TYPE
float baseMoveSpeed[MAX_MOVE_TYPE]
Definition Unit.cpp:98
float playerBaseMoveSpeed[MAX_MOVE_TYPE]
Definition Unit.cpp:111
WorldUpdateTime sWorldUpdateTime
time_t GetLocalHourTimestamp(time_t time, uint8 hour, bool onlyAfterTime)
Definition Util.cpp:101
tm TimeBreakdown(time_t time)
Definition Util.cpp:94
std::string secsToTimeString(uint64 timeInSecs, TimeFormat timeFormat, bool hoursOnly)
Definition Util.cpp:116
uint32 TimeStringToSecs(std::string const &timestring)
Definition Util.cpp:222
#define sWaypointMgr
#define sWhoListStorageMgr
static void StoreConfigValue(T &oldValue, std::type_identity_t< T > value, ConfigOptionLoadDefinition< T, IndexType > const &definition, bool reload)
Definition World.cpp:540
#define USER_HOME_DIRECTORY_VARIABLE
std::array< ConfigOptionLoadDefinition< T, decltype(Max)>, Max > ConfigOptionLoadDefinitionArray
Definition World.cpp:537
static time_t GetNextDailyResetTime(time_t t)
Definition World.cpp:3056
static time_t GetNextWeeklyResetTime(time_t t)
Definition World.cpp:3090
static time_t GetNextMonthlyResetTime(time_t t)
Definition World.cpp:3129
static bool IsBannedAccount(std::string const &name)
static uint32 GetId(std::string_view username)
ObjectGuid const & GetGUID() const
Definition BaseEntity.h:163
bool IsInWorld() const
Definition BaseEntity.h:158
static void LoadFromDB()
static ChannelMgr * ForTeam(Team team)
void SaveToDB()
bool HasSentErrorMessage() const
Definition Chat.h:126
static char * LineFromMessage(char *&pos)
Definition Chat.cpp:39
bool ParseCommands(std::string_view str) override
Definition Chat.cpp:627
static void LoadWarbandSceneDefinitions()
static void LoadMountDefinitions()
static uint32 GetLiquidFlags(uint32 liquidType)
Class used to access individual fields of database query result.
Definition Field.h:94
uint32 GetUInt32() const noexcept
Definition Field.cpp:57
uint8 GetUInt8() const noexcept
Definition Field.cpp:29
int32 GetInt32() const noexcept
Definition Field.cpp:64
std::string GetString() const noexcept
Definition Field.cpp:113
int64 GetInt64() const noexcept
Definition Field.cpp:78
void add(T const &item)
Adds an item to the queue.
Definition LockedQueue.h:40
bool next(T &result)
Gets the next result in the queue, if any.
Definition LockedQueue.h:62
static MMapManager * instance()
void InitializeThreadUnsafe(std::unordered_map< uint32, std::vector< uint32 > > const &mapData)
Definition Map.h:227
void RemoveOldCorpses()
Definition Map.cpp:3939
LowType GetCounter() const
Definition ObjectGuid.h:336
bool IsEmpty() const
Definition ObjectGuid.h:362
void Initialize()
Correspondence between opcodes and their names.
Definition Opcodes.cpp:136
static void InitializeTables()
static void DeleteOldCharacters()
Definition Player.cpp:4172
void SendDirectMessage(WorldPacket const *data) const
Definition Player.cpp:6193
WorldSession * GetSession() const
Definition Player.h:2256
Team GetTeam() const
Definition Player.h:2406
void setUInt16(uint8 index, uint16 value)
void setString(uint8 index, std::string &&value)
void setUInt32(uint8 index, uint32 value)
void setInt64(uint8 index, int64 value)
void setFloat(uint8 index, float value)
void setUInt64(uint8 index, uint64 value)
void setInt32(uint8 index, int32 value)
void setUInt8(uint8 index, uint8 value)
static bool ExistMapAndVMap(uint32 mapid, float x, float y)
void operator()(Player const *receiver) const
Definition World.cpp:2492
std::vector< std::unique_ptr< WorldPackets::Packet > > Packets
Definition World.cpp:2498
void do_helper(std::vector< std::unique_ptr< WorldPackets::Packet > > &dataList, char *text)
Definition World.cpp:2531
static size_t const BufferSize
Definition World.cpp:2502
WorldWorldTextBuilder(uint32 textId, va_list *args=nullptr)
Definition World.cpp:2504
MultiplePacketSender * operator()(LocaleConstant locale)
Definition World.cpp:2506
void UpdateWithDiff(uint32 diff)
static VMapManager * createOrGetVMapManager()
static void clear()
void setEnableLineOfSightCalc(bool enableLineOfSightCalc)
void setEnableHeightCalc(bool enableHeightCalc)
GetLiquidFlagsFn GetLiquidFlagsPtr
void InitializeThreadUnsafe(std::unordered_map< uint32, std::vector< uint32 > > const &mapData)
IsVMAPDisabledForFn IsVMAPDisabledForPtr
uint32 GetZoneId() const
Definition Object.h:332
WorldPacket const * Write() override
void Initialize(ChatMsg chatType, Language language, WorldObject const *sender, WorldObject const *receiver, std::string_view message, uint32 achievementId=0, std::string_view channelName="", LocaleConstant locale=DEFAULT_LOCALE, std::string_view addonPrefix="")
WorldPacket const * Write() override
WorldPacket const * Write() override
Player session in the World.
bool Update(uint32 diff, PacketFilter &updater)
Update the WorldSession (triggered by World update)
ObjectGuid GetBattlenetAccountGUID() const
void SendAuthResponse(uint32 code, bool queued, uint32 queuePos=0)
LocaleConstant GetSessionDbcLocale() const
Player * GetPlayer() const
void SetInQueue(bool state)
Session in auth.queue currently.
bool HasPermission(uint32 permissionId)
void SendPacket(WorldPacket const *packet, bool forced=false)
Send a packet to the client.
uint32 GetAccountId() const
void ResetTimeOutTime(bool onlyActive)
void InitializeSession()
void KickPlayer(std::string_view reason)
Kick a player out of the World.
static void AddInstanceConnection(WorldSession *session, std::weak_ptr< WorldSocket > sockRef, ConnectToKey key)
The World.
Definition World.h:560
time_t m_NextWeeklyQuestReset
Definition World.h:865
static PersistentWorldVariable const NextGuildDailyResetTimeVarId
Definition World.h:126
uint32 ShutdownCancel()
Cancel a planned server shutdown.
Definition World.cpp:2891
bool RemoveBanCharacter(std::string const &name)
Remove a ban from a character.
Definition World.cpp:2790
void UpdateSessions(uint32 diff)
Definition World.cpp:2929
void InitCurrencyResetTime()
Definition World.cpp:3249
uint32 getIntConfig(WorldIntConfigs index) const
Get a server configuration element (see #WorldConfigs)
Definition World.h:715
LocaleConstant m_defaultDbcLocale
Definition World.h:854
static uint8 m_ExitCode
Definition World.h:822
SessionMap m_sessions
Definition World.h:835
uint32 m_int_configs[INT_CONFIG_VALUE_COUNT]
Definition World.h:847
bool RemoveBanAccount(BanMode mode, std::string const &nameOrIP)
Remove a ban from an account or IP address.
Definition World.cpp:2722
static std::atomic< uint32 > m_worldLoopCounter
Definition World.h:569
uint64 m_int64_configs[INT64_CONFIG_VALUE_COUNT]
Definition World.h:848
void AddSession_(WorldSession *s)
Definition World.cpp:361
void SetForcedWarModeFactionBalanceState(TeamId team, int32 reward=0)
Definition World.cpp:2086
float m_float_configs[FLOAT_CONFIG_VALUE_COUNT]
Definition World.h:850
static PersistentWorldVariable const NextOldCalendarEventDeletionTimeVarId
Definition World.h:129
AccountTypes m_allowedSecurityLevel
Definition World.h:853
time_t blackmarket_timer
Definition World.h:833
void LoadConfigSettings(bool reload=false)
Initialize config values.
Definition World.cpp:565
void _UpdateGameTime()
Update the game time.
Definition World.cpp:2812
static std::atomic< bool > m_stopEvent
Definition World.h:821
std::string m_dataPath
Definition World.h:858
float rate_values[MAX_RATES]
Definition World.h:846
void KickAllLess(AccountTypes sec)
Kick (and save) all players with security level less sec
Definition World.cpp:2620
static PersistentWorldVariable const NextMonthlyQuestResetTimeVarId
Definition World.h:127
void SetMotd(std::string motd)
Set a new Message of the Day.
Definition World.cpp:250
bool IsPvPRealm() const
Are we on a "Player versus Player" server?
Definition World.cpp:3382
void SetNewCharString(std::string const &str)
Set the string for new characters (first login)
Definition World.h:632
LockedQueue< WorldSession * > addSessQueue
Definition World.h:877
void SendServerMessage(ServerMessageType messageID, std::string_view stringParam={}, Player const *player=nullptr)
Send a server message to the user(s)
Definition World.cpp:2912
void SetPersistentWorldVariable(PersistentWorldVariable const &var, int32 value)
Definition World.cpp:3400
QueryCallbackProcessor _queryProcessor
Definition World.h:897
bool m_bool_configs[BOOL_CONFIG_VALUE_COUNT]
Definition World.h:849
bool SetInitialWorldSettings()
Initialize the World.
Definition World.cpp:1236
void UpdateRealmCharCount(uint32 accountId)
Definition World.cpp:3019
Queue m_QueuedPlayer
Definition World.h:873
void LoadDBAllowedSecurityLevel()
Definition World.cpp:235
static PersistentWorldVariable const CharacterDatabaseCleaningFlagsVarId
Definition World.h:125
std::mutex _guidAlertLock
Definition World.h:902
void LoadDBVersion()
Definition World.cpp:3347
bool HasRecentlyDisconnected(WorldSession *)
Definition World.cpp:434
void AddQueuedPlayer(WorldSession *)
Definition World.cpp:467
void ResetCurrencyWeekCap()
Definition World.cpp:3279
uint32 GetQueuedSessionCount() const
Definition World.h:581
static PersistentWorldVariable const NextCurrencyResetTimeVarId
Definition World.h:122
void UpdateMaxSessionCounters()
Get the number of current active sessions.
Definition World.cpp:3341
uint32 m_CleaningFlags
Definition World.h:826
static PersistentWorldVariable const NextDailyQuestResetTimeVarId
Definition World.h:128
uint32 m_maxActiveSessionCount
Definition World.h:839
void ResetMonthlyQuests()
Definition World.cpp:3141
time_t m_NextDailyQuestReset
Definition World.h:864
void InitCalendarOldEventsDeletionTime()
Definition World.cpp:3204
uint32 m_PlayerCount
Definition World.h:841
void DoGuidAlertRestart()
Definition World.cpp:308
time_t _warnShutdownTime
Definition World.h:907
void TriggerGuidAlert()
Definition World.cpp:289
bool IsFFAPvPRealm() const
Definition World.cpp:3387
time_t m_NextCurrencyReset
Definition World.h:870
void ResetGuildCap()
Definition World.cpp:3329
bool RemoveSession(uint32 id)
Remove a given session.
Definition World.cpp:335
time_t m_NextRandomBGReset
Definition World.h:867
Player * FindPlayerInZone(uint32 zone)
Find a player in a specified zone.
Definition World.cpp:203
BanReturn BanCharacter(std::string const &name, std::string const &duration, std::string const &reason, std::string const &author)
Ban an account or ban an IP address, duration will be parsed using TimeStringToSecs if it is positive...
Definition World.cpp:2751
int32 GetPersistentWorldVariable(PersistentWorldVariable const &var) const
Definition World.cpp:3392
void TriggerGuidWarning()
Definition World.cpp:270
void SendGMText(uint32 string_id,...)
Send a System Message to all GMs (except self if mentioned)
Definition World.cpp:2567
void ShutdownMsg(bool show=false, Player *player=nullptr, const std::string &reason=std::string())
Display a shutdown message to the user(s)
Definition World.cpp:2865
static PersistentWorldVariable const NextGuildWeeklyResetTimeVarId
Definition World.h:130
void InitGuildResetTime()
Definition World.cpp:3221
std::string m_DBVersion
Definition World.h:882
BanReturn BanAccount(BanMode mode, std::string const &nameOrIP, std::string const &duration, std::string const &reason, std::string const &author)
Ban an account or ban an IP address, duration will be parsed using TimeStringToSecs if it is positive...
Definition World.cpp:2629
time_t mail_timer_expires
Definition World.h:832
void InitRandomBGResetTime()
Definition World.cpp:3176
std::vector< std::string > const & GetMotd() const
Get the current Message of the Day.
Definition World.cpp:265
~World()
World destructor.
Definition World.cpp:177
std::unordered_multimap< ObjectGuid, WorldSession * > m_sessionsByBnetGuid
Definition World.h:836
bool getBoolConfig(WorldBoolConfigs index) const
Get a server configuration element (see #WorldConfigs)
Definition World.h:689
static PersistentWorldVariable const NextBGRandomDailyResetTimeVarId
Definition World.h:124
void ResetWeeklyQuests()
Definition World.cpp:3102
void _UpdateRealmCharCount(PreparedQueryResult resultCharCount)
Definition World.cpp:3029
uint32 GetActiveSessionCount() const
Definition World.h:580
DisconnectMap m_disconnects
Definition World.h:838
time_t m_NextCalendarOldEventsDeletionTime
Definition World.h:868
std::vector< GameRule > _gameRules
Definition World.h:909
void ReloadRBAC()
Definition World.cpp:3431
uint32 m_availableDbcLocaleMask
Definition World.h:855
void DailyReset()
Definition World.cpp:3061
void UpdateWarModeRewardValues()
Definition World.cpp:3445
time_t mail_timer
Definition World.h:831
std::string _guidWarningMsg
Definition World.h:899
void ResetRandomBG()
Definition World.cpp:3305
uint32 m_ShutdownMask
Definition World.h:824
void ResetEventSeasonalQuests(uint16 event_id, time_t eventStartTime)
Definition World.cpp:3291
time_t m_NextGuildReset
Definition World.h:869
void SetPlayerSecurityLimit(AccountTypes sec)
Definition World.cpp:241
AutobroadcastContainer m_Autobroadcasts
Definition World.h:890
bool IsClosed() const
Deny clients?
Definition World.cpp:222
uint32 m_ShutdownTimer
Definition World.h:823
void KickAll()
Kick (and save) all players.
Definition World.cpp:2610
uint32 GetPlayerAmountLimit() const
Definition World.h:611
void SendGuidWarning()
Definition World.cpp:316
void AddSession(WorldSession *s)
Definition World.cpp:351
void CheckScheduledResetTimes()
Definition World.cpp:3165
std::string _alertRestartReason
Definition World.h:900
void ForceGameEventUpdate()
Definition World.cpp:2439
static PersistentWorldVariable const NextWeeklyQuestResetTimeVarId
Definition World.h:123
void CalendarDeleteOldEvents()
Definition World.cpp:3320
void ProcessQueryCallbacks()
Definition World.cpp:3426
void RemoveOldCorpses()
Definition World.cpp:3440
static World * instance()
Definition World.cpp:196
uint32 m_MaxPlayerCount
Definition World.h:842
float getFloatConfig(WorldFloatConfigs index) const
Get a server configuration element (see #WorldConfigs)
Definition World.h:702
void AddInstanceSocket(std::weak_ptr< WorldSocket > sock, uint64 connectToKey)
Definition World.cpp:356
LocaleConstant GetDefaultDbcLocale() const
Definition World.h:636
void SendGlobalMessage(WorldPacket const *packet, WorldSession *self=nullptr, Optional< Team > team={ })
Send a packet to all players (except self if mentioned)
Definition World.cpp:2448
uint32 GetActiveAndQueuedSessionCount() const
Definition World.h:579
WorldSession * FindSession(uint32 id) const
Find a session by its id.
Definition World.cpp:324
int32 GetQueuePos(WorldSession *)
Definition World.cpp:456
bool RemoveQueuedPlayer(WorldSession *session)
Definition World.cpp:476
void UpdateAreaDependentAuras()
Definition World.cpp:3362
void InitQuestResetTimes()
Definition World.cpp:3049
bool _guidWarn
Definition World.h:904
bool m_isClosed
Definition World.h:828
void DisableForcedWarModeFactionBalanceState()
Definition World.cpp:2092
uint32 GetMaxPlayerCount() const
Definition World.h:587
IntervalTimer m_timers[WUPDATE_COUNT]
Definition World.h:830
bool _guidAlert
Definition World.h:905
std::unordered_map< std::string, int32 > m_worldVariables
Definition World.h:851
void SendGlobalGMMessage(WorldPacket const *packet, WorldSession *self=nullptr, Optional< Team > team={ })
Send a packet to all GMs (except self if mentioned)
Definition World.cpp:2465
void SendGlobalText(char const *text, WorldSession *self)
DEPRECATED, only for debug purpose. Send a System Message to all players (except self if mentioned)
Definition World.cpp:2593
static bool IsStopped()
Definition World.h:671
time_t m_NextMonthlyQuestReset
Definition World.h:866
std::vector< std::string > _motd
Definition World.h:857
uint32 m_maxQueuedSessionCount
Definition World.h:840
void SendAutoBroadcast()
Definition World.cpp:2994
void Update(uint32 diff)
Update the World !
Definition World.cpp:2126
bool IsBattlePetJournalLockAcquired(ObjectGuid battlenetAccountGuid)
Definition World.cpp:3373
uint32 m_playerLimit
Definition World.h:852
void LoadAutobroadcasts()
Definition World.cpp:2097
void LoadPersistentWorldVariables()
Definition World.cpp:3410
void SetPlayerAmountLimit(uint32 limit)
Active session server limit.
Definition World.h:610
LockedQueue< std::pair< std::weak_ptr< WorldSocket >, uint64 > > _linkSocketQueue
Definition World.h:879
bool m_allowMovement
Definition World.h:856
void SendWorldText(uint32 string_id,...)
Send a System Message to all players (except self if mentioned)
Definition World.cpp:2548
void DoGuidWarningRestart()
Definition World.cpp:299
void ProcessCliCommands()
Definition World.cpp:2976
void SetClosed(bool val)
Close world.
Definition World.cpp:227
uint32 _warnDiff
Definition World.h:906
LockedQueue< CliCommandHolder * > cliCmdQueue
Definition World.h:861
World()
World constructor.
Definition World.cpp:133
void ShutdownServ(uint32 time, uint32 options, uint8 exitcode, const std::string &reason=std::string())
Shutdown the server.
Definition World.cpp:2842
void commandFinished(void *, bool)
#define sWorld
Definition World.h:919
ServerMessageType
Definition World.h:50
void LoadWeatherData()
WorldIntConfigs
Definition World.h:237
uint32 GetVirtualRealmAddress()
Definition World.cpp:3500
WorldFloatConfigs
Definition World.h:206
ShutdownExitCode
Definition World.h:74
ShutdownMask
Definition World.h:67
@ SERVER_MSG_SHUTDOWN_TIME
Definition World.h:51
@ SERVER_MSG_STRING
Definition World.h:53
@ SERVER_MSG_SHUTDOWN_CANCELLED
Definition World.h:54
@ SERVER_MSG_RESTART_CANCELLED
Definition World.h:55
@ SERVER_MSG_RESTART_TIME
Definition World.h:52
@ CONFIG_AUTOBROADCAST_CENTER
Definition World.h:371
@ CONFIG_ARENA_START_MATCHMAKER_RATING
Definition World.h:347
@ CONFIG_RESPAWN_RESTARTQUIETTIME
Definition World.h:423
@ CONFIG_ARENA_SEASON_ID
Definition World.h:344
@ CONFIG_CORPSE_DECAY_ELITE
Definition World.h:329
@ CONFIG_MAX_INSTANCES_PER_HOUR
Definition World.h:379
@ CONFIG_GUILD_EVENT_LOG_COUNT
Definition World.h:360
@ CONFIG_ARENA_START_RATING
Definition World.h:345
@ CONFIG_SOCKET_TIMEOUTTIME
Definition World.h:245
@ CONFIG_MAX_OVERSPEED_PINGS
Definition World.h:305
@ CONFIG_NO_GRAY_AGGRO_BELOW
Definition World.h:414
@ CONFIG_CHARDELETE_METHOD
Definition World.h:367
@ CONFIG_SESSION_ADD_DELAY
Definition World.h:246
@ CONFIG_MIN_CREATURE_SCALED_XP_RATIO
Definition World.h:282
@ CONFIG_CORPSE_DECAY_OBSOLETE
Definition World.h:331
@ CONFIG_CHARACTER_CREATING_DISABLED_CLASSMASK
Definition World.h:256
@ CONFIG_CLIENTCACHE_VERSION
Definition World.h:358
@ CONFIG_TOLBARAD_BATTLETIME
Definition World.h:390
@ CONFIG_DAILY_QUEST_RESET_TIME_HOUR
Definition World.h:277
@ CONFIG_CURRENCY_RESET_DAY
Definition World.h:270
@ CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF
Definition World.h:315
@ CONFIG_CREATURE_PICKPOCKET_REFILL
Definition World.h:405
@ CONFIG_BG_REWARD_WINNER_CONQUEST_FIRST
Definition World.h:403
@ CONFIG_SKILL_CHANCE_ORANGE
Definition World.h:297
@ CONFIG_GM_CHAT
Definition World.h:286
@ CONFIG_VISIBILITY_NOTIFY_PERIOD_CONTINENT
Definition World.h:431
@ CONFIG_RESPAWN_DYNAMICMODE
Definition World.h:420
@ CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_EVOKER
Definition World.h:261
@ CONFIG_CHATFLOOD_MUTE_TIME
Definition World.h:311
@ CONFIG_STRICT_PET_NAMES
Definition World.h:251
@ CONFIG_CHARACTER_CREATING_DISABLED
Definition World.h:255
@ CONFIG_MIN_PET_NAME
Definition World.h:254
@ CONFIG_LOGDB_CLEARTIME
Definition World.h:357
@ CONFIG_TOLBARAD_PLR_MIN_LVL
Definition World.h:389
@ CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF
Definition World.h:316
@ CONFIG_VISIBILITY_NOTIFY_PERIOD_BATTLEGROUND
Definition World.h:433
@ CONFIG_INTERVAL_CHANGEWEATHER
Definition World.h:242
@ CONFIG_PRESERVE_CUSTOM_CHANNEL_INTERVAL
Definition World.h:376
@ CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION
Definition World.h:375
@ CONFIG_GM_WHISPERING_TO
Definition World.h:287
@ CONFIG_TOLBARAD_RESTART_AFTER_CRASH
Definition World.h:393
@ CONFIG_SKILL_CHANCE_SKINNING_STEPS
Definition World.h:302
@ CONFIG_SKILL_CHANCE_YELLOW
Definition World.h:298
@ CONFIG_RESPAWN_GUIDWARNING_FREQUENCY
Definition World.h:426
@ CONFIG_AUTOBROADCAST_INTERVAL
Definition World.h:372
@ CONFIG_PVP_TOKEN_MAP_TYPE
Definition World.h:351
@ CONFIG_ENABLE_SINFO_LOGIN
Definition World.h:354
@ CONFIG_CHARTER_COST_GUILD
Definition World.h:409
@ CONFIG_CHARDELETE_MIN_LEVEL
Definition World.h:368
@ CONFIG_FORCE_SHUTDOWN_THRESHOLD
Definition World.h:292
@ CONFIG_ARENA_MAX_RATING_DIFFERENCE
Definition World.h:341
@ CONFIG_BG_REWARD_LOSER_HONOR_LAST
Definition World.h:402
@ CONFIG_START_ALLIED_RACE_LEVEL
Definition World.h:268
@ CONFIG_BLACKMARKET_UPDATE_PERIOD
Definition World.h:429
@ CONFIG_TOLBARAD_BONUSTIME
Definition World.h:391
@ CONFIG_AUCTION_TAINTED_SEARCH_DELAY
Definition World.h:417
@ CONFIG_WHO_LIST_UPDATE_INTERVAL
Definition World.h:349
@ CONFIG_GAME_TYPE
Definition World.h:247
@ CONFIG_ARENA_RATED_UPDATE_TIMER
Definition World.h:343
@ CONFIG_START_DEMON_HUNTER_PLAYER_LEVEL
Definition World.h:267
@ CONFIG_START_GM_LEVEL
Definition World.h:291
@ CONFIG_MAIL_LEVEL_REQ
Definition World.h:327
@ CONFIG_MIN_PETITION_SIGNS
Definition World.h:280
@ CONFIG_RESPAWN_DYNAMICMINIMUM_CREATURE
Definition World.h:424
@ CONFIG_PARTY_LEVEL_REQ
Definition World.h:324
@ CONFIG_MIN_LEVEL_STAT_SAVE
Definition World.h:362
@ CONFIG_BATTLEGROUND_INVITATION_TYPE
Definition World.h:337
@ CONFIG_START_DEATH_KNIGHT_PLAYER_LEVEL
Definition World.h:266
@ CONFIG_MAX_PLAYER_LEVEL
Definition World.h:263
@ CONFIG_MIN_CHARTER_NAME
Definition World.h:253
@ CONFIG_CHAT_CHANNEL_LEVEL_REQ
Definition World.h:319
@ CONFIG_CHARACTERS_PER_ACCOUNT
Definition World.h:257
@ CONFIG_DEATH_SICKNESS_LEVEL
Definition World.h:335
@ CONFIG_CHARTER_COST_ARENA_5v5
Definition World.h:412
@ CONFIG_WINTERGRASP_PLR_MIN_LVL
Definition World.h:383
@ CONFIG_PVP_TOKEN_ID
Definition World.h:352
@ CONFIG_GUILD_RESET_HOUR
Definition World.h:365
@ CONFIG_CURRENCY_RESET_HOUR
Definition World.h:269
@ CONFIG_MAIL_DELIVERY_DELAY
Definition World.h:294
@ CONFIG_WINTERGRASP_BATTLETIME
Definition World.h:384
@ CONFIG_CORPSE_DECAY_MINUSMOB
Definition World.h:334
@ CONFIG_GM_FREEZE_DURATION
Definition World.h:288
@ CONFIG_WINTERGRASP_NOBATTLETIME
Definition World.h:385
@ CONFIG_PVP_TOKEN_COUNT
Definition World.h:353
@ CONFIG_PACKET_SPOOF_BANDURATION
Definition World.h:397
@ CONFIG_SKILL_CHANCE_MINING_STEPS
Definition World.h:301
@ CONFIG_GUILD_BANK_EVENT_LOG_COUNT
Definition World.h:361
@ CONFIG_TRADE_LEVEL_REQ
Definition World.h:325
@ CONFIG_AHBOT_UPDATE_INTERVAL
Definition World.h:407
@ CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH
Definition World.h:339
@ CONFIG_CORPSE_DECAY_NORMAL
Definition World.h:328
@ CONFIG_WINTERGRASP_RESTART_AFTER_CRASH
Definition World.h:386
@ CONFIG_SOCKET_TIMEOUTTIME_ACTIVE
Definition World.h:427
@ CONFIG_START_PLAYER_LEVEL
Definition World.h:265
@ CONFIG_RESPAWN_GUIDALERTLEVEL
Definition World.h:422
@ CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL
Definition World.h:272
@ CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL_DIFFERENCE
Definition World.h:273
@ CONFIG_CLEAN_OLD_MAIL_TIME
Definition World.h:295
@ CONFIG_INTERVAL_GRIDCLEAN
Definition World.h:240
@ CONFIG_BG_REWARD_WINNER_HONOR_FIRST
Definition World.h:399
@ CONFIG_ARENA_START_PERSONAL_RATING
Definition World.h:346
@ CONFIG_COMPRESSION
Definition World.h:238
@ CONFIG_STRICT_CHARTER_NAMES
Definition World.h:250
@ CONFIG_INTERVAL_SAVE
Definition World.h:239
@ CONFIG_BG_REWARD_LOSER_HONOR_FIRST
Definition World.h:401
@ CONFIG_RESET_SCHEDULE_WEEK_DAY
Definition World.h:274
@ CONFIG_PACKET_SPOOF_POLICY
Definition World.h:395
@ CONFIG_CHATFLOOD_ADDON_MESSAGE_COUNT
Definition World.h:309
@ CONFIG_FEATURE_SYSTEM_CHARACTER_UNDELETE_COOLDOWN
Definition World.h:408
@ CONFIG_CHAT_YELL_LEVEL_REQ
Definition World.h:323
@ CONFIG_BG_REWARD_WINNER_CONQUEST_LAST
Definition World.h:404
@ CONFIG_LFG_OPTIONSMASK
Definition World.h:378
@ CONFIG_GM_LOGIN_STATE
Definition World.h:284
@ CONFIG_GUILD_NEWS_LOG_COUNT
Definition World.h:359
@ CONFIG_CORPSE_DECAY_TRIVIAL
Definition World.h:333
@ CONFIG_AUCTION_LEVEL_REQ
Definition World.h:326
@ CONFIG_TOLBARAD_PLR_MAX
Definition World.h:387
@ CONFIG_REALM_ZONE
Definition World.h:248
@ CONFIG_CHAT_STRICT_LINK_CHECKING_KICK
Definition World.h:318
@ CONFIG_GM_LEVEL_IN_GM_LIST
Definition World.h:289
@ CONFIG_ARENA_RATING_DISCARD_TIMER
Definition World.h:342
@ CONFIG_TOLBARAD_PLR_MIN
Definition World.h:388
@ CONFIG_CHARACTER_CREATING_EVOKERS_PER_REALM
Definition World.h:259
@ CONFIG_CALENDAR_DELETE_OLD_EVENTS_HOUR
Definition World.h:364
@ CONFIG_GM_VISIBLE_STATE
Definition World.h:285
@ CONFIG_NO_GRAY_AGGRO_ABOVE
Definition World.h:413
@ CONFIG_AUCTION_REPLICATE_DELAY
Definition World.h:415
@ CONFIG_GUILD_SAVE_INTERVAL
Definition World.h:394
@ CONFIG_GROUP_VISIBILITY
Definition World.h:293
@ CONFIG_CREATURE_FAMILY_FLEE_DELAY
Definition World.h:313
@ CONFIG_PACKET_SPOOF_BANMODE
Definition World.h:396
@ CONFIG_CHARDELETE_DEMON_HUNTER_MIN_LEVEL
Definition World.h:370
@ CONFIG_XP_BOOST_DAYMASK
Definition World.h:380
@ CONFIG_MIN_DISCOVERED_SCALED_XP_RATIO
Definition World.h:283
@ CONFIG_MAX_WHO
Definition World.h:348
@ CONFIG_CHARDELETE_KEEP_DAYS
Definition World.h:366
@ CONFIG_TOLBARAD_NOBATTLETIME
Definition World.h:392
@ CONFIG_MAX_RESULTS_LOOKUP_COMMANDS
Definition World.h:373
@ CONFIG_VISIBILITY_NOTIFY_PERIOD_ARENA
Definition World.h:434
@ CONFIG_CREATURE_STOP_FOR_PLAYER
Definition World.h:406
@ CONFIG_INTERVAL_DISCONNECT_TOLERANCE
Definition World.h:243
@ CONFIG_CHAT_WHISPER_LEVEL_REQ
Definition World.h:320
@ CONFIG_SKILL_GAIN_GATHERING
Definition World.h:304
@ CONFIG_CHARTER_COST_ARENA_2v2
Definition World.h:410
@ CONFIG_CHATFLOOD_MESSAGE_DELAY
Definition World.h:308
@ CONFIG_CHARDELETE_DEATH_KNIGHT_MIN_LEVEL
Definition World.h:369
@ CONFIG_DISABLE_BREATHING
Definition World.h:336
@ CONFIG_FACTION_BALANCE_LEVEL_CHECK_DIFF
Definition World.h:430
@ CONFIG_ACC_PASSCHANGESEC
Definition World.h:398
@ CONFIG_STRICT_PLAYER_NAMES
Definition World.h:249
@ CONFIG_LOGDB_CLEARINTERVAL
Definition World.h:356
@ CONFIG_BATTLEGROUND_REPORT_AFK
Definition World.h:340
@ CONFIG_MIN_QUEST_SCALED_XP_RATIO
Definition World.h:281
@ CONFIG_INSTANCE_UNLOAD_DELAY
Definition World.h:276
@ CONFIG_GM_LEVEL_IN_WHO_LIST
Definition World.h:290
@ CONFIG_CURRENCY_RESET_INTERVAL
Definition World.h:271
@ CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER
Definition World.h:338
@ CONFIG_HONOR_AFTER_DUEL
Definition World.h:350
@ CONFIG_WEEKLY_QUEST_RESET_TIME_WDAY
Definition World.h:278
@ CONFIG_PERSISTENT_CHARACTER_CLEAN_FLAGS
Definition World.h:377
@ CONFIG_EXPANSION
Definition World.h:306
@ CONFIG_CORPSE_DECAY_RARE
Definition World.h:332
@ CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY
Definition World.h:317
@ CONFIG_RESPAWN_GUIDWARNLEVEL
Definition World.h:421
@ CONFIG_UPTIME_UPDATE
Definition World.h:296
@ CONFIG_TALENTS_INSPECTING
Definition World.h:418
@ CONFIG_WINTERGRASP_PLR_MAX
Definition World.h:381
@ CONFIG_CHAT_EMOTE_LEVEL_REQ
Definition World.h:321
@ CONFIG_AUCTION_SEARCH_DELAY
Definition World.h:416
@ CONFIG_VISIBILITY_NOTIFY_PERIOD_INSTANCE
Definition World.h:432
@ CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_DEMON_HUNTER
Definition World.h:260
@ CONFIG_PORT_WORLD
Definition World.h:244
@ CONFIG_MIN_DUALSPEC_LEVEL
Definition World.h:264
@ CONFIG_SKILL_GAIN_CRAFTING
Definition World.h:303
@ CONFIG_RANDOM_BG_RESET_HOUR
Definition World.h:363
@ CONFIG_DB_PING_INTERVAL
Definition World.h:374
@ CONFIG_WORLD_BOSS_LEVEL_DIFF
Definition World.h:314
@ CONFIG_CORPSE_DECAY_RAREELITE
Definition World.h:330
@ CONFIG_CHATFLOOD_MESSAGE_COUNT
Definition World.h:307
@ CONFIG_RESPAWN_DYNAMICMINIMUM_GAMEOBJECT
Definition World.h:425
@ CONFIG_CHARTER_COST_ARENA_3v3
Definition World.h:411
@ CONFIG_MIN_PLAYER_NAME
Definition World.h:252
@ CONFIG_CHATFLOOD_ADDON_MESSAGE_DELAY
Definition World.h:310
@ CONFIG_SKILL_CHANCE_GREY
Definition World.h:300
@ CONFIG_INTERVAL_MAPUPDATE
Definition World.h:241
@ CONFIG_NUMTHREADS
Definition World.h:355
@ CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY
Definition World.h:312
@ CONFIG_MAX_PRIMARY_TRADE_SKILL
Definition World.h:279
@ CONFIG_RESET_SCHEDULE_HOUR
Definition World.h:275
@ CONFIG_SKIP_CINEMATICS
Definition World.h:262
@ CONFIG_SKILL_CHANCE_GREEN
Definition World.h:299
@ CONFIG_CHAT_SAY_LEVEL_REQ
Definition World.h:322
@ CONFIG_WINTERGRASP_PLR_MIN
Definition World.h:382
@ CONFIG_BLACKMARKET_MAXAUCTIONS
Definition World.h:428
@ CONFIG_BG_REWARD_WINNER_HONOR_LAST
Definition World.h:400
@ CONFIG_CHARACTERS_PER_REALM
Definition World.h:258
@ CONFIG_RESPAWN_MINCHECKINTERVALMS
Definition World.h:419
@ WUPDATE_DELETECHARS
Definition World.h:91
@ WUPDATE_GUILDSAVE
Definition World.h:94
@ WUPDATE_COUNT
Definition World.h:99
@ WUPDATE_CLEANDB
Definition World.h:88
@ WUPDATE_CORPSES
Definition World.h:86
@ WUPDATE_PINGDB
Definition World.h:93
@ WUPDATE_CHANNEL_SAVE
Definition World.h:98
@ WUPDATE_AUCTIONS_PENDING
Definition World.h:84
@ WUPDATE_AUTOBROADCAST
Definition World.h:89
@ WUPDATE_WHO_LIST
Definition World.h:97
@ WUPDATE_CHECK_FILECHANGES
Definition World.h:96
@ WUPDATE_UPTIME
Definition World.h:85
@ WUPDATE_BLACKMARKET
Definition World.h:95
@ WUPDATE_EVENTS
Definition World.h:87
@ WUPDATE_AUCTIONS
Definition World.h:83
@ WUPDATE_AHBOT
Definition World.h:92
@ RATE_POWER_CHI
Definition World.h:465
@ RATE_DAMAGE_FALL
Definition World.h:516
@ RATE_CREATURE_DAMAGE_NORMAL
Definition World.h:498
@ RATE_DROP_ITEM_REFERENCED_AMOUNT
Definition World.h:480
@ RATE_POWER_RUNIC_POWER_LOSS
Definition World.h:460
@ RATE_CREATURE_DAMAGE_RAREELITE
Definition World.h:500
@ RATE_POWER_RAGE_INCOME
Definition World.h:454
@ RATE_CREATURE_AGGRO
Definition World.h:512
@ RATE_POWER_RAGE_LOSS
Definition World.h:455
@ RATE_REPUTATION_LOWLEVEL_QUEST
Definition World.h:489
@ RATE_CREATURE_HP_ELITE
Definition World.h:492
@ RATE_DURABILITY_LOSS_BLOCK
Definition World.h:527
@ RATE_DROP_ITEM_RARE
Definition World.h:475
@ RATE_REPUTATION_LOWLEVEL_KILL
Definition World.h:488
@ RATE_XP_KILL
Definition World.h:482
@ RATE_INSTANCE_RESET_TIME
Definition World.h:522
@ RATE_CREATURE_HP_RARE
Definition World.h:495
@ RATE_CREATURE_DAMAGE_ELITE
Definition World.h:499
@ RATE_REST_OFFLINE_IN_WILDERNESS
Definition World.h:515
@ RATE_POWER_ENERGY
Definition World.h:457
@ RATE_CREATURE_SPELLDAMAGE_TRIVIAL
Definition World.h:510
@ RATE_MONEY_MAX_LEVEL_QUEST
Definition World.h:531
@ RATE_CREATURE_SPELLDAMAGE_NORMAL
Definition World.h:505
@ RATE_POWER_MANA
Definition World.h:453
@ RATE_DROP_ITEM_LEGENDARY
Definition World.h:477
@ RATE_DURABILITY_LOSS_PARRY
Definition World.h:525
@ RATE_DROP_ITEM_POOR
Definition World.h:472
@ RATE_REST_OFFLINE_IN_TAVERN_OR_CITY
Definition World.h:514
@ RATE_AUCTION_DEPOSIT
Definition World.h:518
@ RATE_DROP_ITEM_UNCOMMON
Definition World.h:474
@ RATE_DROP_ITEM_REFERENCED
Definition World.h:479
@ RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS
Definition World.h:490
@ RATE_REPAIRCOST
Definition World.h:486
@ RATE_CREATURE_SPELLDAMAGE_RAREELITE
Definition World.h:507
@ RATE_DROP_MONEY
Definition World.h:481
@ RATE_DURABILITY_LOSS_DAMAGE
Definition World.h:524
@ RATE_MONEY_QUEST
Definition World.h:530
@ RATE_AUCTION_CUT
Definition World.h:519
@ RATE_HEALTH
Definition World.h:452
@ RATE_MOVESPEED
Definition World.h:528
@ RATE_DURABILITY_LOSS_ON_DEATH
Definition World.h:523
@ RATE_XP_QUEST
Definition World.h:484
@ RATE_XP_BOOST
Definition World.h:529
@ RATE_DROP_ITEM_EPIC
Definition World.h:476
@ RATE_CREATURE_HP_OBSOLETE
Definition World.h:494
@ RATE_SKILL_DISCOVERY
Definition World.h:471
@ RATE_POWER_MAELSTROM
Definition World.h:464
@ RATE_DROP_ITEM_ARTIFACT
Definition World.h:478
@ RATE_CREATURE_DAMAGE_OBSOLETE
Definition World.h:501
@ RATE_CREATURE_DAMAGE_MINUSMOB
Definition World.h:504
@ RATE_XP_EXPLORE
Definition World.h:485
@ RATE_POWER_INSANITY
Definition World.h:466
@ RATE_POWER_FURY
Definition World.h:468
@ RATE_REPUTATION_GAIN
Definition World.h:487
@ RATE_REST_INGAME
Definition World.h:513
@ RATE_POWER_RUNIC_POWER_INCOME
Definition World.h:459
@ RATE_POWER_FOCUS
Definition World.h:456
@ RATE_XP_BG_KILL
Definition World.h:483
@ RATE_CREATURE_HP_NORMAL
Definition World.h:491
@ RATE_POWER_ARCANE_CHARGES
Definition World.h:467
@ RATE_CREATURE_HP_MINUSMOB
Definition World.h:497
@ RATE_HONOR
Definition World.h:520
@ RATE_POWER_HOLY_POWER
Definition World.h:463
@ RATE_POWER_LUNAR_POWER
Definition World.h:462
@ RATE_CREATURE_HP_TRIVIAL
Definition World.h:496
@ RATE_CORPSE_DECAY_LOOTED
Definition World.h:521
@ RATE_DURABILITY_LOSS_ABSORB
Definition World.h:526
@ RATE_AUCTION_TIME
Definition World.h:517
@ RATE_CREATURE_DAMAGE_RARE
Definition World.h:502
@ RATE_CREATURE_DAMAGE_TRIVIAL
Definition World.h:503
@ RATE_CREATURE_SPELLDAMAGE_ELITE
Definition World.h:506
@ RATE_POWER_ESSENCE
Definition World.h:470
@ RATE_CREATURE_SPELLDAMAGE_MINUSMOB
Definition World.h:511
@ RATE_DROP_ITEM_NORMAL
Definition World.h:473
@ RATE_POWER_SOUL_SHARDS
Definition World.h:461
@ RATE_CREATURE_HP_RAREELITE
Definition World.h:493
@ RATE_CREATURE_SPELLDAMAGE_OBSOLETE
Definition World.h:508
@ RATE_CREATURE_SPELLDAMAGE_RARE
Definition World.h:509
@ RATE_POWER_PAIN
Definition World.h:469
@ RATE_POWER_COMBO_POINTS_LOSS
Definition World.h:458
@ CONFIG_STATS_LIMITS_DODGE
Definition World.h:216
@ CONFIG_RESPAWN_DYNAMICRATE_CREATURE
Definition World.h:224
@ CONFIG_SIGHT_MONSTER
Definition World.h:209
@ CONFIG_ARENA_WIN_RATING_MODIFIER_1
Definition World.h:220
@ CONFIG_GROUP_XP_DISTANCE
Definition World.h:207
@ CONFIG_CALL_TO_ARMS_20_PCT
Definition World.h:228
@ CONFIG_MAX_VISIBILITY_DISTANCE_ARENA
Definition World.h:232
@ CONFIG_LISTEN_RANGE_YELL
Definition World.h:212
@ CONFIG_STATS_LIMITS_PARRY
Definition World.h:217
@ CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS
Definition World.h:213
@ CONFIG_ARENA_WIN_RATING_MODIFIER_2
Definition World.h:221
@ CONFIG_ARENA_LOSE_RATING_MODIFIER
Definition World.h:222
@ CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS
Definition World.h:214
@ CONFIG_LISTEN_RANGE_SAY
Definition World.h:210
@ CONFIG_MAX_VISIBILITY_DISTANCE_INSTANCE
Definition World.h:230
@ CONFIG_MAX_VISIBILITY_DISTANCE_BATTLEGROUND
Definition World.h:231
@ CONFIG_THREAT_RADIUS
Definition World.h:215
@ CONFIG_MAX_VISIBILITY_DISTANCE_CONTINENT
Definition World.h:229
@ CONFIG_MAX_RECRUIT_A_FRIEND_DISTANCE
Definition World.h:208
@ CONFIG_ARENA_MATCHMAKER_RATING_MODIFIER
Definition World.h:223
@ CONFIG_CALL_TO_ARMS_5_PCT
Definition World.h:226
@ CONFIG_RESPAWN_DYNAMICRATE_GAMEOBJECT
Definition World.h:225
@ CONFIG_CALL_TO_ARMS_10_PCT
Definition World.h:227
@ CONFIG_STATS_LIMITS_CRIT
Definition World.h:219
@ CONFIG_LISTEN_RANGE_TEXTEMOTE
Definition World.h:211
@ CONFIG_STATS_LIMITS_BLOCK
Definition World.h:218
@ CONFIG_ALLOW_TWO_SIDE_INTERACTION_CALENDAR
Definition World.h:110
@ CONFIG_SHOW_KICK_IN_WORLD
Definition World.h:152
@ CONFIG_QUEST_IGNORE_AUTO_COMPLETE
Definition World.h:166
@ CONFIG_BG_XP_FOR_KILL
Definition World.h:141
@ CONFIG_CREATURE_CHECK_INVALID_POSITION
Definition World.h:191
@ CONFIG_SUPPORT_COMPLAINTS_ENABLED
Definition World.h:159
@ CONFIG_AUTOBROADCAST
Definition World.h:155
@ CONFIG_CHECK_GOBJECT_LOS
Definition World.h:193
@ CONFIG_INSTANCEMAP_LOAD_GRIDS
Definition World.h:181
@ CONFIG_WEATHER
Definition World.h:125
@ CONFIG_ALL_TAXI_PATHS
Definition World.h:116
@ CONFIG_GM_LOWER_SECURITY
Definition World.h:122
@ CONFIG_SKILL_MILLING
Definition World.h:124
@ CONFIG_PDUMP_NO_OVERWRITE
Definition World.h:164
@ CONFIG_GRID_UNLOAD
Definition World.h:108
@ CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP
Definition World.h:131
@ CONFIG_START_ALL_SPELLS
Definition World.h:147
@ CONFIG_SUPPORT_BUGS_ENABLED
Definition World.h:158
@ CONFIG_ALLOW_LOGGING_IP_ADDRESSES_IN_DATABASE
Definition World.h:196
@ CONFIG_SHOW_MUTE_IN_WORLD
Definition World.h:153
@ CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION
Definition World.h:114
@ CONFIG_CHAT_PARTY_RAID_WARNINGS
Definition World.h:127
@ CONFIG_ALLOW_GM_GROUP
Definition World.h:121
@ CONFIG_DECLINED_NAMES_USED
Definition World.h:136
@ CONFIG_EVENT_ANNOUNCE
Definition World.h:171
@ CONFIG_ARENA_LOG_EXTENDED_INFO
Definition World.h:144
@ CONFIG_CALCULATE_GAMEOBJECT_ZONE_AREA_DATA
Definition World.h:176
@ CONFIG_STATS_LIMITS_ENABLE
Definition World.h:172
@ CONFIG_HOTSWAP_INSTALL_ENABLED
Definition World.h:187
@ CONFIG_QUEST_IGNORE_RAID
Definition World.h:126
@ CONFIG_SHOW_BAN_IN_WORLD
Definition World.h:154
@ CONFIG_HOTSWAP_EARLY_TERMINATION_ENABLED
Definition World.h:185
@ CONFIG_HOTSWAP_ENABLED
Definition World.h:183
@ CONFIG_CLEAN_CHARACTER_DB
Definition World.h:107
@ CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY
Definition World.h:139
@ CONFIG_CHAT_FAKE_MESSAGE_PREVENTING
Definition World.h:130
@ CONFIG_ALLOW_TWO_SIDE_TRADE
Definition World.h:115
@ CONFIG_ENABLE_AE_LOOT
Definition World.h:200
@ CONFIG_TOLBARAD_ENABLE
Definition World.h:170
@ CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE
Definition World.h:132
@ CONFIG_SKILL_PROSPECTING
Definition World.h:123
@ CONFIG_IP_BASED_ACTION_LOGGING
Definition World.h:174
@ CONFIG_ADDON_CHANNEL
Definition World.h:106
@ CONFIG_START_ALL_REP
Definition World.h:149
@ CONFIG_PVP_TOKEN_ENABLE
Definition World.h:150
@ CONFIG_CHARACTER_CREATING_DISABLE_ALLIED_RACE_ACHIEVEMENT_REQUIREMENT
Definition World.h:198
@ CONFIG_ARENA_SEASON_IN_PROGRESS
Definition World.h:143
@ CONFIG_DETECT_POS_COLLISION
Definition World.h:128
@ CONFIG_DEATH_BONES_BG_OR_ARENA
Definition World.h:134
@ CONFIG_BASEMAP_LOAD_GRIDS
Definition World.h:180
@ CONFIG_HOTSWAP_PREFIX_CORRECTION_ENABLED
Definition World.h:188
@ CONFIG_BATTLEGROUND_STORE_STATISTICS_ENABLE
Definition World.h:140
@ CONFIG_INSTANCE_IGNORE_RAID
Definition World.h:119
@ CONFIG_RESET_DUEL_HEALTH_MANA
Definition World.h:179
@ CONFIG_BATTLEGROUND_CAST_DESERTER
Definition World.h:137
@ CONFIG_HOTSWAP_BUILD_FILE_RECREATION_ENABLED
Definition World.h:186
@ CONFIG_STATS_SAVE_ONLY_ON_LOGOUT
Definition World.h:109
@ CONFIG_INSTANT_TAXI
Definition World.h:117
@ CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE
Definition World.h:142
@ CONFIG_RESTRICTED_LFG_CHANNEL
Definition World.h:129
@ CONFIG_NO_RESET_TALENT_COST
Definition World.h:151
@ CONFIG_CALCULATE_CREATURE_ZONE_AREA_DATA
Definition World.h:175
@ CONFIG_HOTSWAP_RECOMPILER_ENABLED
Definition World.h:184
@ CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL
Definition World.h:111
@ CONFIG_PRESERVE_CUSTOM_CHANNELS
Definition World.h:162
@ CONFIG_ENABLE_MMAPS
Definition World.h:168
@ CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN
Definition World.h:145
@ CONFIG_CAST_UNSTUCK
Definition World.h:120
@ CONFIG_RESET_DUEL_COOLDOWNS
Definition World.h:178
@ CONFIG_DURABILITY_LOSS_IN_PVP
Definition World.h:105
@ CONFIG_EXTENDED_ACCOUNT_NAME_LENGTH_LIMIT
Definition World.h:197
@ CONFIG_INSTANCES_RESET_ANNOUNCE
Definition World.h:173
@ CONFIG_WINTERGRASP_ENABLE
Definition World.h:169
@ CONFIG_QUEST_IGNORE_AUTO_ACCEPT
Definition World.h:165
@ CONFIG_PREVENT_RENAME_CUSTOMIZATION
Definition World.h:189
@ CONFIG_DIE_COMMAND_MODE
Definition World.h:135
@ CONFIG_SUPPORT_SUGGESTIONS_ENABLED
Definition World.h:160
@ CONFIG_VMAP_INDOOR_CHECK
Definition World.h:146
@ CONFIG_CACHE_DATA_QUERIES
Definition World.h:190
@ CONFIG_PDUMP_NO_PATHS
Definition World.h:163
@ CONFIG_SUPPORT_TICKETS_ENABLED
Definition World.h:157
@ CONFIG_GAME_OBJECT_CHECK_INVALID_POSITION
Definition World.h:192
@ CONFIG_RESPAWN_DYNAMIC_ESCORTNPC
Definition World.h:194
@ CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP
Definition World.h:112
@ CONFIG_DEATH_BONES_WORLD
Definition World.h:133
@ CONFIG_SUPPORT_ENABLED
Definition World.h:156
@ CONFIG_QUEST_ENABLE_QUEST_TRACKER
Definition World.h:167
@ CONFIG_REGEN_HP_CANNOT_REACH_TARGET_IN_RAID
Definition World.h:195
@ CONFIG_BATTLEGROUNDMAP_LOAD_GRIDS
Definition World.h:199
@ CONFIG_BLACKMARKET_ENABLED
Definition World.h:182
@ CONFIG_DBC_ENFORCE_ITEM_ATTRIBUTES
Definition World.h:161
@ CONFIG_START_ALL_EXPLORED
Definition World.h:148
@ CONFIG_LOAD_LOCALES
Definition World.h:201
@ CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD
Definition World.h:113
@ CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE
Definition World.h:138
@ CONFIG_INSTANCE_IGNORE_LEVEL
Definition World.h:118
@ CONFIG_FEATURE_SYSTEM_CHARACTER_UNDELETE_ENABLED
Definition World.h:177
@ RESTART_EXIT_CODE
Definition World.h:77
@ SHUTDOWN_EXIT_CODE
Definition World.h:75
@ CONFIG_START_ALLIED_RACE_MONEY
Definition World.h:445
@ CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK
Definition World.h:440
@ CONFIG_START_PLAYER_MONEY
Definition World.h:441
@ CONFIG_START_DEATH_KNIGHT_PLAYER_MONEY
Definition World.h:442
@ CONFIG_START_EVOKER_PLAYER_MONEY
Definition World.h:444
@ CONFIG_START_DEMON_HUNTER_PLAYER_MONEY
Definition World.h:443
@ SHUTDOWN_MASK_RESTART
Definition World.h:68
@ SHUTDOWN_MASK_IDLE
Definition World.h:69
void CheckQuestDisables()
bool IsVMAPDisabledFor(uint32 entry, uint8 flags)
void LoadDisables()
void UpdateGameTimers()
Definition GameTime.cpp:111
time_t GetGameTime()
Definition GameTime.cpp:52
time_t GetStartTime()
Definition GameTime.cpp:47
uint32 GetUptime()
Uptime (in secs)
Definition GameTime.cpp:91
TC_COMMON_API char const * GetFullVersion()
TC_GAME_API Player * FindConnectedPlayerByName(std::string_view name)
void Load()
Definition QuestMgr.cpp:65
void Load()
Definition TraitMgr.cpp:91
TC_GAME_API void LoadCommandMap()
auto SelectRandomWeightedContainerElement(C const &container, std::span< double > const &weights) -> decltype(std::ranges::begin(container))
Definition Containers.h:127
auto MapEqualRange(M &map, typename M::key_type const &key)
auto MapGetValuePtr(M &map, typename M::key_type const &key)
Definition MapUtils.h:37
void MultimapErasePair(M &multimap, typename M::key_type const &key, typename M::mapped_type const &value)
Definition MapUtils.h:57
TC_COMMON_API std::vector< std::string_view > Tokenize(std::string_view str, char sep, bool keepEmpty)
Definition Util.cpp:57
std::string StringFormat(FormatString< Args... > fmt, Args &&... args) noexcept
Default TC string format function.
TC_GAME_API void SetValue(int32 worldStateId, int32 value, bool hidden, Map *map)
TC_GAME_API void SetValueAndSaveInDb(int32 worldStateId, int32 value, bool hidden, Map *map)
@ RBAC_PERM_SKIP_QUEUE
Definition RBAC.h:55
@ RBAC_PERM_RECEIVE_GLOBAL_GM_TEXTMESSAGE
Definition RBAC.h:97
Storage class for commands issued for delayed execution.
Definition World.h:539
CommandFinished m_commandFinished
Definition World.h:546
void * m_callbackArg
Definition World.h:543
CliCommandHolder(void *callbackArg, char const *command, Print zprint, CommandFinished commandFinished)
Definition World.cpp:3505
Print m_print
Definition World.h:545
void(*)(void *, std::string_view) Print
Definition World.h:540
char * m_command
Definition World.h:544
void(*)(void *, bool success) CommandFinished
Definition World.h:541
std::string_view Name
Definition World.cpp:529
void SetInterval(time_t interval)
Definition Timer.h:94
time_t GetInterval() const
Definition Timer.h:99
void Update(time_t diff)
Definition Timer.h:71
void SetCurrent(time_t current)
Definition Timer.h:89
void Reset()
Definition Timer.h:83
LocalizedString Text
struct WorldSession::ConnectToKey::@320 Fields