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 Trinity Core 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 = "CharacterCreating.DisableAlliedRaceAchievementRequirement"sv, .DefaultValue = false, .Index = CONFIG_CHARACTER_CREATING_DISABLE_ALLIED_RACE_ACHIEVEMENT_REQUIREMENT },
621 { .Name = "AllFlightPaths"sv, .DefaultValue = false, .Index = CONFIG_ALL_TAXI_PATHS },
622 { .Name = "InstantFlightPaths"sv, .DefaultValue = false, .Index = CONFIG_INSTANT_TAXI },
623 { .Name = "Instance.IgnoreLevel"sv, .DefaultValue = false, .Index = CONFIG_INSTANCE_IGNORE_LEVEL },
624 { .Name = "Instance.IgnoreRaid"sv, .DefaultValue = false, .Index = CONFIG_INSTANCE_IGNORE_RAID },
625 { .Name = "CastUnstuck"sv, .DefaultValue = true, .Index = CONFIG_CAST_UNSTUCK },
626 { .Name = "GM.AllowInvite"sv, .DefaultValue = false, .Index = CONFIG_ALLOW_GM_GROUP },
627 { .Name = "GM.LowerSecurity"sv, .DefaultValue = false, .Index = CONFIG_GM_LOWER_SECURITY },
628 { .Name = "SkillChance.Prospecting"sv, .DefaultValue = false, .Index = CONFIG_SKILL_PROSPECTING },
629 { .Name = "SkillChance.Milling"sv, .DefaultValue = false, .Index = CONFIG_SKILL_MILLING },
630 { .Name = "ActivateWeather"sv, .DefaultValue = true, .Index = CONFIG_WEATHER },
631 { .Name = "Event.Announce"sv, .DefaultValue = false, .Index = CONFIG_EVENT_ANNOUNCE },
632 { .Name = "Quests.EnableQuestTracker"sv, .DefaultValue = false, .Index = CONFIG_QUEST_ENABLE_QUEST_TRACKER },
633 { .Name = "Quests.IgnoreRaid"sv, .DefaultValue = false, .Index = CONFIG_QUEST_IGNORE_RAID },
634 { .Name = "Quests.IgnoreAutoAccept"sv, .DefaultValue = false, .Index = CONFIG_QUEST_IGNORE_AUTO_ACCEPT },
635 { .Name = "Quests.IgnoreAutoComplete"sv, .DefaultValue = false, .Index = CONFIG_QUEST_IGNORE_AUTO_COMPLETE },
636 { .Name = "DetectPosCollision"sv, .DefaultValue = true, .Index = CONFIG_DETECT_POS_COLLISION },
637 { .Name = "Channel.RestrictedLfg"sv, .DefaultValue = true, .Index = CONFIG_RESTRICTED_LFG_CHANNEL },
638 { .Name = "ChatFakeMessagePreventing"sv, .DefaultValue = false, .Index = CONFIG_CHAT_FAKE_MESSAGE_PREVENTING },
639 { .Name = "Death.CorpseReclaimDelay.PvP"sv, .DefaultValue = true, .Index = CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP },
640 { .Name = "Death.CorpseReclaimDelay.PvE"sv, .DefaultValue = true, .Index = CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE },
641 { .Name = "Death.Bones.World"sv, .DefaultValue = true, .Index = CONFIG_DEATH_BONES_WORLD },
642 { .Name = "Death.Bones.BattlegroundOrArena"sv, .DefaultValue = true, .Index = CONFIG_DEATH_BONES_BG_OR_ARENA },
643 { .Name = "Die.Command.Mode"sv, .DefaultValue = true, .Index = CONFIG_DIE_COMMAND_MODE },
644 { .Name = "DeclinedNames"sv, .DefaultValue = false, .Index = CONFIG_DECLINED_NAMES_USED },
645 { .Name = "Battleground.CastDeserter"sv, .DefaultValue = true, .Index = CONFIG_BATTLEGROUND_CAST_DESERTER },
646 { .Name = "Battleground.QueueAnnouncer.Enable"sv, .DefaultValue = false, .Index = CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE },
647 { .Name = "Battleground.QueueAnnouncer.PlayerOnly"sv, .DefaultValue = false, .Index = CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY },
648 { .Name = "Battleground.StoreStatistics.Enable"sv, .DefaultValue = false, .Index = CONFIG_BATTLEGROUND_STORE_STATISTICS_ENABLE },
649 { .Name = "Battleground.GiveXPForKills"sv, .DefaultValue = false, .Index = CONFIG_BG_XP_FOR_KILL },
650 { .Name = "Arena.QueueAnnouncer.Enable"sv, .DefaultValue = false, .Index = CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE },
651 { .Name = "Arena.ArenaSeason.InProgress"sv, .DefaultValue = false, .Index = CONFIG_ARENA_SEASON_IN_PROGRESS },
652 { .Name = "ArenaLog.ExtendedInfo"sv, .DefaultValue = false, .Index = CONFIG_ARENA_LOG_EXTENDED_INFO },
653 { .Name = "OffhandCheckAtSpellUnlearn"sv, .DefaultValue = true, .Index = CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN },
654 { .Name = "Respawn.DynamicEscortNPC"sv, .DefaultValue = false, .Index = CONFIG_RESPAWN_DYNAMIC_ESCORTNPC },
655 { .Name = "mmap.enablePathFinding"sv, .DefaultValue = true, .Index = CONFIG_ENABLE_MMAPS },
656 { .Name = "vmap.enableIndoorCheck"sv, .DefaultValue = true, .Index = CONFIG_VMAP_INDOOR_CHECK },
657 { .Name = "PlayerStart.AllSpells"sv, .DefaultValue = false, .Index = CONFIG_START_ALL_SPELLS },
658 { .Name = "ResetDuelCooldowns"sv, .DefaultValue = false, .Index = CONFIG_RESET_DUEL_COOLDOWNS },
659 { .Name = "ResetDuelHealthMana"sv, .DefaultValue = false, .Index = CONFIG_RESET_DUEL_HEALTH_MANA },
660 { .Name = "PlayerStart.MapsExplored"sv, .DefaultValue = false, .Index = CONFIG_START_ALL_EXPLORED },
661 { .Name = "PlayerStart.AllReputation"sv, .DefaultValue = false, .Index = CONFIG_START_ALL_REP },
662 { .Name = "PvPToken.Enable"sv, .DefaultValue = false, .Index = CONFIG_PVP_TOKEN_ENABLE },
663 { .Name = "NoResetTalentsCost"sv, .DefaultValue = false, .Index = CONFIG_NO_RESET_TALENT_COST },
664 { .Name = "ShowKickInWorld"sv, .DefaultValue = false, .Index = CONFIG_SHOW_KICK_IN_WORLD },
665 { .Name = "ShowMuteInWorld"sv, .DefaultValue = false, .Index = CONFIG_SHOW_MUTE_IN_WORLD },
666 { .Name = "ShowBanInWorld"sv, .DefaultValue = false, .Index = CONFIG_SHOW_BAN_IN_WORLD },
667 { .Name = "FeatureSystem.CharacterUndelete.Enabled"sv, .DefaultValue = false, .Index = CONFIG_FEATURE_SYSTEM_CHARACTER_UNDELETE_ENABLED },
668 { .Name = "DBC.EnforceItemAttributes"sv, .DefaultValue = true, .Index = CONFIG_DBC_ENFORCE_ITEM_ATTRIBUTES },
669 { .Name = "InstancesResetAnnounce"sv, .DefaultValue = false, .Index = CONFIG_INSTANCES_RESET_ANNOUNCE },
670 { .Name = "AutoBroadcast.On"sv, .DefaultValue = false, .Index = CONFIG_AUTOBROADCAST },
671 { .Name = "PlayerDump.DisallowPaths"sv, .DefaultValue = true, .Index = CONFIG_PDUMP_NO_PATHS },
672 { .Name = "PlayerDump.DisallowOverwrite"sv, .DefaultValue = true, .Index = CONFIG_PDUMP_NO_OVERWRITE },
673 { .Name = "Wintergrasp.Enable"sv, .DefaultValue = false, .Index = CONFIG_WINTERGRASP_ENABLE },
674 { .Name = "TolBarad.Enable"sv, .DefaultValue = true, .Index = CONFIG_TOLBARAD_ENABLE },
675 { .Name = "Stats.Limits.Enable"sv, .DefaultValue = false, .Index = CONFIG_STATS_LIMITS_ENABLE },
676 { .Name = "Allow.IP.Based.Action.Logging"sv, .DefaultValue = false, .Index = CONFIG_IP_BASED_ACTION_LOGGING },
677 { .Name = "Calculate.Creature.Zone.Area.Data"sv, .DefaultValue = false, .Index = CONFIG_CALCULATE_CREATURE_ZONE_AREA_DATA },
678 { .Name = "Calculate.Gameoject.Zone.Area.Data"sv, .DefaultValue = false, .Index = CONFIG_CALCULATE_GAMEOBJECT_ZONE_AREA_DATA },
679 { .Name = "BlackMarket.Enabled"sv, .DefaultValue = true, .Index = CONFIG_BLACKMARKET_ENABLED },
680 { .Name = "HotSwap.Enabled"sv, .DefaultValue = true, .Index = CONFIG_HOTSWAP_ENABLED },
681 { .Name = "HotSwap.EnableReCompiler"sv, .DefaultValue = true, .Index = CONFIG_HOTSWAP_RECOMPILER_ENABLED },
682 { .Name = "HotSwap.EnableEarlyTermination"sv, .DefaultValue = true, .Index = CONFIG_HOTSWAP_EARLY_TERMINATION_ENABLED },
683 { .Name = "HotSwap.EnableBuildFileRecreation"sv, .DefaultValue = true, .Index = CONFIG_HOTSWAP_BUILD_FILE_RECREATION_ENABLED },
684 { .Name = "HotSwap.EnableInstall"sv, .DefaultValue = true, .Index = CONFIG_HOTSWAP_INSTALL_ENABLED },
685 { .Name = "HotSwap.EnablePrefixCorrection"sv, .DefaultValue = true, .Index = CONFIG_HOTSWAP_PREFIX_CORRECTION_ENABLED },
686 { .Name = "PreventRenameCharacterOnCustomization"sv, .DefaultValue = false, .Index = CONFIG_PREVENT_RENAME_CUSTOMIZATION },
687 { .Name = "PartyRaidWarnings"sv, .DefaultValue = false, .Index = CONFIG_CHAT_PARTY_RAID_WARNINGS },
688 { .Name = "CacheDataQueries"sv, .DefaultValue = true, .Index = CONFIG_CACHE_DATA_QUERIES },
689 { .Name = "Creature.CheckInvalidPosition"sv, .DefaultValue = false, .Index = CONFIG_CREATURE_CHECK_INVALID_POSITION },
690 { .Name = "GameObject.CheckInvalidPosition"sv, .DefaultValue = false, .Index = CONFIG_GAME_OBJECT_CHECK_INVALID_POSITION },
691 { .Name = "CheckGameObjectLoS"sv, .DefaultValue = true, .Index = CONFIG_CHECK_GOBJECT_LOS },
692 { .Name = "AllowLoggingIPAddressesInDatabase"sv, .DefaultValue = true, .Index = CONFIG_ALLOW_LOGGING_IP_ADDRESSES_IN_DATABASE },
693 { .Name = "Loot.EnableAELoot"sv, .DefaultValue = true, .Index = CONFIG_ENABLE_AE_LOOT },
694 { .Name = "Load.Locales"sv, .DefaultValue = true, .Index = CONFIG_LOAD_LOCALES },
695 } };
696
698 { {
699 { .Name = "Server.LoginInfo"sv, .DefaultValue = 0, .Index = CONFIG_ENABLE_SINFO_LOGIN },
700 { .Name = "XP.Boost.Daymask"sv, .DefaultValue = 0, .Index = CONFIG_XP_BOOST_DAYMASK },
701 { .Name = "Compression"sv, .DefaultValue = 1, .Index = CONFIG_COMPRESSION, .Min = Z_BEST_SPEED, .Max = Z_BEST_COMPRESSION },
702 { .Name = "PersistentCharacterCleanFlags"sv, .DefaultValue = 0, .Index = CONFIG_PERSISTENT_CHARACTER_CLEAN_FLAGS },
703 { .Name = "Auction.ReplicateItemsCooldown"sv, .DefaultValue = 900, .Index = CONFIG_AUCTION_REPLICATE_DELAY },
704 { .Name = "Auction.SearchDelay"sv, .DefaultValue = 300, .Index = CONFIG_AUCTION_SEARCH_DELAY, .Min = 100, .Max = 10000 },
705 { .Name = "Auction.TaintedSearchDelay"sv, .DefaultValue = 3000, .Index = CONFIG_AUCTION_TAINTED_SEARCH_DELAY, .Min = 100, .Max = 10000 },
706 { .Name = "ChatLevelReq.Channel"sv, .DefaultValue = 1, .Index = CONFIG_CHAT_CHANNEL_LEVEL_REQ },
707 { .Name = "ChatLevelReq.Whisper"sv, .DefaultValue = 1, .Index = CONFIG_CHAT_WHISPER_LEVEL_REQ },
708 { .Name = "ChatLevelReq.Emote"sv, .DefaultValue = 1, .Index = CONFIG_CHAT_EMOTE_LEVEL_REQ },
709 { .Name = "ChatLevelReq.Say"sv, .DefaultValue = 1, .Index = CONFIG_CHAT_SAY_LEVEL_REQ },
710 { .Name = "ChatLevelReq.Yell"sv, .DefaultValue = 1, .Index = CONFIG_CHAT_YELL_LEVEL_REQ },
711 { .Name = "PartyLevelReq"sv, .DefaultValue = 1, .Index = CONFIG_PARTY_LEVEL_REQ },
712 { .Name = "LevelReq.Trade"sv, .DefaultValue = 1, .Index = CONFIG_TRADE_LEVEL_REQ },
713 { .Name = "LevelReq.Auction"sv, .DefaultValue = 1, .Index = CONFIG_AUCTION_LEVEL_REQ },
714 { .Name = "LevelReq.Mail"sv, .DefaultValue = 1, .Index = CONFIG_MAIL_LEVEL_REQ },
715 { .Name = "PreserveCustomChannelDuration"sv, .DefaultValue = 14, .Index = CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION },
716 { .Name = "PreserveCustomChannelInterval"sv, .DefaultValue = 5, .Index = CONFIG_PRESERVE_CUSTOM_CHANNEL_INTERVAL },
717 { .Name = "PlayerSaveInterval"sv, .DefaultValue = 15 * MINUTE * IN_MILLISECONDS, .Index = CONFIG_INTERVAL_SAVE },
718 { .Name = "DisconnectToleranceInterval"sv, .DefaultValue = 0, .Index = CONFIG_INTERVAL_DISCONNECT_TOLERANCE },
719 { .Name = "PlayerSave.Stats.MinLevel"sv, .DefaultValue = 0, .Index = CONFIG_MIN_LEVEL_STAT_SAVE, .Max = STRONG_MAX_LEVEL },
720 { .Name = "GridCleanUpDelay"sv, .DefaultValue = 5 * MINUTE * IN_MILLISECONDS, .Index = CONFIG_INTERVAL_GRIDCLEAN, .Min = MIN_GRID_DELAY },
721 { .Name = "MapUpdateInterval"sv, .DefaultValue = 10, .Index = CONFIG_INTERVAL_MAPUPDATE, .Min = MIN_MAP_UPDATE_DELAY },
722 { .Name = "ChangeWeatherInterval"sv, .DefaultValue = 10 * MINUTE * IN_MILLISECONDS, .Index = CONFIG_INTERVAL_CHANGEWEATHER },
723 { .Name = "WorldServerPort"sv, .DefaultValue = 8085, .Index = CONFIG_PORT_WORLD, .Min = 1, .Max = std::numeric_limits<uint16>::max(), .Reloadable = false },
724 { .Name = "SocketTimeOutTime"sv, .DefaultValue = 900000, .Index = CONFIG_SOCKET_TIMEOUTTIME },
725 { .Name = "SocketTimeOutTimeActive"sv, .DefaultValue = 60000, .Index = CONFIG_SOCKET_TIMEOUTTIME_ACTIVE },
726 { .Name = "SessionAddDelay"sv, .DefaultValue = 10000, .Index = CONFIG_SESSION_ADD_DELAY },
727 { .Name = "MinQuestScaledXPRatio"sv, .DefaultValue = 0, .Index = CONFIG_MIN_QUEST_SCALED_XP_RATIO, .Max = 100 },
728 { .Name = "MinCreatureScaledXPRatio"sv, .DefaultValue = 0, .Index = CONFIG_MIN_CREATURE_SCALED_XP_RATIO, .Max = 100 },
729 { .Name = "MinDiscoveredScaledXPRatio"sv, .DefaultValue = 0, .Index = CONFIG_MIN_DISCOVERED_SCALED_XP_RATIO, .Max = 100 },
730 { .Name = "GameType"sv, .DefaultValue = 0, .Index = CONFIG_GAME_TYPE, .Reloadable = false },
731 { .Name = "RealmZone"sv, .DefaultValue = HARDCODED_DEVELOPMENT_REALM_CATEGORY_ID, .Index = CONFIG_REALM_ZONE, .Reloadable = false },
732 { .Name = "StrictPlayerNames"sv, .DefaultValue = 0, .Index = CONFIG_STRICT_PLAYER_NAMES },
733 { .Name = "StrictCharterNames"sv, .DefaultValue = 0, .Index = CONFIG_STRICT_CHARTER_NAMES },
734 { .Name = "StrictPetNames"sv, .DefaultValue = 0, .Index = CONFIG_STRICT_PET_NAMES },
735 { .Name = "MinPlayerName"sv, .DefaultValue = 2, .Index = CONFIG_MIN_PLAYER_NAME, .Min = 1, .Max = MAX_PLAYER_NAME },
736 { .Name = "MinCharterName"sv, .DefaultValue = 2, .Index = CONFIG_MIN_CHARTER_NAME, .Min = 1, .Max = MAX_CHARTER_NAME },
737 { .Name = "MinPetName"sv, .DefaultValue = 2, .Index = CONFIG_MIN_PET_NAME, .Min = 1, .Max = MAX_PET_NAME },
738 { .Name = "Guild.CharterCost"sv, .DefaultValue = 1000, .Index = CONFIG_CHARTER_COST_GUILD },
739 { .Name = "ArenaTeam.CharterCost.2v2"sv, .DefaultValue = 800000, .Index = CONFIG_CHARTER_COST_ARENA_2v2 },
740 { .Name = "ArenaTeam.CharterCost.3v3"sv, .DefaultValue = 1200000, .Index = CONFIG_CHARTER_COST_ARENA_3v3 },
741 { .Name = "ArenaTeam.CharterCost.5v5"sv, .DefaultValue = 2000000, .Index = CONFIG_CHARTER_COST_ARENA_5v5 },
742 { .Name = "CharacterCreating.Disabled"sv, .DefaultValue = 0, .Index = CONFIG_CHARACTER_CREATING_DISABLED },
743 { .Name = "CharacterCreating.Disabled.ClassMask"sv, .DefaultValue = 0, .Index = CONFIG_CHARACTER_CREATING_DISABLED_CLASSMASK },
744 { .Name = "CharactersPerRealm"sv, .DefaultValue = 60, .Index = CONFIG_CHARACTERS_PER_REALM, .Min = 1, .Max = MAX_CHARACTERS_PER_REALM },
745 { .Name = "CharactersPerAccount"sv, .DefaultValue = 60, .Index = CONFIG_CHARACTERS_PER_ACCOUNT, .Min = 1, .Max = MAX_CHARACTERS_PER_REALM },
746 { .Name = "CharacterCreating.EvokersPerRealm"sv, .DefaultValue = 1, .Index = CONFIG_CHARACTER_CREATING_EVOKERS_PER_REALM, .Min = 1, .Max = MAX_CHARACTERS_PER_REALM },
747 { .Name = "CharacterCreating.MinLevelForDemonHunter"sv, .DefaultValue = 0, .Index = CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_DEMON_HUNTER },
748 { .Name = "CharacterCreating.MinLevelForEvoker"sv, .DefaultValue = 50, .Index = CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_EVOKER },
749 { .Name = "SkipCinematics"sv, .DefaultValue = 0, .Index = CONFIG_SKIP_CINEMATICS, .Min = 0, .Max = 2 },
750 { .Name = "MaxPlayerLevel"sv, .DefaultValue = GetMaxLevelForExpansion(CURRENT_EXPANSION), .Index = CONFIG_MAX_PLAYER_LEVEL, .Min = 1, .Max = MAX_LEVEL, .Reloadable = false },
751 { .Name = "MinDualSpecLevel"sv, .DefaultValue = 40, .Index = CONFIG_MIN_DUALSPEC_LEVEL },
752 { .Name = "StartPlayerLevel"sv, .DefaultValue = 1, .Index = CONFIG_START_PLAYER_LEVEL, .Min = 1 },
753 { .Name = "StartDeathKnightPlayerLevel"sv, .DefaultValue = 8, .Index = CONFIG_START_DEATH_KNIGHT_PLAYER_LEVEL, .Min = 1 },
754 { .Name = "StartDemonHunterPlayerLevel"sv, .DefaultValue = 8, .Index = CONFIG_START_DEMON_HUNTER_PLAYER_LEVEL, .Min = 1 },
755 { .Name = "StartEvokerPlayerLevel"sv, .DefaultValue = 10, .Index = CONFIG_START_EVOKER_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 = 1000, .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 = "HonorPointsAfterDuel"sv, .DefaultValue = 0, .Index = CONFIG_HONOR_AFTER_DUEL },
857 { .Name = "PvPToken.MapAllowType"sv, .DefaultValue = 4, .Index = CONFIG_PVP_TOKEN_MAP_TYPE, .Min = 1, .Max = 4 },
858 { .Name = "PvPToken.ItemID"sv, .DefaultValue = 29434, .Index = CONFIG_PVP_TOKEN_ID },
859 { .Name = "PvPToken.ItemCount"sv, .DefaultValue = 1, .Index = CONFIG_PVP_TOKEN_COUNT, .Min = 1 },
860 { .Name = "MapUpdate.Threads"sv, .DefaultValue = 1, .Index = CONFIG_NUMTHREADS, .Min = 1 },
861 { .Name = "Command.LookupMaxResults"sv, .DefaultValue = 0, .Index = CONFIG_MAX_RESULTS_LOOKUP_COMMANDS },
862 { .Name = "FeatureSystem.CharacterUndelete.Cooldown"sv, .DefaultValue = 2592000, .Index = CONFIG_FEATURE_SYSTEM_CHARACTER_UNDELETE_COOLDOWN },
863 { .Name = "DungeonFinder.OptionsMask"sv, .DefaultValue = 1, .Index = CONFIG_LFG_OPTIONSMASK },
864 { .Name = "Account.PasswordChangeSecurity"sv, .DefaultValue = 0, .Index = CONFIG_ACC_PASSCHANGESEC },
865 { .Name = "Battleground.RewardWinnerHonorFirst"sv, .DefaultValue = 27000, .Index = CONFIG_BG_REWARD_WINNER_HONOR_FIRST },
866 { .Name = "Battleground.RewardWinnerConquestFirst"sv, .DefaultValue = 10000, .Index = CONFIG_BG_REWARD_WINNER_CONQUEST_FIRST },
867 { .Name = "Battleground.RewardWinnerHonorLast"sv, .DefaultValue = 13500, .Index = CONFIG_BG_REWARD_WINNER_HONOR_LAST },
868 { .Name = "Battleground.RewardWinnerConquestLast"sv, .DefaultValue = 5000, .Index = CONFIG_BG_REWARD_WINNER_CONQUEST_LAST },
869 { .Name = "Battleground.RewardLoserHonorFirst"sv, .DefaultValue = 4500, .Index = CONFIG_BG_REWARD_LOSER_HONOR_FIRST },
870 { .Name = "Battleground.RewardLoserHonorLast"sv, .DefaultValue = 3500, .Index = CONFIG_BG_REWARD_LOSER_HONOR_LAST },
871 { .Name = "AccountInstancesPerHour"sv, .DefaultValue = 10, .Index = CONFIG_MAX_INSTANCES_PER_HOUR },
872 { .Name = "AutoBroadcast.Center"sv, .DefaultValue = 0, .Index = CONFIG_AUTOBROADCAST_CENTER },
873 { .Name = "AutoBroadcast.Timer"sv, .DefaultValue = 60000, .Index = CONFIG_AUTOBROADCAST_INTERVAL },
874 { .Name = "MaxPingTime"sv, .DefaultValue = 30, .Index = CONFIG_DB_PING_INTERVAL },
875 { .Name = "Guild.SaveInterval"sv, .DefaultValue = 15, .Index = CONFIG_GUILD_SAVE_INTERVAL },
876 { .Name = "Wintergrasp.PlayerMax"sv, .DefaultValue = 100, .Index = CONFIG_WINTERGRASP_PLR_MAX },
877 { .Name = "Wintergrasp.PlayerMin"sv, .DefaultValue = 0, .Index = CONFIG_WINTERGRASP_PLR_MIN },
878 { .Name = "Wintergrasp.PlayerMinLvl"sv, .DefaultValue = 77, .Index = CONFIG_WINTERGRASP_PLR_MIN_LVL },
879 { .Name = "Wintergrasp.BattleTimer"sv, .DefaultValue = 30, .Index = CONFIG_WINTERGRASP_BATTLETIME },
880 { .Name = "Wintergrasp.NoBattleTimer"sv, .DefaultValue = 150, .Index = CONFIG_WINTERGRASP_NOBATTLETIME },
881 { .Name = "Wintergrasp.CrashRestartTimer"sv, .DefaultValue = 10, .Index = CONFIG_WINTERGRASP_RESTART_AFTER_CRASH },
882 { .Name = "TolBarad.PlayerMax"sv, .DefaultValue = 100, .Index = CONFIG_TOLBARAD_PLR_MAX },
883 { .Name = "TolBarad.PlayerMin"sv, .DefaultValue = 0, .Index = CONFIG_TOLBARAD_PLR_MIN },
884 { .Name = "TolBarad.PlayerMinLvl"sv, .DefaultValue = 85, .Index = CONFIG_TOLBARAD_PLR_MIN_LVL },
885 { .Name = "TolBarad.BattleTimer"sv, .DefaultValue = 15, .Index = CONFIG_TOLBARAD_BATTLETIME },
886 { .Name = "TolBarad.BonusTime"sv, .DefaultValue = 5, .Index = CONFIG_TOLBARAD_BONUSTIME },
887 { .Name = "TolBarad.NoBattleTimer"sv, .DefaultValue = 150, .Index = CONFIG_TOLBARAD_NOBATTLETIME },
888 { .Name = "TolBarad.CrashRestartTimer"sv, .DefaultValue = 10, .Index = CONFIG_TOLBARAD_RESTART_AFTER_CRASH },
889 { .Name = "PacketSpoof.Policy"sv, .DefaultValue = WorldSession::DosProtection::POLICY_KICK, .Index = CONFIG_PACKET_SPOOF_POLICY },
890 { .Name = "PacketSpoof.BanMode"sv, .DefaultValue = BAN_ACCOUNT, .Index = CONFIG_PACKET_SPOOF_BANMODE, .Min = BAN_ACCOUNT, .Max = BAN_IP },
891 { .Name = "PacketSpoof.BanDuration"sv, .DefaultValue = 86400, .Index = CONFIG_PACKET_SPOOF_BANDURATION },
892 { .Name = "AuctionHouseBot.Update.Interval"sv, .DefaultValue = 20, .Index = CONFIG_AHBOT_UPDATE_INTERVAL },
893 { .Name = "BlackMarket.MaxAuctions"sv, .DefaultValue = 12, .Index = CONFIG_BLACKMARKET_MAXAUCTIONS },
894 { .Name = "BlackMarket.UpdatePeriod"sv, .DefaultValue = 24, .Index = CONFIG_BLACKMARKET_UPDATE_PERIOD },
895 { .Name = "Pvp.FactionBalance.LevelCheckDiff"sv, .DefaultValue = 0, .Index = CONFIG_FACTION_BALANCE_LEVEL_CHECK_DIFF },
896 } };
897
899 { {
900 { .Name = "CharacterCreating.Disabled.RaceMask"sv, .DefaultValue = 0, .Index = CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK },
901 { .Name = "StartPlayerMoney"sv, .DefaultValue = 0, .Index = CONFIG_START_PLAYER_MONEY, .Min = 0, .Max = MAX_MONEY_AMOUNT },
902 } };
903
905 { {
906 { .Name = "MaxGroupXPDistance"sv, .DefaultValue = 74.0f, .Index = CONFIG_GROUP_XP_DISTANCE },
907 { .Name = "MaxRecruitAFriendBonusDistance"sv, .DefaultValue = 100.0f, .Index = CONFIG_MAX_RECRUIT_A_FRIEND_DISTANCE },
908 { .Name = "MonsterSight"sv, .DefaultValue = 50.0f, .Index = CONFIG_SIGHT_MONSTER },
909 { .Name = "CreatureFamilyFleeAssistanceRadius"sv, .DefaultValue = 30.0f, .Index = CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS },
910 { .Name = "CreatureFamilyAssistanceRadius"sv, .DefaultValue = 10.0f, .Index = CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS },
911 { .Name = "ThreatRadius"sv, .DefaultValue = 60.0f, .Index = CONFIG_THREAT_RADIUS },
912 { .Name = "ListenRange.Say"sv, .DefaultValue = 25.0f, .Index = CONFIG_LISTEN_RANGE_SAY },
913 { .Name = "ListenRange.TextEmote"sv, .DefaultValue = 25.0f, .Index = CONFIG_LISTEN_RANGE_TEXTEMOTE },
914 { .Name = "ListenRange.Yell"sv, .DefaultValue = 300.0f, .Index = CONFIG_LISTEN_RANGE_YELL },
915 { .Name = "Arena.ArenaWinRatingModifier1"sv, .DefaultValue = 48.0f, .Index = CONFIG_ARENA_WIN_RATING_MODIFIER_1 },
916 { .Name = "Arena.ArenaWinRatingModifier2"sv, .DefaultValue = 24.0f, .Index = CONFIG_ARENA_WIN_RATING_MODIFIER_2 },
917 { .Name = "Arena.ArenaLoseRatingModifier"sv, .DefaultValue = 24.0f, .Index = CONFIG_ARENA_LOSE_RATING_MODIFIER },
918 { .Name = "Arena.ArenaMatchmakerRatingModifier"sv, .DefaultValue = 24.0f, .Index = CONFIG_ARENA_MATCHMAKER_RATING_MODIFIER },
919 { .Name = "Visibility.Distance.Continents"sv, .DefaultValue = DEFAULT_VISIBILITY_DISTANCE, .Index = CONFIG_MAX_VISIBILITY_DISTANCE_CONTINENT, .Min = 0.0f, .Max = MAX_VISIBILITY_DISTANCE },
920 { .Name = "Visibility.Distance.Instances"sv, .DefaultValue = DEFAULT_VISIBILITY_INSTANCE, .Index = CONFIG_MAX_VISIBILITY_DISTANCE_INSTANCE, .Min = 0.0f, .Max = MAX_VISIBILITY_DISTANCE },
921 { .Name = "Visibility.Distance.BG"sv, .DefaultValue = DEFAULT_VISIBILITY_BGARENAS, .Index = CONFIG_MAX_VISIBILITY_DISTANCE_BATTLEGROUND, .Min = 0.0f, .Max = MAX_VISIBILITY_DISTANCE },
922 { .Name = "Visibility.Distance.Arenas"sv, .DefaultValue = DEFAULT_VISIBILITY_BGARENAS, .Index = CONFIG_MAX_VISIBILITY_DISTANCE_ARENA, .Min = 0.0f, .Max = MAX_VISIBILITY_DISTANCE },
923 { .Name = "Respawn.DynamicRateCreature"sv, .DefaultValue = 10.0f, .Index = CONFIG_RESPAWN_DYNAMICRATE_CREATURE, .Min = 0.0f },
924 { .Name = "Respawn.DynamicRateGameObject"sv, .DefaultValue = 10.0f, .Index = CONFIG_RESPAWN_DYNAMICRATE_GAMEOBJECT, .Min = 0.0f },
925 { .Name = "Stats.Limits.Dodge"sv, .DefaultValue = 95.0f, .Index = CONFIG_STATS_LIMITS_DODGE },
926 { .Name = "Stats.Limits.Parry"sv, .DefaultValue = 95.0f, .Index = CONFIG_STATS_LIMITS_PARRY },
927 { .Name = "Stats.Limits.Block"sv, .DefaultValue = 95.0f, .Index = CONFIG_STATS_LIMITS_BLOCK },
928 { .Name = "Stats.Limits.Crit"sv, .DefaultValue = 95.0f, .Index = CONFIG_STATS_LIMITS_CRIT },
929 { .Name = "Pvp.FactionBalance.Pct5"sv, .DefaultValue = 0.6f, .Index = CONFIG_CALL_TO_ARMS_5_PCT },
930 { .Name = "Pvp.FactionBalance.Pct10"sv, .DefaultValue = 0.7f, .Index = CONFIG_CALL_TO_ARMS_10_PCT },
931 { .Name = "Pvp.FactionBalance.Pct20"sv, .DefaultValue = 0.8f, .Index = CONFIG_CALL_TO_ARMS_20_PCT },
932 } };
933
935 { {
936 { .Name = "Rate.Health"sv, .DefaultValue = 1.0f, .Index = RATE_HEALTH, .Min = 0.01f },
937 { .Name = "Rate.Mana"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_MANA, .Min = 0.01f },
938 { .Name = "Rate.Rage.Gain"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_RAGE_INCOME, .Min = 0.01f },
939 { .Name = "Rate.Rage.Loss"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_RAGE_LOSS, .Min = 0.01f },
940 { .Name = "Rate.Focus"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_FOCUS, .Min = 0.01f },
941 { .Name = "Rate.Energy"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_ENERGY, .Min = 0.01f },
942 { .Name = "Rate.ComboPoints.Loss"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_COMBO_POINTS_LOSS, .Min = 0.01f },
943 { .Name = "Rate.RunicPower.Gain"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_RUNIC_POWER_INCOME, .Min = 0.01f },
944 { .Name = "Rate.RunicPower.Loss"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_RUNIC_POWER_LOSS, .Min = 0.01f },
945 { .Name = "Rate.SoulShards.Loss"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_SOUL_SHARDS, .Min = 0.01f },
946 { .Name = "Rate.LunarPower.Loss"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_LUNAR_POWER, .Min = 0.01f },
947 { .Name = "Rate.HolyPower.Loss"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_HOLY_POWER, .Min = 0.01f },
948 { .Name = "Rate.Maelstrom.Loss"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_MAELSTROM, .Min = 0.01f },
949 { .Name = "Rate.Chi.Loss"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_CHI, .Min = 0.01f },
950 { .Name = "Rate.Insanity.Loss"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_INSANITY, .Min = 0.01f },
951 { .Name = "Rate.ArcaneCharges.Loss"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_ARCANE_CHARGES, .Min = 0.01f },
952 { .Name = "Rate.Fury.Loss"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_FURY, .Min = 0.01f },
953 { .Name = "Rate.Pain.Loss"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_PAIN, .Min = 0.01f },
954 { .Name = "Rate.Essence.Loss"sv, .DefaultValue = 1.0f, .Index = RATE_POWER_ESSENCE, .Min = 0.01f },
955 { .Name = "Rate.Skill.Discovery"sv, .DefaultValue = 1.0f, .Index = RATE_SKILL_DISCOVERY },
956 { .Name = "Rate.Drop.Item.Poor"sv, .DefaultValue = 1.0f, .Index = RATE_DROP_ITEM_POOR },
957 { .Name = "Rate.Drop.Item.Normal"sv, .DefaultValue = 1.0f, .Index = RATE_DROP_ITEM_NORMAL },
958 { .Name = "Rate.Drop.Item.Uncommon"sv, .DefaultValue = 1.0f, .Index = RATE_DROP_ITEM_UNCOMMON },
959 { .Name = "Rate.Drop.Item.Rare"sv, .DefaultValue = 1.0f, .Index = RATE_DROP_ITEM_RARE },
960 { .Name = "Rate.Drop.Item.Epic"sv, .DefaultValue = 1.0f, .Index = RATE_DROP_ITEM_EPIC },
961 { .Name = "Rate.Drop.Item.Legendary"sv, .DefaultValue = 1.0f, .Index = RATE_DROP_ITEM_LEGENDARY },
962 { .Name = "Rate.Drop.Item.Artifact"sv, .DefaultValue = 1.0f, .Index = RATE_DROP_ITEM_ARTIFACT },
963 { .Name = "Rate.Drop.Item.Referenced"sv, .DefaultValue = 1.0f, .Index = RATE_DROP_ITEM_REFERENCED },
964 { .Name = "Rate.Drop.Item.ReferencedAmount"sv, .DefaultValue = 1.0f, .Index = RATE_DROP_ITEM_REFERENCED_AMOUNT },
965 { .Name = "Rate.Drop.Money"sv, .DefaultValue = 1.0f, .Index = RATE_DROP_MONEY },
966 { .Name = "Rate.XP.Kill"sv, .DefaultValue = 1.0f, .Index = RATE_XP_KILL },
967 { .Name = "Rate.XP.BattlegroundKill"sv, .DefaultValue = 1.0f, .Index = RATE_XP_BG_KILL },
968 { .Name = "Rate.XP.Quest"sv, .DefaultValue = 1.0f, .Index = RATE_XP_QUEST },
969 { .Name = "Rate.XP.Explore"sv, .DefaultValue = 1.0f, .Index = RATE_XP_EXPLORE },
970 { .Name = "XP.Boost.Rate"sv, .DefaultValue = 2.0f, .Index = RATE_XP_BOOST },
971 { .Name = "Rate.RepairCost"sv, .DefaultValue = 1.0f, .Index = RATE_REPAIRCOST, .Min = 0.0f },
972 { .Name = "Rate.Reputation.Gain"sv, .DefaultValue = 1.0f, .Index = RATE_REPUTATION_GAIN },
973 { .Name = "Rate.Reputation.LowLevel.Kill"sv, .DefaultValue = 1.0f, .Index = RATE_REPUTATION_LOWLEVEL_KILL },
974 { .Name = "Rate.Reputation.LowLevel.Quest"sv, .DefaultValue = 1.0f, .Index = RATE_REPUTATION_LOWLEVEL_QUEST },
975 { .Name = "Rate.Reputation.RecruitAFriendBonus"sv, .DefaultValue = 0.1f, .Index = RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS},
976 { .Name = "Rate.Creature.HP.Normal"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_HP_NORMAL },
977 { .Name = "Rate.Creature.HP.Elite"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_HP_ELITE },
978 { .Name = "Rate.Creature.HP.RareElite"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_HP_RAREELITE },
979 { .Name = "Rate.Creature.HP.Obsolete"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_HP_OBSOLETE },
980 { .Name = "Rate.Creature.HP.Rare"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_HP_RARE },
981 { .Name = "Rate.Creature.HP.Trivial"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_HP_TRIVIAL },
982 { .Name = "Rate.Creature.HP.MinusMob"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_HP_MINUSMOB },
983 { .Name = "Rate.Creature.Damage.Normal"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_DAMAGE_NORMAL },
984 { .Name = "Rate.Creature.Damage.Elite"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_DAMAGE_ELITE },
985 { .Name = "Rate.Creature.Damage.RareElite"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_DAMAGE_RAREELITE },
986 { .Name = "Rate.Creature.Damage.Obsolete"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_DAMAGE_OBSOLETE },
987 { .Name = "Rate.Creature.Damage.Rare"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_DAMAGE_RARE },
988 { .Name = "Rate.Creature.Damage.Trivial"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_DAMAGE_TRIVIAL },
989 { .Name = "Rate.Creature.Damage.MinusMob"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_DAMAGE_MINUSMOB },
990 { .Name = "Rate.Creature.SpellDamage.Normal"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_SPELLDAMAGE_NORMAL },
991 { .Name = "Rate.Creature.SpellDamage.Elite"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_SPELLDAMAGE_ELITE },
992 { .Name = "Rate.Creature.SpellDamage.RareElite"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_SPELLDAMAGE_RAREELITE },
993 { .Name = "Rate.Creature.SpellDamage.Obsolete"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_SPELLDAMAGE_OBSOLETE },
994 { .Name = "Rate.Creature.SpellDamage.Rare"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_SPELLDAMAGE_RARE },
995 { .Name = "Rate.Creature.SpellDamage.Trivial"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_SPELLDAMAGE_TRIVIAL },
996 { .Name = "Rate.Creature.SpellDamage.MinusMob"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_SPELLDAMAGE_MINUSMOB },
997 { .Name = "Rate.Creature.Aggro"sv, .DefaultValue = 1.0f, .Index = RATE_CREATURE_AGGRO },
998 { .Name = "Rate.Rest.InGame"sv, .DefaultValue = 1.0f, .Index = RATE_REST_INGAME },
999 { .Name = "Rate.Rest.Offline.InTavernOrCity"sv, .DefaultValue = 1.0f, .Index = RATE_REST_OFFLINE_IN_TAVERN_OR_CITY },
1000 { .Name = "Rate.Rest.Offline.InWilderness"sv, .DefaultValue = 1.0f, .Index = RATE_REST_OFFLINE_IN_WILDERNESS },
1001 { .Name = "Rate.Damage.Fall"sv, .DefaultValue = 1.0f, .Index = RATE_DAMAGE_FALL },
1002 { .Name = "Rate.Auction.Time"sv, .DefaultValue = 1.0f, .Index = RATE_AUCTION_TIME },
1003 { .Name = "Rate.Auction.Deposit"sv, .DefaultValue = 1.0f, .Index = RATE_AUCTION_DEPOSIT },
1004 { .Name = "Rate.Auction.Cut"sv, .DefaultValue = 1.0f, .Index = RATE_AUCTION_CUT },
1005 { .Name = "Rate.Honor"sv, .DefaultValue = 1.0f, .Index = RATE_HONOR },
1006 { .Name = "Rate.InstanceResetTime"sv, .DefaultValue = 1.0f, .Index = RATE_INSTANCE_RESET_TIME },
1007 { .Name = "Rate.MoveSpeed"sv, .DefaultValue = 1.0f, .Index = RATE_MOVESPEED, .Min = 0.01f },
1008 { .Name = "Rate.Corpse.Decay.Looted"sv, .DefaultValue = 0.5f, .Index = RATE_CORPSE_DECAY_LOOTED },
1009 { .Name = "DurabilityLoss.OnDeath"sv, .DefaultValue = 10.0f, .Index = RATE_DURABILITY_LOSS_ON_DEATH, .Min = 0.0f, .Max = 100.0f },
1010 { .Name = "DurabilityLossChance.Damage"sv, .DefaultValue = 0.5f, .Index = RATE_DURABILITY_LOSS_DAMAGE, .Min = 0.0f },
1011 { .Name = "DurabilityLossChance.Absorb"sv, .DefaultValue = 0.5f, .Index = RATE_DURABILITY_LOSS_ABSORB, .Min = 0.0f },
1012 { .Name = "DurabilityLossChance.Parry"sv, .DefaultValue = 0.05f, .Index = RATE_DURABILITY_LOSS_PARRY, .Min = 0.0f },
1013 { .Name = "DurabilityLossChance.Block"sv, .DefaultValue = 0.05f, .Index = RATE_DURABILITY_LOSS_BLOCK, .Min = 0.0f },
1014 { .Name = "Rate.Quest.Money.Reward"sv, .DefaultValue = 1.0f, .Index = RATE_MONEY_QUEST, .Min = 0.0f },
1015 { .Name = "Rate.Quest.Money.Max.Level.Reward"sv, .DefaultValue = 1.0f, .Index = RATE_MONEY_MAX_LEVEL_QUEST, .Min = 0.0f },
1016 } };
1017
1018 for (ConfigOptionLoadDefinition<bool, WorldBoolConfigs> const& definition : bools)
1019 StoreConfigValue(m_bool_configs[definition.Index], sConfigMgr->GetBoolDefault(definition.Name, definition.DefaultValue), definition, reload);
1020
1021 for (ConfigOptionLoadDefinition<uint32, WorldIntConfigs> const& definition : ints)
1022 StoreConfigValue(m_int_configs[definition.Index], sConfigMgr->GetIntDefault(definition.Name, definition.DefaultValue), definition, reload);
1023
1024 for (ConfigOptionLoadDefinition<uint64, WorldInt64Configs> const& definition : int64s)
1025 StoreConfigValue(m_int64_configs[definition.Index], sConfigMgr->GetInt64Default(definition.Name, definition.DefaultValue), definition, reload);
1026
1027 for (ConfigOptionLoadDefinition<float, WorldFloatConfigs> const& definition : floats)
1028 StoreConfigValue(m_float_configs[definition.Index], sConfigMgr->GetFloatDefault(definition.Name, definition.DefaultValue), definition, reload);
1029
1030 for (ConfigOptionLoadDefinition<float, Rates> const& definition : rates)
1031 StoreConfigValue(rate_values[definition.Index], sConfigMgr->GetFloatDefault(definition.Name, definition.DefaultValue), definition, reload);
1032
1034 SetNewCharString(sConfigMgr->GetStringDefault("PlayerStart.String"sv, ""sv));
1035
1036 for (uint8 i = 0; i < MAX_MOVE_TYPE; ++i)
1038
1040
1042 {
1044 {
1045 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");
1047 }
1049 {
1050 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");
1052 }
1053 }
1054
1055 // Config values are in "milliseconds" but we handle SocketTimeOut only as "seconds" so divide by 1000
1058
1059 // must be after CONFIG_CHARACTERS_PER_REALM
1061 {
1062 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]);
1064 }
1065
1066 auto validateStartLevel = [&](WorldIntConfigs config, char const* name)
1067 {
1069 if (m_int_configs[config] > maxLevel)
1070 {
1071 TC_LOG_ERROR("server.loading", "{} ({}) must be in range 1..MaxPlayerLevel({}). Set to {}.", name, m_int_configs[config], maxLevel, maxLevel);
1072 m_int_configs[config] = maxLevel;
1073 }
1074 };
1075
1076 validateStartLevel(CONFIG_START_PLAYER_LEVEL, "StartPlayerLevel");
1077 validateStartLevel(CONFIG_START_DEATH_KNIGHT_PLAYER_LEVEL, "StartDeathKnightPlayerLevel");
1078 validateStartLevel(CONFIG_START_DEMON_HUNTER_PLAYER_LEVEL, "StartDemonHunterPlayerLevel");
1079 validateStartLevel(CONFIG_START_EVOKER_PLAYER_LEVEL, "StartEvokerPlayerLevel");
1080 validateStartLevel(CONFIG_START_ALLIED_RACE_LEVEL, "StartDemonHunterPlayerLevel");
1081 validateStartLevel(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL, "RecruitAFriend.MaxLevel");
1082
1084 {
1085 TC_LOG_ERROR("server.loading", "GM.StartLevel ({}) must be in range StartPlayerLevel({})..{}. Set to {}.",
1088 }
1089
1090 TC_LOG_INFO("server.loading", "Will clear `logs` table of entries older than {} seconds every {} minutes.",
1092
1094 {
1095 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]);
1097 }
1098
1099 // always use declined names in the russian client
1100 if (Cfg_CategoriesEntry const* category = sCfgCategoriesStore.LookupEntry(m_int_configs[CONFIG_REALM_ZONE]))
1101 if (category->GetCreateCharsetMask().HasFlag(CfgCategoriesCharsets::Russian))
1103
1105 m_int_configs[CONFIG_CLIENTCACHE_VERSION] = databaseCacheVersion;
1106
1107 TC_LOG_INFO("server.loading", "Client cache version set to: {}", m_int_configs[CONFIG_CLIENTCACHE_VERSION]);
1108
1109 auto validateVisibilityDistance = [&](WorldFloatConfigs config, char const* name)
1110 {
1111 float minVisibilityDistance = 45.0f * rate_values[RATE_CREATURE_AGGRO];
1112 if (m_float_configs[config] < minVisibilityDistance)
1113 {
1114 TC_LOG_ERROR("server.loading", "{} can't be less max aggro radius {}", name, minVisibilityDistance);
1115 m_float_configs[config] = minVisibilityDistance;
1116 }
1117 };
1118
1119 // visibility on continents
1120 validateVisibilityDistance(CONFIG_MAX_VISIBILITY_DISTANCE_CONTINENT, "Visibility.Distance.Continents");
1121
1122 // visibility in instances
1123 validateVisibilityDistance(CONFIG_MAX_VISIBILITY_DISTANCE_INSTANCE, "Visibility.Distance.Instances");
1124
1125 // visibility in BG
1126 validateVisibilityDistance(CONFIG_MAX_VISIBILITY_DISTANCE_BATTLEGROUND, "Visibility.Distance.BG");
1127
1128 // Visibility in Arenas
1129 validateVisibilityDistance(CONFIG_MAX_VISIBILITY_DISTANCE_ARENA, "Visibility.Distance.Arenas");
1130
1131 // No aggro from gray mobs
1133 {
1134 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]);
1136 }
1138 {
1139 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]);
1141 }
1143 {
1144 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]);
1146 }
1147
1148 // Respawn Settings
1149 _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);
1150 _alertRestartReason = sConfigMgr->GetStringDefault("Respawn.AlertRestartReason"sv, "Urgent Maintenance"sv);
1151
1153 std::string dataPath = sConfigMgr->GetStringDefault("DataDir"sv, "./"sv);
1154 if (dataPath.empty() || (dataPath.back() != '/' && dataPath.back() != '\\'))
1155 dataPath.push_back('/');
1156
1157 if (dataPath[0] == '~')
1158 {
1159#if TRINITY_PLATFORM != TRINITY_PLATFORM_WINDOWS
1160#define USER_HOME_DIRECTORY_VARIABLE "HOME"
1161#else
1162#define USER_HOME_DIRECTORY_VARIABLE "USERPROFILE"
1163#endif
1164 if (char const* home = std::getenv(USER_HOME_DIRECTORY_VARIABLE))
1165 dataPath.replace(0, 1, home);
1166#undef USER_HOME_DIRECTORY_VARIABLE
1167 }
1168
1169 if (reload)
1170 {
1171 if (dataPath != m_dataPath)
1172 TC_LOG_ERROR("server.loading", "DataDir option can't be changed at worldserver.conf reload, using current value ({}).", m_dataPath);
1173 }
1174 else
1175 {
1176 m_dataPath = std::move(dataPath);
1177 TC_LOG_INFO("server.loading", "Using DataDir {}", m_dataPath);
1178 }
1179
1180 TC_LOG_INFO("server.loading", "WORLD: MMap data directory is: {}mmaps", m_dataPath);
1181
1182 bool enableLOS = sConfigMgr->GetBoolDefault("vmap.enableLOS"sv, true);
1183 bool enableHeight = sConfigMgr->GetBoolDefault("vmap.enableHeight"sv, true);
1184
1185 if (!enableHeight)
1186 TC_LOG_ERROR("server.loading", "VMap height checking disabled! Creatures movements and other various things WILL be broken! Expect no support.");
1187
1190 TC_LOG_INFO("server.loading", "VMap support included. LineOfSight: {}, getHeight: {}, indoorCheck: {}", enableLOS, enableHeight, m_bool_configs[CONFIG_VMAP_INDOOR_CHECK]);
1191 TC_LOG_INFO("server.loading", "VMap data directory is: {}vmaps", m_dataPath);
1192
1194 TC_LOG_WARN("server.loading", "PlayerStart.AllSpells enabled - may not function as intended!");
1195
1196 //packet spoof punishment
1199
1200 _gameRules =
1201 {
1202 { .Rule = ::GameRule::TransmogEnabled, .Value = true },
1203 { .Rule = ::GameRule::HousingEnabled, .Value = true }
1204 };
1205
1206 if (reload)
1207 {
1208 sSupportMgr->SetSupportSystemStatus(m_bool_configs[CONFIG_SUPPORT_ENABLED]);
1213 sMapMgr->SetGridCleanUpDelay(m_int_configs[CONFIG_INTERVAL_GRIDCLEAN]);
1214 sMapMgr->SetMapUpdateInterval(m_int_configs[CONFIG_INTERVAL_MAPUPDATE]);
1223
1224 // call ScriptMgr if we're reloading the configuration
1225 sScriptMgr->OnConfigLoad(reload);
1226 }
1227}
1228
1231{
1232 sLog->SetRealmId(sRealmList->GetCurrentRealmId().Realm);
1233
1235 uint32 startupBegin = getMSTime();
1236
1238 srand((unsigned int)GameTime::GetGameTime());
1239
1241 dtAllocSetCustom(dtCustomAlloc, dtCustomFree);
1242
1247
1250
1253
1255 sObjectMgr->SetHighestGuids();
1256
1258 if (!TerrainMgr::ExistMapAndVMap(0, -6240.32f, 331.033f)
1259 || !TerrainMgr::ExistMapAndVMap(0, -8949.95f, -132.493f)
1260 || !TerrainMgr::ExistMapAndVMap(1, -618.518f, -4251.67f)
1261 || !TerrainMgr::ExistMapAndVMap(0, 1676.35f, 1677.45f)
1262 || !TerrainMgr::ExistMapAndVMap(1, 10311.3f, 832.463f)
1263 || !TerrainMgr::ExistMapAndVMap(1, -2917.58f, -257.98f)
1265 !TerrainMgr::ExistMapAndVMap(530, 10349.6f, -6357.29f) ||
1266 !TerrainMgr::ExistMapAndVMap(530, -3961.64f, -13931.2f))))
1267 {
1268 TC_LOG_FATAL("server.loading", "Unable to load map and vmap data for starting zones - server shutting down!");
1269 return false;
1270 }
1271
1273 sPoolMgr->Initialize();
1274
1276 sGameEventMgr->Initialize();
1277
1279
1280 TC_LOG_INFO("server.loading", "Loading Trinity strings...");
1281 if (!sObjectMgr->LoadTrinityStrings())
1282 return false; // Error message displayed in function already
1283
1285 //No SQL injection as values are treated as integers
1286
1287 // not send custom type REALM_FFA_PVP to realm list
1290
1291 LoginDatabase.PExecute("UPDATE realmlist SET icon = {}, timezone = {} WHERE id = '{}'", server_type, realm_zone, sRealmList->GetCurrentRealmId().Realm); // One-time query
1292
1293 TC_LOG_INFO("server.loading", "Loading GameObject models...");
1295 {
1296 TC_LOG_FATAL("server.loading", "Unable to load gameobject models (part of vmaps), objects using WMO models will crash the client - server shutting down!");
1297 return false;
1298 }
1299
1300 TC_LOG_INFO("server.loading", "Initialize data stores...");
1304 {
1305 TC_LOG_FATAL("server.loading", "Unable to load db2 files for {} locale specified in DBC.Locale config!", localeNames[m_defaultDbcLocale]);
1306 return false;
1307 }
1308
1309 TC_LOG_INFO("server.loading", "Loading hotfix blobs...");
1310 sDB2Manager.LoadHotfixBlob(m_availableDbcLocaleMask);
1311 TC_LOG_INFO("server.loading", "Loading hotfix info...");
1312 sDB2Manager.LoadHotfixData(m_availableDbcLocaleMask);
1313 TC_LOG_INFO("server.loading", "Loading hotfix optional data...");
1314 sDB2Manager.LoadHotfixOptionalData(m_availableDbcLocaleMask);
1315 TC_LOG_INFO("server.loading", "Indexing loaded data stores...");
1316 sDB2Manager.IndexLoadedStores();
1321
1322 //Load weighted graph on taxi nodes path
1324 // Load IP Location Database
1325 sIPLocation->Load();
1326
1327 // always use declined names in the russian client
1328 if (Cfg_CategoriesEntry const* category = sCfgCategoriesStore.LookupEntry(m_int_configs[CONFIG_REALM_ZONE]))
1329 if (category->GetCreateCharsetMask().HasFlag(CfgCategoriesCharsets::Russian))
1331
1332 std::unordered_map<uint32, std::vector<uint32>> mapData;
1333 for (MapEntry const* mapEntry : sMapStore)
1334 {
1335 mapData.emplace(std::piecewise_construct, std::forward_as_tuple(mapEntry->ID), std::forward_as_tuple());
1336 if (mapEntry->ParentMapID != -1)
1337 {
1338 ASSERT(mapEntry->CosmeticParentMapID == -1 || mapEntry->ParentMapID == mapEntry->CosmeticParentMapID,
1339 "Inconsistent parent map data for map %u (ParentMapID = %hd, CosmeticParentMapID = %hd)",
1340 mapEntry->ID, mapEntry->ParentMapID, mapEntry->CosmeticParentMapID);
1341
1342 mapData[mapEntry->ParentMapID].push_back(mapEntry->ID);
1343 }
1344 else if (mapEntry->CosmeticParentMapID != -1)
1345 mapData[mapEntry->CosmeticParentMapID].push_back(mapEntry->ID);
1346 }
1347
1348 sTerrainMgr.InitializeParentMapData(mapData);
1349
1350 vmmgr2->InitializeThreadUnsafe(mapData);
1351
1353 mmmgr->InitializeThreadUnsafe(mapData);
1354
1357
1358 TC_LOG_INFO("server.loading", "Initializing PlayerDump tables...");
1360
1361 TC_LOG_INFO("server.loading", "Loading SpellInfo store...");
1362 sSpellMgr->LoadSpellInfoStore();
1363
1364 TC_LOG_INFO("server.loading", "Loading serverside spells...");
1365 sSpellMgr->LoadSpellInfoServerside();
1366
1367 TC_LOG_INFO("server.loading", "Loading SpellInfo corrections...");
1368 sSpellMgr->LoadSpellInfoCorrections();
1369
1370 TC_LOG_INFO("server.loading", "Loading SkillLineAbilityMultiMap Data...");
1371 sSpellMgr->LoadSkillLineAbilityMap();
1372
1373 TC_LOG_INFO("server.loading", "Loading SpellInfo custom attributes...");
1374 sSpellMgr->LoadSpellInfoCustomAttributes();
1375
1376 TC_LOG_INFO("server.loading", "Loading SpellInfo diminishing infos...");
1377 sSpellMgr->LoadSpellInfoDiminishing();
1378
1379 TC_LOG_INFO("server.loading", "Loading SpellInfo immunity infos...");
1380 sSpellMgr->LoadSpellInfoImmunities();
1381
1382 TC_LOG_INFO("server.loading", "Loading SpellInfo target caps...");
1383 sSpellMgr->LoadSpellInfoTargetCaps();
1384
1385 TC_LOG_INFO("server.loading", "Loading PetFamilySpellsStore Data...");
1386 sSpellMgr->LoadPetFamilySpellsStore();
1387
1388 TC_LOG_INFO("server.loading", "Loading Spell Totem models...");
1389 sSpellMgr->LoadSpellTotemModel();
1390
1391 TC_LOG_INFO("server.loading", "Loading Traits...");
1393
1394 TC_LOG_INFO("server.loading", "Loading languages..."); // must be after LoadSpellInfoStore and LoadSkillLineAbilityMap
1395 sLanguageMgr->LoadLanguages();
1396
1397 TC_LOG_INFO("server.loading", "Loading languages words...");
1398 sLanguageMgr->LoadLanguagesWords();
1399
1400 TC_LOG_INFO("server.loading", "Loading Instance Template...");
1401 sObjectMgr->LoadInstanceTemplate();
1402
1403 // Must be called before `respawn` data
1404 TC_LOG_INFO("server.loading", "Loading instances...");
1405 sMapMgr->InitInstanceIds();
1406 sInstanceLockMgr.Load();
1407
1408 TC_LOG_INFO("server.loading", "Loading Localization strings...");
1409 uint32 oldMSTime = getMSTime();
1411 {
1412 sObjectMgr->LoadCreatureLocales();
1413 sObjectMgr->LoadGameObjectLocales();
1414 sObjectMgr->LoadQuestTemplateLocale();
1415 sObjectMgr->LoadQuestOfferRewardLocale();
1416 sObjectMgr->LoadQuestRequestItemsLocale();
1417 sObjectMgr->LoadQuestObjectivesLocale();
1418 sObjectMgr->LoadPageTextLocales();
1419 sObjectMgr->LoadGossipMenuItemsLocales();
1420 sObjectMgr->LoadPointOfInterestLocales();
1421 }
1422
1423 sObjectMgr->SetDBCLocaleIndex(GetDefaultDbcLocale()); // Get once for all the locale index of DBC language (console/broadcasts)
1424 TC_LOG_INFO("server.loading", ">> Localization strings loaded in {} ms", GetMSTimeDiffToNow(oldMSTime));
1425
1426 TC_LOG_INFO("server.loading", "Loading Account Roles and Permissions...");
1427 sAccountMgr->LoadRBAC();
1428
1429 TC_LOG_INFO("server.loading", "Loading Page Texts...");
1430 sObjectMgr->LoadPageTexts();
1431
1432 TC_LOG_INFO("server.loading", "Loading Game Object Templates..."); // must be after LoadPageTexts
1433 sObjectMgr->LoadDestructibleHitpoints();
1434 sObjectMgr->LoadGameObjectTemplate();
1435
1436 TC_LOG_INFO("server.loading", "Loading Game Object template addons...");
1437 sObjectMgr->LoadGameObjectTemplateAddons();
1438
1439 TC_LOG_INFO("server.loading", "Loading Transport templates...");
1440 sTransportMgr->LoadTransportTemplates();
1441
1442 TC_LOG_INFO("server.loading", "Loading Transport animations and rotations...");
1443 sTransportMgr->LoadTransportAnimationAndRotation();
1444
1445 TC_LOG_INFO("server.loading", "Loading Transport spawns...");
1446 sTransportMgr->LoadTransportSpawns();
1447
1448 TC_LOG_INFO("server.loading", "Loading Spell Rank Data...");
1449 sSpellMgr->LoadSpellRanks();
1450
1451 TC_LOG_INFO("server.loading", "Loading Spell Required Data...");
1452 sSpellMgr->LoadSpellRequired();
1453
1454 TC_LOG_INFO("server.loading", "Loading Spell Group types...");
1455 sSpellMgr->LoadSpellGroups();
1456
1457 TC_LOG_INFO("server.loading", "Loading Spell Learn Skills...");
1458 sSpellMgr->LoadSpellLearnSkills(); // must be after LoadSpellRanks
1459
1460 TC_LOG_INFO("server.loading", "Loading SpellInfo SpellSpecific and AuraState...");
1461 sSpellMgr->LoadSpellInfoSpellSpecificAndAuraState(); // must be after LoadSpellRanks
1462
1463 TC_LOG_INFO("server.loading", "Loading Spell Learn Spells...");
1464 sSpellMgr->LoadSpellLearnSpells();
1465
1466 TC_LOG_INFO("server.loading", "Loading Spell Proc conditions and data...");
1467 sSpellMgr->LoadSpellProcs();
1468
1469 TC_LOG_INFO("server.loading", "Loading Aggro Spells Definitions...");
1470 sSpellMgr->LoadSpellThreats();
1471
1472 TC_LOG_INFO("server.loading", "Loading Spell Group Stack Rules...");
1473 sSpellMgr->LoadSpellGroupStackRules();
1474
1475 TC_LOG_INFO("server.loading", "Loading NPC Texts...");
1476 sObjectMgr->LoadNPCText();
1477
1478 TC_LOG_INFO("server.loading", "Loading Enchant Spells Proc datas...");
1479 sSpellMgr->LoadSpellEnchantProcData();
1480
1481 TC_LOG_INFO("server.loading", "Loading item bonus data...");
1483
1484 TC_LOG_INFO("server.loading", "Loading Random item bonus list definitions...");
1486
1487 TC_LOG_INFO("server.loading", "Loading Disables"); // must be before loading quests and items
1489
1490 TC_LOG_INFO("server.loading", "Loading Items..."); // must be after LoadRandomEnchantmentsTable and LoadPageTexts
1491 sObjectMgr->LoadItemTemplates();
1492
1493 TC_LOG_INFO("server.loading", "Loading Item set names..."); // must be after LoadItemPrototypes
1494 sObjectMgr->LoadItemTemplateAddon();
1495
1496 TC_LOG_INFO("misc", "Loading Item Scripts..."); // must be after LoadItemPrototypes
1497 sObjectMgr->LoadItemScriptNames();
1498
1499 TC_LOG_INFO("server.loading", "Loading Creature Model Based Info Data...");
1500 sObjectMgr->LoadCreatureModelInfo();
1501
1502 TC_LOG_INFO("server.loading", "Loading Creature templates...");
1503 sObjectMgr->LoadCreatureTemplates();
1504
1505 TC_LOG_INFO("server.loading", "Loading Equipment templates..."); // must be after LoadCreatureTemplates
1506 sObjectMgr->LoadEquipmentTemplates();
1507
1508 TC_LOG_INFO("server.loading", "Loading Creature template addons...");
1509 sObjectMgr->LoadCreatureTemplateAddons();
1510
1511 TC_LOG_INFO("server.loading", "Loading Creature template difficulty...");
1512 sObjectMgr->LoadCreatureTemplateDifficulty();
1513
1514 TC_LOG_INFO("server.loading", "Loading Creature template sparring...");
1515 sObjectMgr->LoadCreatureTemplateSparring();
1516
1517 TC_LOG_INFO("server.loading", "Loading Reputation Reward Rates...");
1518 sObjectMgr->LoadReputationRewardRate();
1519
1520 TC_LOG_INFO("server.loading", "Loading Creature Reputation OnKill Data...");
1521 sObjectMgr->LoadReputationOnKill();
1522
1523 TC_LOG_INFO("server.loading", "Loading Reputation Spillover Data...");
1524 sObjectMgr->LoadReputationSpilloverTemplate();
1525
1526 TC_LOG_INFO("server.loading", "Loading Points Of Interest Data...");
1527 sObjectMgr->LoadPointsOfInterest();
1528
1529 TC_LOG_INFO("server.loading", "Loading Creature Base Stats...");
1530 sObjectMgr->LoadCreatureClassLevelStats();
1531
1532 TC_LOG_INFO("server.loading", "Loading Spawn Group Templates...");
1533 sObjectMgr->LoadSpawnGroupTemplates();
1534
1535 TC_LOG_INFO("server.loading", "Loading Creature Data...");
1536 sObjectMgr->LoadCreatures();
1537
1538 TC_LOG_INFO("server.loading", "Loading Temporary Summon Data...");
1539 sObjectMgr->LoadTempSummons(); // must be after LoadCreatureTemplates() and LoadGameObjectTemplates()
1540
1541 TC_LOG_INFO("server.loading", "Loading pet levelup spells...");
1542 sSpellMgr->LoadPetLevelupSpellMap();
1543
1544 TC_LOG_INFO("server.loading", "Loading pet default spells additional to levelup spells...");
1545 sSpellMgr->LoadPetDefaultSpells();
1546
1547 TC_LOG_INFO("server.loading", "Loading Creature Addon Data...");
1548 sObjectMgr->LoadCreatureAddons(); // must be after LoadCreatureTemplates() and LoadCreatures()
1549
1550 TC_LOG_INFO("server.loading", "Loading Creature Movement Overrides...");
1551 sObjectMgr->LoadCreatureMovementOverrides(); // must be after LoadCreatures()
1552
1553 TC_LOG_INFO("server.loading", "Loading Gameobject Data...");
1554 sObjectMgr->LoadGameObjects();
1555
1556 TC_LOG_INFO("server.loading", "Loading Spawn Group Data...");
1557 sObjectMgr->LoadSpawnGroups();
1558
1559 TC_LOG_INFO("server.loading", "Loading instance spawn groups...");
1560 sObjectMgr->LoadInstanceSpawnGroups();
1561
1562 TC_LOG_INFO("server.loading", "Loading GameObject Addon Data...");
1563 sObjectMgr->LoadGameObjectAddons(); // must be after LoadGameObjects()
1564
1565 TC_LOG_INFO("server.loading", "Loading GameObject faction and flags overrides...");
1566 sObjectMgr->LoadGameObjectOverrides(); // must be after LoadGameObjects()
1567
1568 TC_LOG_INFO("server.loading", "Loading GameObject Quest Items...");
1569 sObjectMgr->LoadGameObjectQuestItems();
1570
1571 TC_LOG_INFO("server.loading", "Loading Creature Quest Items...");
1572 sObjectMgr->LoadCreatureQuestItems();
1573
1574 TC_LOG_INFO("server.loading", "Loading Creature Quest Currencies...");
1575 sObjectMgr->LoadCreatureQuestCurrencies();
1576
1577 TC_LOG_INFO("server.loading", "Loading Creature Linked Respawn...");
1578 sObjectMgr->LoadLinkedRespawn(); // must be after LoadCreatures(), LoadGameObjects()
1579
1580 TC_LOG_INFO("server.loading", "Loading Weather Data...");
1582
1583 TC_LOG_INFO("server.loading", "Loading Quests...");
1585 sObjectMgr->LoadQuests(); // must be loaded after DBCs, creature_template, items, gameobject tables
1586
1587 TC_LOG_INFO("server.loading", "Checking Quest Disables");
1588 DisableMgr::CheckQuestDisables(); // must be after loading quests
1589
1590 TC_LOG_INFO("server.loading", "Loading Quest POI");
1591 sObjectMgr->LoadQuestPOI();
1592
1593 TC_LOG_INFO("server.loading", "Loading Quests Starters and Enders...");
1594 sObjectMgr->LoadQuestStartersAndEnders(); // must be after quest load
1595
1596 TC_LOG_INFO("server.loading", "Loading Quest Greetings...");
1597 sObjectMgr->LoadQuestGreetings();
1598
1600 sObjectMgr->LoadQuestGreetingLocales();
1601
1602 TC_LOG_INFO("server.loading", "Loading Objects Pooling Data...");
1603 sPoolMgr->LoadFromDB();
1604 TC_LOG_INFO("server.loading", "Loading Quest Pooling Data...");
1605 sQuestPoolMgr->LoadFromDB(); // must be after quest templates
1606
1607 TC_LOG_INFO("server.loading", "Loading World State templates...");
1608 WorldStateMgr::LoadFromDB(); // must be loaded before battleground, outdoor PvP, game events and conditions
1609
1610 TC_LOG_INFO("server.loading", "Loading Game Event Data..."); // must be after loading pools fully
1611 sGameEventMgr->LoadFromDB();
1612
1613 TC_LOG_INFO("server.loading", "Loading creature summoned data...");
1614 sObjectMgr->LoadCreatureSummonedData(); // must be after LoadCreatureTemplates() and LoadQuests()
1615
1616 TC_LOG_INFO("server.loading", "Loading UNIT_NPC_FLAG_SPELLCLICK Data..."); // must be after LoadQuests
1617 sObjectMgr->LoadNPCSpellClickSpells();
1618
1619 TC_LOG_INFO("server.loading", "Loading Vehicle Templates...");
1620 sObjectMgr->LoadVehicleTemplate(); // must be after LoadCreatureTemplates()
1621
1622 TC_LOG_INFO("server.loading", "Loading Vehicle Template Accessories...");
1623 sObjectMgr->LoadVehicleTemplateAccessories(); // must be after LoadCreatureTemplates() and LoadNPCSpellClickSpells()
1624
1625 TC_LOG_INFO("server.loading", "Loading Vehicle Accessories...");
1626 sObjectMgr->LoadVehicleAccessories(); // must be after LoadCreatureTemplates() and LoadNPCSpellClickSpells()
1627
1628 TC_LOG_INFO("server.loading", "Loading Vehicle Seat Addon Data...");
1629 sObjectMgr->LoadVehicleSeatAddon(); // must be after loading DBC
1630
1631 TC_LOG_INFO("server.loading", "Loading SpellArea Data..."); // must be after quest load
1632 sSpellMgr->LoadSpellAreas();
1633
1634 TC_LOG_INFO("server.loading", "Loading World locations...");
1635 sObjectMgr->LoadWorldSafeLocs(); // must be before LoadAreaTriggerTeleports and LoadGraveyardZones
1636
1637 TC_LOG_INFO("server.loading", "Loading Area Trigger Teleports definitions...");
1638 sObjectMgr->LoadAreaTriggerTeleports();
1639
1640 TC_LOG_INFO("server.loading", "Loading Area Trigger Polygon data...");
1641 sObjectMgr->LoadAreaTriggerPolygons();
1642
1643 TC_LOG_INFO("server.loading", "Loading Access Requirements...");
1644 sObjectMgr->LoadAccessRequirements(); // must be after item template load
1645
1646 TC_LOG_INFO("server.loading", "Loading Quest Area Triggers...");
1647 sObjectMgr->LoadQuestAreaTriggers(); // must be after LoadQuests
1648
1649 TC_LOG_INFO("server.loading", "Loading Tavern Area Triggers...");
1650 sObjectMgr->LoadTavernAreaTriggers();
1651
1652 TC_LOG_INFO("server.loading", "Loading AreaTrigger script names...");
1653 sObjectMgr->LoadAreaTriggerScripts();
1654
1655 TC_LOG_INFO("server.loading", "Loading LFG entrance positions..."); // Must be after areatriggers
1656 sLFGMgr->LoadLFGDungeons();
1657
1658 TC_LOG_INFO("server.loading", "Loading LFG rewards...");
1659 sLFGMgr->LoadRewards();
1660
1661 TC_LOG_INFO("server.loading", "Loading Graveyard-zone links...");
1662 sObjectMgr->LoadGraveyardZones();
1663
1664 TC_LOG_INFO("server.loading", "Loading spell pet auras...");
1665 sSpellMgr->LoadSpellPetAuras();
1666
1667 TC_LOG_INFO("server.loading", "Loading Spell target coordinates...");
1668 sSpellMgr->LoadSpellTargetPositions();
1669
1670 TC_LOG_INFO("server.loading", "Loading linked spells...");
1671 sSpellMgr->LoadSpellLinked();
1672
1673 TC_LOG_INFO("server.loading", "Loading Scenes Templates..."); // must be before LoadPlayerInfo
1674 sObjectMgr->LoadSceneTemplates();
1675
1676 TC_LOG_INFO("server.loading", "Loading Player Create Data...");
1677 sObjectMgr->LoadPlayerInfo();
1678
1679 TC_LOG_INFO("server.loading", "Loading Exploration BaseXP Data...");
1680 sObjectMgr->LoadExplorationBaseXP();
1681
1682 TC_LOG_INFO("server.loading", "Loading Pet Name Parts...");
1683 sObjectMgr->LoadPetNames();
1684
1685 TC_LOG_INFO("server.loading", "Loading AreaTrigger Templates...");
1686 sAreaTriggerDataStore->LoadAreaTriggerTemplates();
1687
1688 TC_LOG_INFO("server.loading", "Loading AreaTrigger Spawns...");
1689 sAreaTriggerDataStore->LoadAreaTriggerSpawns();
1690
1691 TC_LOG_INFO("server.loading", "Loading Conversation Templates...");
1692 sConversationDataStore->LoadConversationTemplates();
1693
1694 TC_LOG_INFO("server.loading", "Loading Player Choices...");
1695 sObjectMgr->LoadPlayerChoices();
1696
1697 TC_LOG_INFO("server.loading", "Loading Spawn Tracking Templates...");
1698 sObjectMgr->LoadSpawnTrackingTemplates();
1699
1700 TC_LOG_INFO("server.loading", "Loading Spawn Tracking Quest Objectives...");
1701 sObjectMgr->LoadSpawnTrackingQuestObjectives();
1702
1703 TC_LOG_INFO("server.loading", "Loading Spawn Tracking Spawns...");
1704 sObjectMgr->LoadSpawnTrackings();
1705
1706 TC_LOG_INFO("server.loading", "Loading Spawn Tracking Spawn States...");
1707 sObjectMgr->LoadSpawnTrackingStates();
1708
1710 {
1711 TC_LOG_INFO("server.loading", "Loading Player Choices Locales...");
1712 sObjectMgr->LoadPlayerChoicesLocale();
1713 }
1714
1715 TC_LOG_INFO("server.loading", "Loading UIMap questlines...");
1716 sObjectMgr->LoadUiMapQuestLines();
1717
1718 TC_LOG_INFO("server.loading", "Loading UIMap quests...");
1719 sObjectMgr->LoadUiMapQuests();
1720
1721 TC_LOG_INFO("server.loading", "Loading Jump Charge Params...");
1722 sObjectMgr->LoadJumpChargeParams();
1723
1725
1726 TC_LOG_INFO("server.loading", "Loading the max pet number...");
1727 sObjectMgr->LoadPetNumber();
1728
1729 TC_LOG_INFO("server.loading", "Loading pet level stats...");
1730 sObjectMgr->LoadPetLevelInfo();
1731
1732 TC_LOG_INFO("server.loading", "Loading Player level dependent mail rewards...");
1733 sObjectMgr->LoadMailLevelRewards();
1734
1735 // Loot tables
1737
1738 TC_LOG_INFO("server.loading", "Loading Skill Discovery Table...");
1740
1741 TC_LOG_INFO("server.loading", "Loading Skill Extra Item Table...");
1743
1744 TC_LOG_INFO("server.loading", "Loading Skill Perfection Data Table...");
1746
1747 TC_LOG_INFO("server.loading", "Loading Skill Fishing base level requirements...");
1748 sObjectMgr->LoadFishingBaseSkillLevel();
1749
1750 TC_LOG_INFO("server.loading", "Loading skill tier info...");
1751 sObjectMgr->LoadSkillTiers();
1752
1753 TC_LOG_INFO("server.loading", "Loading Criteria Modifier trees...");
1754 sCriteriaMgr->LoadCriteriaModifiersTree();
1755 TC_LOG_INFO("server.loading", "Loading Criteria Lists...");
1756 sCriteriaMgr->LoadCriteriaList();
1757 TC_LOG_INFO("server.loading", "Loading Criteria Data...");
1758 sCriteriaMgr->LoadCriteriaData();
1759 TC_LOG_INFO("server.loading", "Loading Achievements...");
1760 sAchievementMgr->LoadAchievementReferenceList();
1761 TC_LOG_INFO("server.loading", "Loading Achievements Scripts...");
1762 sAchievementMgr->LoadAchievementScripts();
1763 TC_LOG_INFO("server.loading", "Loading Achievement Rewards...");
1764 sAchievementMgr->LoadRewards();
1765
1767 {
1768 TC_LOG_INFO("server.loading", "Loading Achievement Reward Locales...");
1769 sAchievementMgr->LoadRewardLocales();
1770 }
1771 TC_LOG_INFO("server.loading", "Loading Completed Achievements...");
1772 sAchievementMgr->LoadCompletedAchievements();
1773
1774 // Load before guilds and arena teams
1775 TC_LOG_INFO("server.loading", "Loading character cache store...");
1776 sCharacterCache->LoadCharacterCacheStorage();
1777
1779 TC_LOG_INFO("server.loading", "Loading Auctions...");
1780 sAuctionMgr->LoadAuctions();
1781
1783 {
1784 TC_LOG_INFO("server.loading", "Loading Black Market Templates...");
1785 sBlackMarketMgr->LoadTemplates();
1786
1787 TC_LOG_INFO("server.loading", "Loading Black Market Auctions...");
1788 sBlackMarketMgr->LoadAuctions();
1789 }
1790
1791 TC_LOG_INFO("server.loading", "Loading Guild rewards...");
1792 sGuildMgr->LoadGuildRewards();
1793
1794 TC_LOG_INFO("server.loading", "Loading Guilds...");
1795 sGuildMgr->LoadGuilds();
1796
1797 TC_LOG_INFO("server.loading", "Loading ArenaTeams...");
1798 sArenaTeamMgr->LoadArenaTeams();
1799
1800 TC_LOG_INFO("server.loading", "Loading Groups...");
1801 sGroupMgr->LoadGroups();
1802
1803 TC_LOG_INFO("server.loading", "Loading ReservedNames...");
1804 sObjectMgr->LoadReservedPlayersNames();
1805
1806 TC_LOG_INFO("server.loading", "Loading GameObjects for quests...");
1807 sObjectMgr->LoadGameObjectForQuests();
1808
1809 TC_LOG_INFO("server.loading", "Loading BattleMasters...");
1810 sBattlegroundMgr->LoadBattleMastersEntry(); // must be after load CreatureTemplate
1811
1812 TC_LOG_INFO("server.loading", "Loading GameTeleports...");
1813 sObjectMgr->LoadGameTele();
1814
1815 TC_LOG_INFO("server.loading", "Loading Trainers...");
1816 sObjectMgr->LoadTrainers(); // must be after load CreatureTemplate
1817
1818 TC_LOG_INFO("server.loading", "Loading Gossip menu...");
1819 sObjectMgr->LoadGossipMenu();
1820
1821 TC_LOG_INFO("server.loading", "Loading Gossip menu options...");
1822 sObjectMgr->LoadGossipMenuItems();
1823
1824 TC_LOG_INFO("server.loading", "Loading Gossip menu addon...");
1825 sObjectMgr->LoadGossipMenuAddon();
1826
1827 TC_LOG_INFO("server.loading", "Loading Creature Template Gossip...");
1828 sObjectMgr->LoadCreatureTemplateGossip();
1829
1830 TC_LOG_INFO("server.loading", "Loading Creature trainers...");
1831 sObjectMgr->LoadCreatureTrainers(); // must be after LoadGossipMenuItems
1832
1833 TC_LOG_INFO("server.loading", "Loading Vendors...");
1834 sObjectMgr->LoadVendors(); // must be after load CreatureTemplate and ItemTemplate
1835
1836 TC_LOG_INFO("server.loading", "Loading Waypoint paths...");
1837 sWaypointMgr->LoadPaths();
1838
1839 TC_LOG_INFO("server.loading", "Loading Creature Formations...");
1840 sFormationMgr->LoadCreatureFormations();
1841
1842 TC_LOG_INFO("server.loading", "Loading Persistend World Variables...");
1844
1847
1848 sObjectMgr->LoadPhases();
1849
1850 TC_LOG_INFO("server.loading", "Loading Conditions...");
1851 sConditionMgr->LoadConditions();
1852
1853 TC_LOG_INFO("server.loading", "Loading faction change achievement pairs...");
1854 sObjectMgr->LoadFactionChangeAchievements();
1855
1856 TC_LOG_INFO("server.loading", "Loading faction change spell pairs...");
1857 sObjectMgr->LoadFactionChangeSpells();
1858
1859 TC_LOG_INFO("server.loading", "Loading faction change quest pairs...");
1860 sObjectMgr->LoadFactionChangeQuests();
1861
1862 TC_LOG_INFO("server.loading", "Loading faction change item pairs...");
1863 sObjectMgr->LoadFactionChangeItems();
1864
1865 TC_LOG_INFO("server.loading", "Loading faction change reputation pairs...");
1866 sObjectMgr->LoadFactionChangeReputations();
1867
1868 TC_LOG_INFO("server.loading", "Loading faction change title pairs...");
1869 sObjectMgr->LoadFactionChangeTitles();
1870
1871 TC_LOG_INFO("server.loading", "Loading mount definitions...");
1873
1874 TC_LOG_INFO("server.loading", "Loading warband scene definitions...");
1876
1877 TC_LOG_INFO("server.loading", "Loading GM bugs...");
1878 sSupportMgr->LoadBugTickets();
1879
1880 TC_LOG_INFO("server.loading", "Loading GM complaints...");
1881 sSupportMgr->LoadComplaintTickets();
1882
1883 TC_LOG_INFO("server.loading", "Loading GM suggestions...");
1884 sSupportMgr->LoadSuggestionTickets();
1885
1886 /*TC_LOG_INFO("server.loading", "Loading GM surveys...");
1887 sSupportMgr->LoadSurveys();*/
1888
1889 TC_LOG_INFO("server.loading", "Loading garrison info...");
1890 sGarrisonMgr.Initialize();
1891
1893 TC_LOG_INFO("server.loading", "Returning old mails...");
1894 sObjectMgr->ReturnOrDeleteOldMails(false);
1895
1896 TC_LOG_INFO("server.loading", "Loading Autobroadcasts...");
1898
1900 sObjectMgr->LoadSpellScripts(); // must be after load Creature/Gameobject(Template/Data)
1901 sObjectMgr->LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data)
1902
1903 TC_LOG_INFO("server.loading", "Loading spell script names...");
1904 sObjectMgr->LoadSpellScriptNames();
1905
1906 TC_LOG_INFO("server.loading", "Loading Creature Texts...");
1907 sCreatureTextMgr->LoadCreatureTexts();
1908
1910 {
1911 TC_LOG_INFO("server.loading", "Loading Creature Text Locales...");
1912 sCreatureTextMgr->LoadCreatureTextLocales();
1913 }
1914
1915 TC_LOG_INFO("server.loading", "Loading creature StaticFlags overrides...");
1916 sObjectMgr->LoadCreatureStaticFlagsOverride(); // must be after LoadCreatures
1917
1918 TC_LOG_INFO("server.loading", "Initializing Scripts...");
1919 sScriptMgr->Initialize();
1920 sScriptMgr->OnConfigLoad(false); // must be done after the ScriptMgr has been properly initialized
1921
1922 TC_LOG_INFO("server.loading", "Validating spell scripts...");
1923 sObjectMgr->ValidateSpellScripts();
1924
1925 TC_LOG_INFO("server.loading", "Loading SmartAI scripts...");
1926 sSmartScriptMgr->LoadSmartAIFromDB();
1927
1928 TC_LOG_INFO("server.loading", "Loading Calendar data...");
1929 sCalendarMgr->LoadFromDB();
1930
1931 TC_LOG_INFO("server.loading", "Loading Petitions...");
1932 sPetitionMgr->LoadPetitions();
1933
1934 TC_LOG_INFO("server.loading", "Loading Signatures...");
1935 sPetitionMgr->LoadSignatures();
1936
1937 TC_LOG_INFO("server.loading", "Loading Item loot...");
1938 sLootItemStorage->LoadStorageFromDB();
1939
1940 TC_LOG_INFO("server.loading", "Initialize query data...");
1941 sObjectMgr->InitializeQueriesData(QUERY_DATA_ALL);
1942
1943 TC_LOG_INFO("server.loading", "Initialize commands...");
1945
1947 TC_LOG_INFO("server.loading", "Initialize game time and timers");
1949
1950 LoginDatabase.PExecute("INSERT INTO uptime (realmid, starttime, uptime, revision) VALUES({}, {}, 0, '{}')",
1951 sRealmList->GetCurrentRealmId().Realm, uint32(GameTime::GetStartTime()), GitRevision::GetFullVersion()); // One-time query
1952
1956 //Update "uptime" table based on configuration entry in minutes.
1958 //erase corpses every 20 minutes
1960 // clean logs table every 14 days by default
1962 m_timers[WUPDATE_DELETECHARS].SetInterval(DAY*IN_MILLISECONDS); // check for chars to delete every day
1963
1964 // for AhBot
1966
1968
1970
1972
1974
1975 m_timers[WUPDATE_WHO_LIST].SetInterval(5 * IN_MILLISECONDS); // update who list cache every 5 seconds
1976
1978
1979 //to set mailtimer to return mails every day between 4 and 5 am
1980 //mailtimer is increased when updating auctions
1981 //one second is 1000 -(tested on win system)
1983 tm localTm;
1984 time_t gameTime = GameTime::GetGameTime();
1985 localtime_r(&gameTime, &localTm);
1986 uint8 CleanOldMailsTime = getIntConfig(CONFIG_CLEAN_OLD_MAIL_TIME);
1987 mail_timer = ((((localTm.tm_hour + (24 - CleanOldMailsTime)) % 24)* HOUR * IN_MILLISECONDS) / m_timers[WUPDATE_AUCTIONS].GetInterval());
1988 //1440
1990 TC_LOG_INFO("server.loading", "Mail timer set to: {}, mail return is called every {} minutes", uint64(mail_timer), uint64(mail_timer_expires));
1991
1993 TC_LOG_INFO("server.loading", "Starting Map System");
1994 sMapMgr->Initialize();
1995
1996 TC_LOG_INFO("server.loading", "Starting Game Event system...");
1997 uint32 nextGameEvent = sGameEventMgr->StartSystem();
1998 m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent); //depend on next event
1999
2000 // Delete all characters which have been deleted X days before
2002
2003 TC_LOG_INFO("server.loading", "Initialize AuctionHouseBot...");
2004 sAuctionBot->Initialize();
2005
2006 TC_LOG_INFO("server.loading", "Initializing chat channels...");
2008
2009 TC_LOG_INFO("server.loading", "Initializing Opcodes...");
2013
2014 TC_LOG_INFO("server.loading", "Starting Arena Season...");
2015 sGameEventMgr->StartArenaSeason();
2016
2017 sSupportMgr->Initialize();
2018
2020 TC_LOG_INFO("server.loading", "Starting Battleground System");
2021 sBattlegroundMgr->LoadBattlegroundTemplates();
2022 sBattlegroundMgr->LoadBattlegroundScriptTemplate();
2023
2025 TC_LOG_INFO("server.loading", "Starting Outdoor PvP System");
2026 sOutdoorPvPMgr->InitOutdoorPvP();
2027
2029 TC_LOG_INFO("server.loading", "Starting Battlefield System");
2030 sBattlefieldMgr->InitBattlefield();
2031
2032 TC_LOG_INFO("server.loading", "Deleting expired bans...");
2033 LoginDatabase.Execute("DELETE FROM ip_banned WHERE unbandate <= UNIX_TIMESTAMP() AND unbandate<>bandate"); // One-time query
2034
2035 TC_LOG_INFO("server.loading", "Initializing quest reset times...");
2038
2039 TC_LOG_INFO("server.loading", "Calculate random battleground reset time...");
2041
2042 TC_LOG_INFO("server.loading", "Calculate deletion of old calendar events time...");
2044
2045 TC_LOG_INFO("server.loading", "Calculate guild limitation(s) reset time...");
2047
2048 TC_LOG_INFO("server.loading", "Calculate next currency reset time...");
2050
2051 TC_LOG_INFO("server.loading", "Loading race and class expansion requirements...");
2052 sObjectMgr->LoadRaceAndClassExpansionRequirements();
2053
2054 TC_LOG_INFO("server.loading", "Loading character templates...");
2055 sCharacterTemplateDataStore->LoadCharacterTemplates();
2056
2057 TC_LOG_INFO("server.loading", "Loading battle pets info...");
2059
2060 TC_LOG_INFO("server.loading", "Loading scenarios");
2061 sScenarioMgr->LoadDB2Data();
2062 sScenarioMgr->LoadDBData();
2063
2064 TC_LOG_INFO("server.loading", "Loading scenario poi data");
2065 sScenarioMgr->LoadScenarioPOI();
2066
2067 TC_LOG_INFO("server.loading", "Loading phase names...");
2068 sObjectMgr->LoadPhaseNames();
2069
2070 TC_LOG_INFO("server.loading", "Loading transmog data...");
2072
2073 uint32 startupDuration = GetMSTimeDiffToNow(startupBegin);
2074
2075 TC_LOG_INFO("server.worldserver", "World initialized in {} minutes {} seconds", startupDuration / 60000, startupDuration % 60000 / 1000);
2076
2077 TC_METRIC_EVENT("events", "World initialized", Trinity::StringFormat("World initialized in {} minutes {} seconds", startupDuration / 60000, startupDuration % 60000 / 1000));
2078 return true;
2079}
2080
2082{
2083 WorldStateMgr::SetValueAndSaveInDb(WS_WAR_MODE_HORDE_BUFF_VALUE, 10 + (team == TEAM_ALLIANCE ? reward : 0), false, nullptr);
2084 WorldStateMgr::SetValueAndSaveInDb(WS_WAR_MODE_ALLIANCE_BUFF_VALUE, 10 + (team == TEAM_HORDE ? reward : 0), false, nullptr);
2085}
2086
2091
2093{
2094 uint32 oldMSTime = getMSTime();
2095
2096 m_Autobroadcasts.clear();
2097
2099 stmt->setInt32(0, sRealmList->GetCurrentRealmId().Realm);
2100 PreparedQueryResult result = LoginDatabase.Query(stmt);
2101
2102 if (!result)
2103 {
2104 TC_LOG_INFO("server.loading", ">> Loaded 0 autobroadcasts definitions. DB table `autobroadcast` is empty for this realm!");
2105 return;
2106 }
2107
2108 do
2109 {
2110 Field* fields = result->Fetch();
2111 uint8 id = fields[0].GetUInt8();
2112
2113 m_Autobroadcasts[id] = { .Message = fields[2].GetString(), .Weight = fields[1].GetUInt8() };
2114
2115 } while (result->NextRow());
2116
2117 TC_LOG_INFO("server.loading", ">> Loaded {} autobroadcast definitions in {} ms", m_Autobroadcasts.size(), GetMSTimeDiffToNow(oldMSTime));
2118}
2119
2122{
2123 TC_METRIC_TIMER("world_update_time_total");
2126 time_t currentGameTime = GameTime::GetGameTime();
2127
2129
2131 for (int i = 0; i < WUPDATE_COUNT; ++i)
2132 {
2133 if (m_timers[i].GetCurrent() >= 0)
2134 m_timers[i].Update(diff);
2135 else
2136 m_timers[i].SetCurrent(0);
2137 }
2138
2140 if (m_timers[WUPDATE_WHO_LIST].Passed())
2141 {
2142 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update who list"));
2144 sWhoListStorageMgr->Update();
2145 }
2146
2147 if (IsStopped() || m_timers[WUPDATE_CHANNEL_SAVE].Passed())
2148 {
2150
2152 {
2153 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Save custom channels"));
2155 mgr1->SaveToDB();
2157 if (mgr1 != mgr2)
2158 mgr2->SaveToDB();
2160 if (mgr1 != mgr3)
2161 mgr3->SaveToDB();
2162 }
2163 }
2164
2165 {
2166 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Check daily reset times"));
2168 }
2169
2170 if (currentGameTime > m_NextRandomBGReset)
2171 {
2172 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Reset random BG"));
2173 ResetRandomBG();
2174 }
2175
2176 if (currentGameTime > m_NextCalendarOldEventsDeletionTime)
2177 {
2178 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Delete old calendar events"));
2180 }
2181
2182 if (currentGameTime > m_NextGuildReset)
2183 {
2184 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Reset guild cap"));
2185 ResetGuildCap();
2186 }
2187
2188 if (currentGameTime > m_NextCurrencyReset)
2189 {
2190 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Reset currency weekly cap"));
2192 }
2193
2195 if (m_timers[WUPDATE_AUCTIONS].Passed())
2196 {
2197 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update expired auctions"));
2199
2201 //(tested... works on win)
2203 {
2204 mail_timer = 0;
2205 sObjectMgr->ReturnOrDeleteOldMails(true);
2206 }
2207
2209 sAuctionMgr->Update();
2210 }
2211
2212 if (m_timers[WUPDATE_AUCTIONS_PENDING].Passed())
2213 {
2214 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update pending auctions"));
2216
2217 sAuctionMgr->UpdatePendingAuctions();
2218 }
2219
2220 if (m_timers[WUPDATE_BLACKMARKET].Passed())
2221 {
2222 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update pending black market auctions"));
2224
2226 if ((blackmarket_timer * m_timers[WUPDATE_BLACKMARKET].GetInterval() >=
2229 {
2230 sBlackMarketMgr->RefreshAuctions();
2231 blackmarket_timer = 1; // timer is 0 on startup
2232 }
2233 else
2234 {
2236 sBlackMarketMgr->Update();
2237 }
2238 }
2239
2241 if (m_timers[WUPDATE_AHBOT].Passed())
2242 {
2243 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update AHBot"));
2244 sAuctionBot->Update();
2246 }
2247
2249 sScriptMgr->SyncScripts();
2250
2252 if (m_timers[WUPDATE_CHECK_FILECHANGES].Passed())
2253 {
2254 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update HotSwap"));
2255 sScriptReloadMgr->Update();
2257 }
2258
2259 {
2261 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update sessions"));
2262 UpdateSessions(diff);
2263 }
2264
2266 if (m_timers[WUPDATE_UPTIME].Passed())
2267 {
2268 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update uptime"));
2269 uint32 tmpDiff = GameTime::GetUptime();
2270 uint32 maxOnlinePlayers = GetMaxPlayerCount();
2271
2273
2275
2276 stmt->setUInt32(0, tmpDiff);
2277 stmt->setUInt16(1, uint16(maxOnlinePlayers));
2278 stmt->setUInt32(2, sRealmList->GetCurrentRealmId().Realm);
2280
2281 LoginDatabase.Execute(stmt);
2282 }
2283
2285 if (getIntConfig(CONFIG_LOGDB_CLEARTIME) > 0) // if not enabled, ignore the timer
2286 {
2287 if (m_timers[WUPDATE_CLEANDB].Passed())
2288 {
2289 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Clean logs table"));
2291
2293
2296 stmt->setUInt32(2, sRealmList->GetCurrentRealmId().Realm);
2297
2298 LoginDatabase.Execute(stmt);
2299 }
2300 }
2301
2304 {
2305 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update maps"));
2306 sMapMgr->Update(diff);
2307 }
2308
2309 {
2310 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Terrain data cleanup"));
2311 sTerrainMgr.Update(diff);
2312 }
2313
2315 {
2316 if (m_timers[WUPDATE_AUTOBROADCAST].Passed())
2317 {
2318 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Send autobroadcast"));
2321 }
2322 }
2323
2324 {
2325 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update battlegrounds"));
2326 sBattlegroundMgr->Update(diff);
2327 }
2328
2329 {
2330 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update outdoor pvp"));
2331 sOutdoorPvPMgr->Update(diff);
2332 }
2333
2334 {
2335 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update battlefields"));
2336 sBattlefieldMgr->Update(diff);
2337 }
2338
2340 if (m_timers[WUPDATE_DELETECHARS].Passed())
2341 {
2342 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Delete old characters"));
2345 }
2346
2347 {
2348 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update groups"));
2349 sGroupMgr->Update(diff);
2350 }
2351
2352 {
2353 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update LFG"));
2354 sLFGMgr->Update(diff);
2355 }
2356
2357 {
2358 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Process query callbacks"));
2359 // execute callbacks from sql queries that were queued recently
2361 }
2362
2364 if (m_timers[WUPDATE_CORPSES].Passed())
2365 {
2366 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Remove old corpses"));
2368 sMapMgr->DoForAllMaps([](Map* map)
2369 {
2370 map->RemoveOldCorpses();
2371 });
2372 }
2373
2375 if (m_timers[WUPDATE_EVENTS].Passed())
2376 {
2377 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update game events"));
2378 m_timers[WUPDATE_EVENTS].Reset(); // to give time for Update() to be processed
2379 uint32 nextGameEvent = sGameEventMgr->Update();
2380 m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent);
2382 }
2383
2385 if (m_timers[WUPDATE_PINGDB].Passed())
2386 {
2387 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Ping MySQL"));
2389 TC_LOG_DEBUG("misc", "Ping MySQL to keep connection alive");
2390 CharacterDatabase.KeepAlive();
2391 LoginDatabase.KeepAlive();
2392 WorldDatabase.KeepAlive();
2393 HotfixDatabase.KeepAlive();
2394 }
2395
2396 if (m_timers[WUPDATE_GUILDSAVE].Passed())
2397 {
2398 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Save guilds"));
2400 sGuildMgr->SaveGuilds();
2401 }
2402
2403 // Check for shutdown warning
2404 if (_guidWarn && !_guidAlert)
2405 {
2406 _warnDiff += diff;
2411 }
2412
2414
2415 {
2416 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Process cli commands"));
2417 // And last, but not least handle the issued cli commands
2419 }
2420
2421 {
2422 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update world scripts"));
2423 sScriptMgr->OnWorldUpdate(diff);
2424 }
2425
2426 {
2427 TC_METRIC_TIMER("world_update_time", TC_METRIC_TAG("type", "Update metrics"));
2428 // Stats logger update
2429 sMetric->Update();
2430 TC_METRIC_VALUE("update_time_diff", diff);
2431 }
2432}
2433
2435{
2436 m_timers[WUPDATE_EVENTS].Reset(); // to give time for Update() to be processed
2437 uint32 nextGameEvent = sGameEventMgr->Update();
2438 m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent);
2440}
2441
2444{
2445 SessionMap::const_iterator itr;
2446 for (itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
2447 {
2448 if (itr->second &&
2449 itr->second->GetPlayer() &&
2450 itr->second->GetPlayer()->IsInWorld() &&
2451 itr->second != self &&
2452 (!team || itr->second->GetPlayer()->GetTeam() == team))
2453 {
2454 itr->second->SendPacket(packet);
2455 }
2456 }
2457}
2458
2461{
2462 for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
2463 {
2464 // check if session and can receive global GM Messages and its not self
2465 WorldSession* session = itr->second;
2466 if (!session || session == self || !session->HasPermission(rbac::RBAC_PERM_RECEIVE_GLOBAL_GM_TEXTMESSAGE))
2467 continue;
2468
2469 // Player should be in world
2470 Player* player = session->GetPlayer();
2471 if (!player || !player->IsInWorld())
2472 continue;
2473
2474 // Send only to same team, if team is given
2475 if (!team || player->GetTeam() == team)
2476 session->SendPacket(packet);
2477 }
2478}
2479
2480namespace Trinity
2481{
2483 {
2485 {
2486 public:
2487 void operator()(Player const* receiver) const
2488 {
2489 for (std::unique_ptr<WorldPackets::Packet> const& packet : Packets)
2490 receiver->SendDirectMessage(packet->GetRawPacket());
2491 }
2492
2493 std::vector<std::unique_ptr<WorldPackets::Packet>> Packets;
2494 };
2495
2496 public:
2497 static size_t const BufferSize = 2048;
2498
2499 explicit WorldWorldTextBuilder(uint32 textId, va_list* args = nullptr) : i_textId(textId), i_args(args) { }
2500
2502 {
2503 char const* text = sObjectMgr->GetTrinityString(i_textId, locale);
2504
2505 char strBuffer[BufferSize];
2506 if (i_args)
2507 {
2508 // we need copy va_list before use or original va_list will corrupted
2509 va_list ap;
2510 va_copy(ap, *i_args);
2511 vsnprintf(strBuffer, BufferSize, text, ap);
2512 va_end(ap);
2513 }
2514 else
2515 {
2516 std::strncpy(strBuffer, text, BufferSize);
2517 strBuffer[BufferSize - 1] = '\0';
2518 }
2519
2521 do_helper(sender->Packets, strBuffer);
2522 return sender;
2523 }
2524
2525 private:
2526 void do_helper(std::vector<std::unique_ptr<WorldPackets::Packet>>& dataList, char* text)
2527 {
2528 while (char* line = ChatHandler::LineFromMessage(text))
2529 {
2531 packet->Initialize(CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, line);
2532 packet->Write();
2533 dataList.emplace_back(packet);
2534 }
2535 }
2536
2538 va_list* i_args;
2539 };
2540} // namespace Trinity
2541
2543void World::SendWorldText(uint32 string_id, ...)
2544{
2545 va_list ap;
2546 va_start(ap, string_id);
2547
2548 Trinity::WorldWorldTextBuilder wt_builder(string_id, &ap);
2550 for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
2551 {
2552 if (!itr->second || !itr->second->GetPlayer() || !itr->second->GetPlayer()->IsInWorld())
2553 continue;
2554
2555 wt_do(itr->second->GetPlayer());
2556 }
2557
2558 va_end(ap);
2559}
2560
2562void World::SendGMText(uint32 string_id, ...)
2563{
2564 va_list ap;
2565 va_start(ap, string_id);
2566
2567 Trinity::WorldWorldTextBuilder wt_builder(string_id, &ap);
2569 for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
2570 {
2571 // Session should have permissions to receive global gm messages
2572 WorldSession* session = itr->second;
2574 continue;
2575
2576 // Player should be in world
2577 Player* player = session->GetPlayer();
2578 if (!player || !player->IsInWorld())
2579 continue;
2580
2581 wt_do(player);
2582 }
2583
2584 va_end(ap);
2585}
2586
2588void World::SendGlobalText(char const* text, WorldSession* self)
2589{
2590 // need copy to prevent corruption by strtok call in LineFromMessage original string
2591 char* buf = strdup(text);
2592 char* pos = buf;
2593
2594 while (char* line = ChatHandler::LineFromMessage(pos))
2595 {
2597 packet.Initialize(CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, line);
2598 SendGlobalMessage(packet.Write(), self);
2599 }
2600
2601 free(buf);
2602}
2603
2606{
2607 bool foundPlayerToSend = false;
2608 SessionMap::const_iterator itr;
2609
2610 for (itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
2611 {
2612 if (itr->second &&
2613 itr->second->GetPlayer() &&
2614 itr->second->GetPlayer()->IsInWorld() &&
2615 itr->second->GetPlayer()->GetZoneId() == zone &&
2616 itr->second != self &&
2617 (!team || itr->second->GetPlayer()->GetTeam() == team))
2618 {
2619 itr->second->SendPacket(packet);
2620 foundPlayerToSend = true;
2621 }
2622 }
2623
2624 return foundPlayerToSend;
2625}
2626
2628void World::SendZoneText(uint32 zone, char const* text, WorldSession* self, Optional<Team> team)
2629{
2631 packet.Initialize(CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, text);
2632 SendZoneMessage(zone, packet.Write(), self, team);
2633}
2634
2637{
2638 m_QueuedPlayer.clear(); // prevent send queue update packet and login queued sessions
2639
2640 // session not removed at kick and will removed in next update tick
2641 for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
2642 itr->second->KickPlayer("World::KickAll");
2643}
2644
2647{
2648 // session not removed at kick and will removed in next update tick
2649 for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
2650 if (itr->second->GetSecurity() < sec)
2651 itr->second->KickPlayer("World::KickAllLess");
2652}
2653
2655BanReturn World::BanAccount(BanMode mode, std::string const& nameOrIP, std::string const& duration, std::string const& reason, std::string const& author)
2656{
2657 uint32 duration_secs = TimeStringToSecs(duration);
2658 return BanAccount(mode, nameOrIP, duration_secs, reason, author);
2659}
2660
2662BanReturn World::BanAccount(BanMode mode, std::string const& nameOrIP, uint32 duration_secs, std::string const& reason, std::string const& author)
2663{
2664 PreparedQueryResult resultAccounts = PreparedQueryResult(nullptr); //used for kicking
2665
2666 // Prevent banning an already banned account
2667 if (mode == BAN_ACCOUNT && AccountMgr::IsBannedAccount(nameOrIP))
2668 return BAN_EXISTS;
2669
2671 switch (mode)
2672 {
2673 case BAN_IP:
2674 {
2675 // No SQL injection with prepared statements
2677 stmt->setString(0, nameOrIP);
2678 resultAccounts = LoginDatabase.Query(stmt);
2679 stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_IP_BANNED);
2680 stmt->setString(0, nameOrIP);
2681 stmt->setUInt32(1, duration_secs);
2682 stmt->setString(2, author);
2683 stmt->setString(3, reason);
2684 LoginDatabase.Execute(stmt);
2685 break;
2686 }
2687 case BAN_ACCOUNT:
2688 {
2689 // No SQL injection with prepared statements
2691 stmt->setString(0, nameOrIP);
2692 resultAccounts = LoginDatabase.Query(stmt);
2693 break;
2694 }
2695 case BAN_CHARACTER:
2696 {
2697 // No SQL injection with prepared statements
2699 stmt->setString(0, nameOrIP);
2700 resultAccounts = CharacterDatabase.Query(stmt);
2701 break;
2702 }
2703 default:
2704 return BAN_SYNTAX_ERROR;
2705 }
2706
2707 if (!resultAccounts)
2708 {
2709 if (mode == BAN_IP)
2710 return BAN_SUCCESS; // ip correctly banned but nobody affected (yet)
2711 else
2712 return BAN_NOTFOUND; // Nobody to ban
2713 }
2714
2716 LoginDatabaseTransaction trans = LoginDatabase.BeginTransaction();
2717 do
2718 {
2719 Field* fieldsAccount = resultAccounts->Fetch();
2720 uint32 account = fieldsAccount[0].GetUInt32();
2721
2722 if (mode != BAN_IP)
2723 {
2724 // make sure there is only one active ban
2726 stmt->setUInt32(0, account);
2727 trans->Append(stmt);
2728 // No SQL injection with prepared statements
2729 stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ACCOUNT_BANNED);
2730 stmt->setUInt32(0, account);
2731 stmt->setUInt32(1, duration_secs);
2732 stmt->setString(2, author);
2733 stmt->setString(3, reason);
2734 trans->Append(stmt);
2735 }
2736
2737 if (WorldSession* sess = FindSession(account))
2738 if (std::string(sess->GetPlayerName()) != author)
2739 sess->KickPlayer("World::BanAccount Banning account");
2740 } while (resultAccounts->NextRow());
2741
2742 LoginDatabase.CommitTransaction(trans);
2743
2744 return BAN_SUCCESS;
2745}
2746
2748bool World::RemoveBanAccount(BanMode mode, std::string const& nameOrIP)
2749{
2750 LoginDatabasePreparedStatement* stmt = nullptr;
2751 if (mode == BAN_IP)
2752 {
2753 stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_IP_NOT_BANNED);
2754 stmt->setString(0, nameOrIP);
2755 LoginDatabase.Execute(stmt);
2756 }
2757 else
2758 {
2759 uint32 account = 0;
2760 if (mode == BAN_ACCOUNT)
2761 account = AccountMgr::GetId(nameOrIP);
2762 else if (mode == BAN_CHARACTER)
2763 account = sCharacterCache->GetCharacterAccountIdByName(nameOrIP);
2764
2765 if (!account)
2766 return false;
2767
2768 //NO SQL injection as account is uint32
2769 stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_NOT_BANNED);
2770 stmt->setUInt32(0, account);
2771 LoginDatabase.Execute(stmt);
2772 }
2773 return true;
2774}
2775
2777BanReturn World::BanCharacter(std::string const& name, std::string const& duration, std::string const& reason, std::string const& author)
2778{
2780 ObjectGuid guid;
2781
2782 uint32 duration_secs = TimeStringToSecs(duration);
2783
2785 if (!banned)
2786 {
2787 guid = sCharacterCache->GetCharacterGuidByName(name);
2788 if (guid.IsEmpty())
2789 return BAN_NOTFOUND; // Nobody to ban
2790 }
2791 else
2792 guid = banned->GetGUID();
2793
2794 //Use transaction in order to ensure the order of the queries
2795 CharacterDatabaseTransaction trans = CharacterDatabase.BeginTransaction();
2796 // make sure there is only one active ban
2798 stmt->setUInt64(0, guid.GetCounter());
2799 trans->Append(stmt);
2800
2801 stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_BAN);
2802 stmt->setUInt64(0, guid.GetCounter());
2803 stmt->setInt64(1, duration_secs);
2804 stmt->setString(2, author);
2805 stmt->setString(3, reason);
2806 trans->Append(stmt);
2807 CharacterDatabase.CommitTransaction(trans);
2808
2809 if (banned)
2810 banned->GetSession()->KickPlayer("World::BanCharacter Banning character");
2811
2812 return BAN_SUCCESS;
2813}
2814
2816bool World::RemoveBanCharacter(std::string const& name)
2817{
2819 ObjectGuid guid;
2820
2822 if (!banned)
2823 {
2824 guid = sCharacterCache->GetCharacterGuidByName(name);
2825 if (guid.IsEmpty())
2826 return false; // Nobody to ban
2827 }
2828 else
2829 guid = banned->GetGUID();
2830
2832 stmt->setUInt64(0, guid.GetCounter());
2833 CharacterDatabase.Execute(stmt);
2834 return true;
2835}
2836
2839{
2841 time_t lastGameTime = GameTime::GetGameTime();
2843
2844 uint32 elapsed = uint32(GameTime::GetGameTime() - lastGameTime);
2845
2847 if (!IsStopped() && m_ShutdownTimer > 0 && elapsed > 0)
2848 {
2850 if (m_ShutdownTimer <= elapsed)
2851 {
2853 m_stopEvent = true; // exist code already set
2854 else
2855 m_ShutdownTimer = 1; // minimum timer value to wait idle state
2856 }
2858 else
2859 {
2860 m_ShutdownTimer -= elapsed;
2861
2862 ShutdownMsg();
2863 }
2864 }
2865}
2866
2868void World::ShutdownServ(uint32 time, uint32 options, uint8 exitcode, const std::string& reason)
2869{
2870 // ignore if server shutdown at next tick
2871 if (IsStopped())
2872 return;
2873
2874 m_ShutdownMask = options;
2875 m_ExitCode = exitcode;
2876
2878 if (time == 0)
2879 m_ShutdownTimer = 1;
2881 else
2882 {
2883 m_ShutdownTimer = time;
2884 ShutdownMsg(true, nullptr, reason);
2885 }
2886
2887 sScriptMgr->OnShutdownInitiate(ShutdownExitCode(exitcode), ShutdownMask(options));
2888}
2889
2891void World::ShutdownMsg(bool show, Player* player, const std::string& reason)
2892{
2893 // not show messages for idle shutdown mode
2895 return;
2896
2898 if (show ||
2899 (m_ShutdownTimer < 5* MINUTE && (m_ShutdownTimer % 15) == 0) || // < 5 min; every 15 sec
2900 (m_ShutdownTimer < 15 * MINUTE && (m_ShutdownTimer % MINUTE) == 0) || // < 15 min ; every 1 min
2901 (m_ShutdownTimer < 30 * MINUTE && (m_ShutdownTimer % (5 * MINUTE)) == 0) || // < 30 min ; every 5 min
2902 (m_ShutdownTimer < 12 * HOUR && (m_ShutdownTimer % HOUR) == 0) || // < 12 h ; every 1 h
2903 (m_ShutdownTimer > 12 * HOUR && (m_ShutdownTimer % (12 * HOUR)) == 0)) // > 12 h ; every 12 h
2904 {
2906 if (!reason.empty())
2907 str += " - " + reason;
2908
2910
2911 SendServerMessage(msgid, str, player);
2912 TC_LOG_DEBUG("misc", "Server is {} in {}", (m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown"), str);
2913 }
2914}
2915
2918{
2919 // nothing cancel or too late
2921 return 0;
2922
2924
2925 uint32 oldTimer = m_ShutdownTimer;
2926 m_ShutdownMask = 0;
2927 m_ShutdownTimer = 0;
2928 m_ExitCode = SHUTDOWN_EXIT_CODE; // to default value
2929 SendServerMessage(msgid);
2930
2931 TC_LOG_DEBUG("misc", "Server {} cancelled.", (m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shutdown"));
2932
2933 sScriptMgr->OnShutdownCancel();
2934 return oldTimer;
2935}
2936
2938void World::SendServerMessage(ServerMessageType messageID, std::string_view stringParam /*= {}*/, Player const* player /*= nullptr*/)
2939{
2940 ServerMessagesEntry const* serverMessage = sServerMessagesStore.LookupEntry(messageID);
2941 if (!serverMessage)
2942 return;
2943
2944 WorldPackets::Chat::ChatServerMessage chatServerMessage;
2945 chatServerMessage.MessageID = int32(messageID);
2946 if (strstr(serverMessage->Text[player ? player->GetSession()->GetSessionDbcLocale() : GetDefaultDbcLocale()], "%s"))
2947 chatServerMessage.StringParam = stringParam;
2948
2949 if (player)
2950 player->SendDirectMessage(chatServerMessage.Write());
2951 else
2952 SendGlobalMessage(chatServerMessage.Write());
2953}
2954
2956{
2957 {
2958 TC_METRIC_DETAILED_NO_THRESHOLD_TIMER("world_update_time",
2959 TC_METRIC_TAG("type", "Add sessions"),
2960 TC_METRIC_TAG("parent_type", "Update sessions"));
2962 WorldSession* sess = nullptr;
2963 while (addSessQueue.next(sess))
2964 AddSession_(sess);
2965 }
2966
2967 {
2968 std::pair<std::weak_ptr<WorldSocket>, uint64> linkInfo;
2969 while (_linkSocketQueue.next(linkInfo))
2970 {
2971 WorldSession::ConnectToKey key = { .Raw = linkInfo.second };
2973 }
2974 }
2975
2977 for (SessionMap::iterator itr = m_sessions.begin(), next; itr != m_sessions.end(); itr = next)
2978 {
2979 next = itr;
2980 ++next;
2981
2983 WorldSession* pSession = itr->second;
2984 WorldSessionFilter updater(pSession);
2985
2986 [[maybe_unused]] uint32 currentSessionId = itr->first;
2987 TC_METRIC_DETAILED_TIMER("world_update_sessions_time", TC_METRIC_TAG("account_id", std::to_string(currentSessionId)));
2988
2989 if (!pSession->Update(diff, updater)) // As interval = 0
2990 {
2991 if (!RemoveQueuedPlayer(itr->second) && itr->second && getIntConfig(CONFIG_INTERVAL_DISCONNECT_TOLERANCE))
2992 m_disconnects[itr->second->GetAccountId()] = GameTime::GetGameTime();
2993 RemoveQueuedPlayer(pSession);
2994 m_sessions.erase(itr);
2996 delete pSession;
2997 }
2998 }
2999}
3000
3001// This handles the issued and queued CLI commands
3003{
3004 CliCommandHolder::Print zprint = nullptr;
3005 void* callbackArg = nullptr;
3006 CliCommandHolder* command = nullptr;
3007 while (cliCmdQueue.next(command))
3008 {
3009 TC_LOG_INFO("misc", "CLI command under processing...");
3010 zprint = command->m_print;
3011 callbackArg = command->m_callbackArg;
3012 CliHandler handler(callbackArg, zprint);
3013 handler.ParseCommands(command->m_command);
3014 if (command->m_commandFinished)
3015 command->m_commandFinished(callbackArg, !handler.HasSentErrorMessage());
3016 delete command;
3017 }
3018}
3019
3021{
3022 if (m_Autobroadcasts.empty())
3023 return;
3024
3025 auto itr = Trinity::Containers::SelectRandomWeightedContainerElement(m_Autobroadcasts, [](AutobroadcastContainer::value_type const& pair)
3026 {
3027 return pair.second.Weight;
3028 });
3029
3031
3032 if (abcenter == 0)
3033 SendWorldText(LANG_AUTO_BROADCAST, itr->second.Message.c_str());
3034 else if (abcenter == 1)
3036 else if (abcenter == 2)
3037 {
3038 SendWorldText(LANG_AUTO_BROADCAST, itr->second.Message.c_str());
3040 }
3041
3042 TC_LOG_DEBUG("misc", "AutoBroadcast: '{}'", itr->second.Message);
3043}
3044
3046{
3048 stmt->setUInt32(0, accountId);
3049 _queryProcessor.AddCallback(CharacterDatabase.AsyncQuery(stmt).WithPreparedCallback([this](PreparedQueryResult result)
3050 {
3051 _UpdateRealmCharCount(std::move(result));
3052 }));
3053}
3054
3056{
3057 if (resultCharCount)
3058 {
3059 Field* fields = resultCharCount->Fetch();
3060 uint32 accountId = fields[0].GetUInt32();
3061 uint8 charCount = uint8(fields[1].GetUInt64());
3062
3063 LoginDatabaseTransaction trans = LoginDatabase.BeginTransaction();
3064
3066 stmt->setUInt8(0, charCount);
3067 stmt->setUInt32(1, accountId);
3068 stmt->setUInt32(2, sRealmList->GetCurrentRealmId().Realm);
3069 trans->Append(stmt);
3070
3071 LoginDatabase.CommitTransaction(trans);
3072 }
3073}
3074
3081
3082static time_t GetNextDailyResetTime(time_t t)
3083{
3084 return GetLocalHourTimestamp(t, sWorld->getIntConfig(CONFIG_DAILY_QUEST_RESET_TIME_HOUR), true);
3085}
3086
3088{
3089 // reset all saved quest status
3091 CharacterDatabase.Execute(stmt);
3092
3094 stmt->setUInt32(0, 1);
3095 CharacterDatabase.Execute(stmt);
3096
3097 // reset all quest status in memory
3098 for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
3099 if (Player* player = itr->second->GetPlayer())
3100 player->DailyReset();
3101
3102 // reselect pools
3103 sQuestPoolMgr->ChangeDailyQuests();
3104
3105 // store next reset time
3106 time_t now = GameTime::GetGameTime();
3107 time_t next = GetNextDailyResetTime(now);
3108 ASSERT(now < next);
3109
3110 m_NextDailyQuestReset = next;
3112
3113 TC_LOG_INFO("misc", "Daily quests for all characters have been reset.");
3114}
3115
3116static time_t GetNextWeeklyResetTime(time_t t)
3117{
3118 t = GetNextDailyResetTime(t);
3119 tm time = TimeBreakdown(t);
3120 int wday = time.tm_wday;
3121 int target = sWorld->getIntConfig(CONFIG_WEEKLY_QUEST_RESET_TIME_WDAY);
3122 if (target < wday)
3123 wday -= 7;
3124 t += (DAY * (target - wday));
3125 return t;
3126}
3127
3129{
3130 // reset all saved quest status
3132 CharacterDatabase.Execute(stmt);
3133 // reset all quest status in memory
3134 for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
3135 if (Player* player = itr->second->GetPlayer())
3136 player->ResetWeeklyQuestStatus();
3137
3138 // reselect pools
3139 sQuestPoolMgr->ChangeWeeklyQuests();
3140
3141 // Update faction balance
3143
3144 // store next reset time
3145 time_t now = GameTime::GetGameTime();
3146 time_t next = GetNextWeeklyResetTime(now);
3147 ASSERT(now < next);
3148
3151
3152 TC_LOG_INFO("misc", "Weekly quests for all characters have been reset.");
3153}
3154
3155static time_t GetNextMonthlyResetTime(time_t t)
3156{
3157 t = GetNextDailyResetTime(t);
3158 tm time = TimeBreakdown(t);
3159 if (time.tm_mday == 1)
3160 return t;
3161
3162 time.tm_mday = 1;
3163 time.tm_mon += 1;
3164 return mktime(&time);
3165}
3166
3168{
3169 // reset all saved quest status
3171 CharacterDatabase.Execute(stmt);
3172 // reset all quest status in memory
3173 for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
3174 if (Player* player = itr->second->GetPlayer())
3175 player->ResetMonthlyQuestStatus();
3176
3177 // reselect pools
3178 sQuestPoolMgr->ChangeMonthlyQuests();
3179
3180 // store next reset time
3181 time_t now = GameTime::GetGameTime();
3182 time_t next = GetNextMonthlyResetTime(now);
3183 ASSERT(now < next);
3184
3187
3188 TC_LOG_INFO("misc", "Monthly quests for all characters have been reset.");
3189}
3190
3192{
3193 time_t const now = GameTime::GetGameTime();
3194 if (m_NextDailyQuestReset <= now)
3195 DailyReset();
3196 if (m_NextWeeklyQuestReset <= now)
3198 if (m_NextMonthlyQuestReset <= now)
3200}
3201
3203{
3205 if (!bgtime)
3206 m_NextRandomBGReset = GameTime::GetGameTime(); // game time not yet init
3207
3208 // generate time by config
3209 time_t curTime = GameTime::GetGameTime();
3210 tm localTm;
3211 localtime_r(&curTime, &localTm);
3212 localTm.tm_hour = getIntConfig(CONFIG_RANDOM_BG_RESET_HOUR);
3213 localTm.tm_min = 0;
3214 localTm.tm_sec = 0;
3215
3216 // current day reset time
3217 time_t nextDayResetTime = mktime(&localTm);
3218
3219 // next reset time before current moment
3220 if (curTime >= nextDayResetTime)
3221 nextDayResetTime += DAY;
3222
3223 // normalize reset time
3224 m_NextRandomBGReset = bgtime < curTime ? nextDayResetTime - DAY : nextDayResetTime;
3225
3226 if (!bgtime)
3228}
3229
3231{
3232 time_t now = GameTime::GetGameTime();
3235
3236 // If the reset time saved in the worldstate is before now it means the server was offline when the reset was supposed to occur.
3237 // 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.
3238 if (currentDeletionTime < now)
3239 m_NextCalendarOldEventsDeletionTime = nextDeletionTime - DAY;
3240 else
3241 m_NextCalendarOldEventsDeletionTime = nextDeletionTime;
3242
3243 if (!currentDeletionTime)
3245}
3246
3248{
3250 if (!gtime)
3251 m_NextGuildReset = GameTime::GetGameTime(); // game time not yet init
3252
3253 // generate time by config
3254 time_t curTime = GameTime::GetGameTime();
3255 tm localTm;
3256 localtime_r(&curTime, &localTm);
3257 localTm.tm_hour = getIntConfig(CONFIG_GUILD_RESET_HOUR);
3258 localTm.tm_min = 0;
3259 localTm.tm_sec = 0;
3260
3261 // current day reset time
3262 time_t nextDayResetTime = mktime(&localTm);
3263
3264 // next reset time before current moment
3265 if (curTime >= nextDayResetTime)
3266 nextDayResetTime += DAY;
3267
3268 // normalize reset time
3269 m_NextGuildReset = gtime < curTime ? nextDayResetTime - DAY : nextDayResetTime;
3270
3271 if (!gtime)
3273}
3274
3276{
3278 if (!currencytime)
3279 m_NextCurrencyReset = GameTime::GetGameTime(); // game time not yet init
3280
3281 // generate time by config
3282 time_t curTime = GameTime::GetGameTime();
3283 tm localTm;
3284 localtime_r(&curTime, &localTm);
3285
3286 localTm.tm_wday = getIntConfig(CONFIG_CURRENCY_RESET_DAY);
3287 localTm.tm_hour = getIntConfig(CONFIG_CURRENCY_RESET_HOUR);
3288 localTm.tm_min = 0;
3289 localTm.tm_sec = 0;
3290
3291 // current week reset time
3292 time_t nextWeekResetTime = mktime(&localTm);
3293
3294 // next reset time before current moment
3295 if (curTime >= nextWeekResetTime)
3296 nextWeekResetTime += getIntConfig(CONFIG_CURRENCY_RESET_INTERVAL) * DAY;
3297
3298 // normalize reset time
3299 m_NextCurrencyReset = currencytime < curTime ? nextWeekResetTime - getIntConfig(CONFIG_CURRENCY_RESET_INTERVAL) * DAY : nextWeekResetTime;
3300
3301 if (!currencytime)
3303}
3304
3306{
3307 CharacterDatabase.Execute("UPDATE `character_currency` SET `WeeklyQuantity` = 0");
3308
3309 for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
3310 if (itr->second->GetPlayer())
3311 itr->second->GetPlayer()->ResetCurrencyWeekCap();
3312
3315}
3316
3317void World::ResetEventSeasonalQuests(uint16 event_id, time_t eventStartTime)
3318{
3319 TC_LOG_INFO("misc", "Seasonal quests reset for all characters.");
3320
3322 stmt->setUInt16(0, event_id);
3323 stmt->setInt64(1, eventStartTime);
3324 CharacterDatabase.Execute(stmt);
3325
3326 for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
3327 if (itr->second->GetPlayer())
3328 itr->second->GetPlayer()->ResetSeasonalQuestStatus(event_id, eventStartTime);
3329}
3330
3332{
3333 TC_LOG_INFO("misc", "Random BG status reset for all characters.");
3334
3336 CharacterDatabase.Execute(stmt);
3337
3338 for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
3339 if (itr->second->GetPlayer())
3340 itr->second->GetPlayer()->SetRandomWinner(false);
3341
3344}
3345
3354
3356{
3360 week = week < 7 ? week + 1 : 1;
3361
3362 TC_LOG_INFO("misc", "Guild Daily Cap reset. Week: {}", week == 1);
3364 sGuildMgr->ResetTimes(week == 1);
3365}
3366
3372
3374{
3375 if (QueryResult result = WorldDatabase.Query("SELECT db_version, cache_id FROM version LIMIT 1"))
3376 {
3377 Field* fields = result->Fetch();
3378
3379 m_DBVersion = fields[0].GetString();
3380 // will be overwrite by config values if different and non-0
3382 }
3383
3384 if (m_DBVersion.empty())
3385 m_DBVersion = "Unknown world database.";
3386}
3387
3389{
3390 SessionMap::const_iterator itr;
3391 for (itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
3392 if (itr->second && itr->second->GetPlayer() && itr->second->GetPlayer()->IsInWorld())
3393 {
3394 itr->second->GetPlayer()->UpdateAreaDependentAuras(itr->second->GetPlayer()->GetAreaId());
3395 itr->second->GetPlayer()->UpdateZoneDependentAuras(itr->second->GetPlayer()->GetZoneId());
3396 }
3397}
3398
3400{
3401 for (auto&& sessionForBnet : Trinity::Containers::MapEqualRange(m_sessionsByBnetGuid, battlenetAccountGuid))
3402 if (sessionForBnet.second->GetBattlePetMgr()->HasJournalLock())
3403 return true;
3404
3405 return false;
3406}
3407
3412
3417
3419{
3421 return *value;
3422
3423 return 0;
3424}
3425
3427{
3428 m_worldVariables[var.Id] = value;
3429
3431 stmt->setString(0, var.Id);
3432 stmt->setInt32(1, value);
3433 CharacterDatabase.Execute(stmt);
3434}
3435
3437{
3438 uint32 oldMSTime = getMSTime();
3439
3440 if (QueryResult result = CharacterDatabase.Query("SELECT ID, Value FROM world_variable"))
3441 {
3442 do
3443 {
3444 Field* fields = result->Fetch();
3445 m_worldVariables[fields[0].GetString()] = fields[1].GetInt32();
3446 } while (result->NextRow());
3447 }
3448
3449 TC_LOG_INFO("server.loading", ">> Loaded {} world variables in {} ms", m_worldVariables.size(), GetMSTimeDiffToNow(oldMSTime));
3450}
3451
3456
3458{
3459 // Passive reload, we mark the data as invalidated and next time a permission is checked it will be reloaded
3460 TC_LOG_INFO("rbac", "World::ReloadRBAC()");
3461 for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
3462 if (WorldSession* session = itr->second)
3463 session->InvalidateRBACData();
3464}
3465
3470
3472{
3473 std::array<int64, 2> warModeEnabledFaction = { };
3474
3475 // Search for characters that have war mode enabled and played during the last week
3479 if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
3480 {
3481 do
3482 {
3483 Field* fields = result->Fetch();
3484 uint8 race = fields[0].GetUInt8();
3485 if (ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(race))
3486 {
3487 if (FactionTemplateEntry const* raceFaction = sFactionTemplateStore.AssertEntry(raceEntry->FactionID))
3488 {
3489 if (raceFaction->FactionGroup & FACTION_MASK_ALLIANCE)
3490 warModeEnabledFaction[TEAM_ALLIANCE] += fields[1].GetInt64();
3491 else if (raceFaction->FactionGroup & FACTION_MASK_HORDE)
3492 warModeEnabledFaction[TEAM_HORDE] += fields[1].GetInt64();
3493 }
3494 }
3495
3496 } while (result->NextRow());
3497 }
3498
3499 TeamId dominantFaction = TEAM_ALLIANCE;
3500 int32 outnumberedFactionReward = 0;
3501
3502 if (std::any_of(warModeEnabledFaction.begin(), warModeEnabledFaction.end(), [](int64 val) { return val != 0; }))
3503 {
3504 int64 dominantFactionCount = warModeEnabledFaction[TEAM_ALLIANCE];
3505 if (warModeEnabledFaction[TEAM_ALLIANCE] < warModeEnabledFaction[TEAM_HORDE])
3506 {
3507 dominantFactionCount = warModeEnabledFaction[TEAM_HORDE];
3508 dominantFaction = TEAM_HORDE;
3509 }
3510
3511 double total = warModeEnabledFaction[TEAM_ALLIANCE] + warModeEnabledFaction[TEAM_HORDE];
3512 double pct = dominantFactionCount / total;
3513
3515 outnumberedFactionReward = 20;
3517 outnumberedFactionReward = 10;
3519 outnumberedFactionReward = 5;
3520 }
3521
3522 WorldStateMgr::SetValueAndSaveInDb(WS_WAR_MODE_HORDE_BUFF_VALUE, 10 + (dominantFaction == TEAM_ALLIANCE ? outnumberedFactionReward : 0), false, nullptr);
3523 WorldStateMgr::SetValueAndSaveInDb(WS_WAR_MODE_ALLIANCE_BUFF_VALUE, 10 + (dominantFaction == TEAM_HORDE ? outnumberedFactionReward : 0), false, nullptr);
3524}
3525
3527{
3528 return sRealmList->GetCurrentRealmId().GetAddress();
3529}
3530
3531CliCommandHolder::CliCommandHolder(void* callbackArg, char const* command, Print zprint, CommandFinished commandFinished)
3532 : m_callbackArg(callbackArg), m_command(strdup(command)), m_print(zprint), m_commandFinished(commandFinished)
3533{
3534}
3535
#define sAccountMgr
Definition AccountMgr.h:104
#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:569
@ HousingEnabled
@ TransmogEnabled
@ MAX_LEVEL
Definition DBCEnums.h:45
@ STRONG_MAX_LEVEL
Definition DBCEnums.h:49
@ FACTION_MASK_ALLIANCE
Definition DBCEnums.h:1009
@ FACTION_MASK_HORDE
Definition DBCEnums.h:1010
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:82
#define ASSERT
Definition Errors.h:80
#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:181
#define TC_LOG_ERROR(filterType__, message__,...)
Definition Log.h:190
#define TC_LOG_FATAL(filterType__, message__,...)
Definition Log.h:193
#define TC_LOG_INFO(filterType__, message__,...)
Definition Log.h:184
#define sLog
Definition Log.h:156
#define TC_LOG_WARN(filterType__, message__,...)
Definition Log.h:187
@ 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:1461
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:888
#define MAX_CHARTER_NAME
Definition ObjectMgr.h:891
@ QUERY_DATA_ALL
Definition ObjectMgr.h:956
#define sObjectMgr
Definition ObjectMgr.h:1885
#define MAX_PET_NAME
Definition ObjectMgr.h:890
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:531
constexpr uint64 MAX_MONEY_AMOUNT
Definition Player.h:1044
#define sPoolMgr
Definition PoolMgr.h:179
#define sQuestPoolMgr
Definition QuestPools.h:68
#define sRealmList
Definition RealmList.h:93
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:3082
static time_t GetNextWeeklyResetTime(time_t t)
Definition World.cpp:3116
static time_t GetNextMonthlyResetTime(time_t t)
Definition World.cpp:3155
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:225
void RemoveOldCorpses()
Definition Map.cpp:3902
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:4281
void SendDirectMessage(WorldPacket const *data) const
Definition Player.cpp:6283
WorldSession * GetSession() const
Definition Player.h:2272
Team GetTeam() const
Definition Player.h:2423
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:2487
std::vector< std::unique_ptr< WorldPackets::Packet > > Packets
Definition World.cpp:2493
void do_helper(std::vector< std::unique_ptr< WorldPackets::Packet > > &dataList, char *text)
Definition World.cpp:2526
static size_t const BufferSize
Definition World.cpp:2497
WorldWorldTextBuilder(uint32 textId, va_list *args=nullptr)
Definition World.cpp:2499
MultiplePacketSender * operator()(LocaleConstant locale)
Definition World.cpp:2501
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:555
time_t m_NextWeeklyQuestReset
Definition World.h:862
static PersistentWorldVariable const NextGuildDailyResetTimeVarId
Definition World.h:126
uint32 ShutdownCancel()
Cancel a planned server shutdown.
Definition World.cpp:2917
bool SendZoneMessage(uint32 zone, WorldPacket const *packet, WorldSession *self=nullptr, Optional< Team > team={ })
Send a packet to all players (or players selected team) in the zone (except self if mentioned)
Definition World.cpp:2605
bool RemoveBanCharacter(std::string const &name)
Remove a ban from a character.
Definition World.cpp:2816
void UpdateSessions(uint32 diff)
Definition World.cpp:2955
void InitCurrencyResetTime()
Definition World.cpp:3275
uint32 getIntConfig(WorldIntConfigs index) const
Get a server configuration element (see #WorldConfigs)
Definition World.h:712
LocaleConstant m_defaultDbcLocale
Definition World.h:851
static uint8 m_ExitCode
Definition World.h:819
SessionMap m_sessions
Definition World.h:832
uint32 m_int_configs[INT_CONFIG_VALUE_COUNT]
Definition World.h:844
bool RemoveBanAccount(BanMode mode, std::string const &nameOrIP)
Remove a ban from an account or IP address.
Definition World.cpp:2748
static std::atomic< uint32 > m_worldLoopCounter
Definition World.h:564
uint64 m_int64_configs[INT64_CONFIG_VALUE_COUNT]
Definition World.h:845
void AddSession_(WorldSession *s)
Definition World.cpp:361
void SetForcedWarModeFactionBalanceState(TeamId team, int32 reward=0)
Definition World.cpp:2081
float m_float_configs[FLOAT_CONFIG_VALUE_COUNT]
Definition World.h:847
static PersistentWorldVariable const NextOldCalendarEventDeletionTimeVarId
Definition World.h:129
AccountTypes m_allowedSecurityLevel
Definition World.h:850
time_t blackmarket_timer
Definition World.h:830
void LoadConfigSettings(bool reload=false)
Initialize config values.
Definition World.cpp:565
void _UpdateGameTime()
Update the game time.
Definition World.cpp:2838
static std::atomic< bool > m_stopEvent
Definition World.h:818
std::string m_dataPath
Definition World.h:855
float rate_values[MAX_RATES]
Definition World.h:843
void KickAllLess(AccountTypes sec)
Kick (and save) all players with security level less sec
Definition World.cpp:2646
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:3408
void SetNewCharString(std::string const &str)
Set the string for new characters (first login)
Definition World.h:627
LockedQueue< WorldSession * > addSessQueue
Definition World.h:874
void SendServerMessage(ServerMessageType messageID, std::string_view stringParam={}, Player const *player=nullptr)
Send a server message to the user(s)
Definition World.cpp:2938
void SetPersistentWorldVariable(PersistentWorldVariable const &var, int32 value)
Definition World.cpp:3426
QueryCallbackProcessor _queryProcessor
Definition World.h:894
bool m_bool_configs[BOOL_CONFIG_VALUE_COUNT]
Definition World.h:846
bool SetInitialWorldSettings()
Initialize the World.
Definition World.cpp:1230
void UpdateRealmCharCount(uint32 accountId)
Definition World.cpp:3045
Queue m_QueuedPlayer
Definition World.h:870
void LoadDBAllowedSecurityLevel()
Definition World.cpp:235
static PersistentWorldVariable const CharacterDatabaseCleaningFlagsVarId
Definition World.h:125
std::mutex _guidAlertLock
Definition World.h:899
void LoadDBVersion()
Definition World.cpp:3373
bool HasRecentlyDisconnected(WorldSession *)
Definition World.cpp:434
void AddQueuedPlayer(WorldSession *)
Definition World.cpp:467
void ResetCurrencyWeekCap()
Definition World.cpp:3305
uint32 GetQueuedSessionCount() const
Definition World.h:576
static PersistentWorldVariable const NextCurrencyResetTimeVarId
Definition World.h:122
void UpdateMaxSessionCounters()
Get the number of current active sessions.
Definition World.cpp:3367
uint32 m_CleaningFlags
Definition World.h:823
static PersistentWorldVariable const NextDailyQuestResetTimeVarId
Definition World.h:128
uint32 m_maxActiveSessionCount
Definition World.h:836
void ResetMonthlyQuests()
Definition World.cpp:3167
time_t m_NextDailyQuestReset
Definition World.h:861
void InitCalendarOldEventsDeletionTime()
Definition World.cpp:3230
uint32 m_PlayerCount
Definition World.h:838
void DoGuidAlertRestart()
Definition World.cpp:308
time_t _warnShutdownTime
Definition World.h:904
void TriggerGuidAlert()
Definition World.cpp:289
bool IsFFAPvPRealm() const
Definition World.cpp:3413
time_t m_NextCurrencyReset
Definition World.h:867
void ResetGuildCap()
Definition World.cpp:3355
bool RemoveSession(uint32 id)
Remove a given session.
Definition World.cpp:335
time_t m_NextRandomBGReset
Definition World.h:864
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:2777
int32 GetPersistentWorldVariable(PersistentWorldVariable const &var) const
Definition World.cpp:3418
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:2562
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:2891
static PersistentWorldVariable const NextGuildWeeklyResetTimeVarId
Definition World.h:130
void InitGuildResetTime()
Definition World.cpp:3247
std::string m_DBVersion
Definition World.h:879
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:2655
time_t mail_timer_expires
Definition World.h:829
void InitRandomBGResetTime()
Definition World.cpp:3202
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:833
bool getBoolConfig(WorldBoolConfigs index) const
Get a server configuration element (see #WorldConfigs)
Definition World.h:686
static PersistentWorldVariable const NextBGRandomDailyResetTimeVarId
Definition World.h:124
void ResetWeeklyQuests()
Definition World.cpp:3128
void _UpdateRealmCharCount(PreparedQueryResult resultCharCount)
Definition World.cpp:3055
uint32 GetActiveSessionCount() const
Definition World.h:575
DisconnectMap m_disconnects
Definition World.h:835
time_t m_NextCalendarOldEventsDeletionTime
Definition World.h:865
std::vector< GameRule > _gameRules
Definition World.h:906
void ReloadRBAC()
Definition World.cpp:3457
uint32 m_availableDbcLocaleMask
Definition World.h:852
void DailyReset()
Definition World.cpp:3087
void UpdateWarModeRewardValues()
Definition World.cpp:3471
time_t mail_timer
Definition World.h:828
std::string _guidWarningMsg
Definition World.h:896
void ResetRandomBG()
Definition World.cpp:3331
void SendZoneText(uint32 zone, const char *text, WorldSession *self=nullptr, Optional< Team > team={ })
Send a System Message to all players in the zone (except self if mentioned)
Definition World.cpp:2628
uint32 m_ShutdownMask
Definition World.h:821
void ResetEventSeasonalQuests(uint16 event_id, time_t eventStartTime)
Definition World.cpp:3317
time_t m_NextGuildReset
Definition World.h:866
void SetPlayerSecurityLimit(AccountTypes sec)
Definition World.cpp:241
AutobroadcastContainer m_Autobroadcasts
Definition World.h:887
bool IsClosed() const
Deny clients?
Definition World.cpp:222
uint32 m_ShutdownTimer
Definition World.h:820
void KickAll()
Kick (and save) all players.
Definition World.cpp:2636
uint32 GetPlayerAmountLimit() const
Definition World.h:606
void SendGuidWarning()
Definition World.cpp:316
void AddSession(WorldSession *s)
Definition World.cpp:351
void CheckScheduledResetTimes()
Definition World.cpp:3191
std::string _alertRestartReason
Definition World.h:897
void ForceGameEventUpdate()
Definition World.cpp:2434
static PersistentWorldVariable const NextWeeklyQuestResetTimeVarId
Definition World.h:123
void CalendarDeleteOldEvents()
Definition World.cpp:3346
void ProcessQueryCallbacks()
Definition World.cpp:3452
void RemoveOldCorpses()
Definition World.cpp:3466
static World * instance()
Definition World.cpp:196
uint32 m_MaxPlayerCount
Definition World.h:839
float getFloatConfig(WorldFloatConfigs index) const
Get a server configuration element (see #WorldConfigs)
Definition World.h:699
void AddInstanceSocket(std::weak_ptr< WorldSocket > sock, uint64 connectToKey)
Definition World.cpp:356
LocaleConstant GetDefaultDbcLocale() const
Definition World.h:631
void SendGlobalMessage(WorldPacket const *packet, WorldSession *self=nullptr, Optional< Team > team={ })
Send a packet to all players (except self if mentioned)
Definition World.cpp:2443
uint32 GetActiveAndQueuedSessionCount() const
Definition World.h:574
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:3388
void InitQuestResetTimes()
Definition World.cpp:3075
bool _guidWarn
Definition World.h:901
bool m_isClosed
Definition World.h:825
void DisableForcedWarModeFactionBalanceState()
Definition World.cpp:2087
uint32 GetMaxPlayerCount() const
Definition World.h:582
IntervalTimer m_timers[WUPDATE_COUNT]
Definition World.h:827
bool _guidAlert
Definition World.h:902
std::unordered_map< std::string, int32 > m_worldVariables
Definition World.h:848
void SendGlobalGMMessage(WorldPacket const *packet, WorldSession *self=nullptr, Optional< Team > team={ })
Send a packet to all GMs (except self if mentioned)
Definition World.cpp:2460
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:2588
static bool IsStopped()
Definition World.h:668
time_t m_NextMonthlyQuestReset
Definition World.h:863
std::vector< std::string > _motd
Definition World.h:854
uint32 m_maxQueuedSessionCount
Definition World.h:837
void SendAutoBroadcast()
Definition World.cpp:3020
void Update(uint32 diff)
Update the World !
Definition World.cpp:2121
bool IsBattlePetJournalLockAcquired(ObjectGuid battlenetAccountGuid)
Definition World.cpp:3399
uint32 m_playerLimit
Definition World.h:849
void LoadAutobroadcasts()
Definition World.cpp:2092
void LoadPersistentWorldVariables()
Definition World.cpp:3436
void SetPlayerAmountLimit(uint32 limit)
Active session server limit.
Definition World.h:605
LockedQueue< std::pair< std::weak_ptr< WorldSocket >, uint64 > > _linkSocketQueue
Definition World.h:876
bool m_allowMovement
Definition World.h:853
void SendWorldText(uint32 string_id,...)
Send a System Message to all players (except self if mentioned)
Definition World.cpp:2543
void DoGuidWarningRestart()
Definition World.cpp:299
void ProcessCliCommands()
Definition World.cpp:3002
void SetClosed(bool val)
Close world.
Definition World.cpp:227
uint32 _warnDiff
Definition World.h:903
LockedQueue< CliCommandHolder * > cliCmdQueue
Definition World.h:858
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:2868
void commandFinished(void *, bool)
#define sWorld
Definition World.h:916
ServerMessageType
Definition World.h:50
void LoadWeatherData()
WorldIntConfigs
Definition World.h:236
uint32 GetVirtualRealmAddress()
Definition World.cpp:3526
WorldFloatConfigs
Definition World.h:205
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:370
@ CONFIG_ARENA_START_MATCHMAKER_RATING
Definition World.h:347
@ CONFIG_RESPAWN_RESTARTQUIETTIME
Definition World.h:422
@ CONFIG_ARENA_SEASON_ID
Definition World.h:344
@ CONFIG_CORPSE_DECAY_ELITE
Definition World.h:329
@ CONFIG_MAX_INSTANCES_PER_HOUR
Definition World.h:378
@ CONFIG_GUILD_EVENT_LOG_COUNT
Definition World.h:359
@ CONFIG_ARENA_START_RATING
Definition World.h:345
@ CONFIG_SOCKET_TIMEOUTTIME
Definition World.h:244
@ CONFIG_MAX_OVERSPEED_PINGS
Definition World.h:305
@ CONFIG_NO_GRAY_AGGRO_BELOW
Definition World.h:413
@ CONFIG_CHARDELETE_METHOD
Definition World.h:366
@ CONFIG_SESSION_ADD_DELAY
Definition World.h:245
@ 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:255
@ CONFIG_CLIENTCACHE_VERSION
Definition World.h:357
@ CONFIG_TOLBARAD_BATTLETIME
Definition World.h:389
@ 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:404
@ CONFIG_BG_REWARD_WINNER_CONQUEST_FIRST
Definition World.h:402
@ CONFIG_SKILL_CHANCE_ORANGE
Definition World.h:297
@ CONFIG_GM_CHAT
Definition World.h:286
@ CONFIG_VISIBILITY_NOTIFY_PERIOD_CONTINENT
Definition World.h:430
@ CONFIG_RESPAWN_DYNAMICMODE
Definition World.h:419
@ CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_EVOKER
Definition World.h:260
@ CONFIG_CHATFLOOD_MUTE_TIME
Definition World.h:311
@ CONFIG_STRICT_PET_NAMES
Definition World.h:250
@ CONFIG_CHARACTER_CREATING_DISABLED
Definition World.h:254
@ CONFIG_MIN_PET_NAME
Definition World.h:253
@ CONFIG_LOGDB_CLEARTIME
Definition World.h:356
@ CONFIG_TOLBARAD_PLR_MIN_LVL
Definition World.h:388
@ CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF
Definition World.h:316
@ CONFIG_VISIBILITY_NOTIFY_PERIOD_BATTLEGROUND
Definition World.h:432
@ CONFIG_INTERVAL_CHANGEWEATHER
Definition World.h:241
@ CONFIG_PRESERVE_CUSTOM_CHANNEL_INTERVAL
Definition World.h:375
@ CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION
Definition World.h:374
@ CONFIG_GM_WHISPERING_TO
Definition World.h:287
@ CONFIG_TOLBARAD_RESTART_AFTER_CRASH
Definition World.h:392
@ CONFIG_SKILL_CHANCE_SKINNING_STEPS
Definition World.h:302
@ CONFIG_SKILL_CHANCE_YELLOW
Definition World.h:298
@ CONFIG_RESPAWN_GUIDWARNING_FREQUENCY
Definition World.h:425
@ CONFIG_AUTOBROADCAST_INTERVAL
Definition World.h:371
@ CONFIG_PVP_TOKEN_MAP_TYPE
Definition World.h:350
@ CONFIG_ENABLE_SINFO_LOGIN
Definition World.h:353
@ CONFIG_CHARTER_COST_GUILD
Definition World.h:408
@ CONFIG_CHARDELETE_MIN_LEVEL
Definition World.h:367
@ 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:401
@ CONFIG_START_ALLIED_RACE_LEVEL
Definition World.h:268
@ CONFIG_BLACKMARKET_UPDATE_PERIOD
Definition World.h:428
@ CONFIG_TOLBARAD_BONUSTIME
Definition World.h:390
@ CONFIG_AUCTION_TAINTED_SEARCH_DELAY
Definition World.h:416
@ CONFIG_GAME_TYPE
Definition World.h:246
@ CONFIG_ARENA_RATED_UPDATE_TIMER
Definition World.h:343
@ CONFIG_START_DEMON_HUNTER_PLAYER_LEVEL
Definition World.h:266
@ 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:423
@ CONFIG_PARTY_LEVEL_REQ
Definition World.h:324
@ CONFIG_MIN_LEVEL_STAT_SAVE
Definition World.h:361
@ CONFIG_START_EVOKER_PLAYER_LEVEL
Definition World.h:267
@ CONFIG_BATTLEGROUND_INVITATION_TYPE
Definition World.h:337
@ CONFIG_START_DEATH_KNIGHT_PLAYER_LEVEL
Definition World.h:265
@ CONFIG_MAX_PLAYER_LEVEL
Definition World.h:262
@ CONFIG_MIN_CHARTER_NAME
Definition World.h:252
@ CONFIG_CHAT_CHANNEL_LEVEL_REQ
Definition World.h:319
@ CONFIG_CHARACTERS_PER_ACCOUNT
Definition World.h:256
@ CONFIG_DEATH_SICKNESS_LEVEL
Definition World.h:335
@ CONFIG_CHARTER_COST_ARENA_5v5
Definition World.h:411
@ CONFIG_WINTERGRASP_PLR_MIN_LVL
Definition World.h:382
@ CONFIG_PVP_TOKEN_ID
Definition World.h:351
@ CONFIG_GUILD_RESET_HOUR
Definition World.h:364
@ CONFIG_CURRENCY_RESET_HOUR
Definition World.h:269
@ CONFIG_MAIL_DELIVERY_DELAY
Definition World.h:294
@ CONFIG_WINTERGRASP_BATTLETIME
Definition World.h:383
@ CONFIG_CORPSE_DECAY_MINUSMOB
Definition World.h:334
@ CONFIG_GM_FREEZE_DURATION
Definition World.h:288
@ CONFIG_WINTERGRASP_NOBATTLETIME
Definition World.h:384
@ CONFIG_PVP_TOKEN_COUNT
Definition World.h:352
@ CONFIG_PACKET_SPOOF_BANDURATION
Definition World.h:396
@ CONFIG_SKILL_CHANCE_MINING_STEPS
Definition World.h:301
@ CONFIG_GUILD_BANK_EVENT_LOG_COUNT
Definition World.h:360
@ CONFIG_TRADE_LEVEL_REQ
Definition World.h:325
@ CONFIG_AHBOT_UPDATE_INTERVAL
Definition World.h:406
@ 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:385
@ CONFIG_SOCKET_TIMEOUTTIME_ACTIVE
Definition World.h:426
@ CONFIG_START_PLAYER_LEVEL
Definition World.h:264
@ CONFIG_RESPAWN_GUIDALERTLEVEL
Definition World.h:421
@ 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:239
@ CONFIG_BG_REWARD_WINNER_HONOR_FIRST
Definition World.h:398
@ CONFIG_ARENA_START_PERSONAL_RATING
Definition World.h:346
@ CONFIG_COMPRESSION
Definition World.h:237
@ CONFIG_STRICT_CHARTER_NAMES
Definition World.h:249
@ CONFIG_INTERVAL_SAVE
Definition World.h:238
@ CONFIG_BG_REWARD_LOSER_HONOR_FIRST
Definition World.h:400
@ CONFIG_RESET_SCHEDULE_WEEK_DAY
Definition World.h:274
@ CONFIG_PACKET_SPOOF_POLICY
Definition World.h:394
@ CONFIG_CHATFLOOD_ADDON_MESSAGE_COUNT
Definition World.h:309
@ CONFIG_FEATURE_SYSTEM_CHARACTER_UNDELETE_COOLDOWN
Definition World.h:407
@ CONFIG_CHAT_YELL_LEVEL_REQ
Definition World.h:323
@ CONFIG_BG_REWARD_WINNER_CONQUEST_LAST
Definition World.h:403
@ CONFIG_LFG_OPTIONSMASK
Definition World.h:377
@ CONFIG_GM_LOGIN_STATE
Definition World.h:284
@ CONFIG_GUILD_NEWS_LOG_COUNT
Definition World.h:358
@ CONFIG_CORPSE_DECAY_TRIVIAL
Definition World.h:333
@ CONFIG_AUCTION_LEVEL_REQ
Definition World.h:326
@ CONFIG_TOLBARAD_PLR_MAX
Definition World.h:386
@ CONFIG_REALM_ZONE
Definition World.h:247
@ 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:387
@ CONFIG_CHARACTER_CREATING_EVOKERS_PER_REALM
Definition World.h:258
@ CONFIG_CALENDAR_DELETE_OLD_EVENTS_HOUR
Definition World.h:363
@ CONFIG_GM_VISIBLE_STATE
Definition World.h:285
@ CONFIG_NO_GRAY_AGGRO_ABOVE
Definition World.h:412
@ CONFIG_AUCTION_REPLICATE_DELAY
Definition World.h:414
@ CONFIG_GUILD_SAVE_INTERVAL
Definition World.h:393
@ CONFIG_GROUP_VISIBILITY
Definition World.h:293
@ CONFIG_CREATURE_FAMILY_FLEE_DELAY
Definition World.h:313
@ CONFIG_PACKET_SPOOF_BANMODE
Definition World.h:395
@ CONFIG_CHARDELETE_DEMON_HUNTER_MIN_LEVEL
Definition World.h:369
@ CONFIG_XP_BOOST_DAYMASK
Definition World.h:379
@ CONFIG_MIN_DISCOVERED_SCALED_XP_RATIO
Definition World.h:283
@ CONFIG_MAX_WHO
Definition World.h:348
@ CONFIG_CHARDELETE_KEEP_DAYS
Definition World.h:365
@ CONFIG_TOLBARAD_NOBATTLETIME
Definition World.h:391
@ CONFIG_MAX_RESULTS_LOOKUP_COMMANDS
Definition World.h:372
@ CONFIG_VISIBILITY_NOTIFY_PERIOD_ARENA
Definition World.h:433
@ CONFIG_CREATURE_STOP_FOR_PLAYER
Definition World.h:405
@ CONFIG_INTERVAL_DISCONNECT_TOLERANCE
Definition World.h:242
@ 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:409
@ CONFIG_CHATFLOOD_MESSAGE_DELAY
Definition World.h:308
@ CONFIG_CHARDELETE_DEATH_KNIGHT_MIN_LEVEL
Definition World.h:368
@ CONFIG_DISABLE_BREATHING
Definition World.h:336
@ CONFIG_FACTION_BALANCE_LEVEL_CHECK_DIFF
Definition World.h:429
@ CONFIG_ACC_PASSCHANGESEC
Definition World.h:397
@ CONFIG_STRICT_PLAYER_NAMES
Definition World.h:248
@ CONFIG_LOGDB_CLEARINTERVAL
Definition World.h:355
@ 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:349
@ CONFIG_WEEKLY_QUEST_RESET_TIME_WDAY
Definition World.h:278
@ CONFIG_PERSISTENT_CHARACTER_CLEAN_FLAGS
Definition World.h:376
@ 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:420
@ CONFIG_UPTIME_UPDATE
Definition World.h:296
@ CONFIG_TALENTS_INSPECTING
Definition World.h:417
@ CONFIG_WINTERGRASP_PLR_MAX
Definition World.h:380
@ CONFIG_CHAT_EMOTE_LEVEL_REQ
Definition World.h:321
@ CONFIG_AUCTION_SEARCH_DELAY
Definition World.h:415
@ CONFIG_VISIBILITY_NOTIFY_PERIOD_INSTANCE
Definition World.h:431
@ CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_DEMON_HUNTER
Definition World.h:259
@ CONFIG_PORT_WORLD
Definition World.h:243
@ CONFIG_MIN_DUALSPEC_LEVEL
Definition World.h:263
@ CONFIG_SKILL_GAIN_CRAFTING
Definition World.h:303
@ CONFIG_RANDOM_BG_RESET_HOUR
Definition World.h:362
@ CONFIG_DB_PING_INTERVAL
Definition World.h:373
@ 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:424
@ CONFIG_CHARTER_COST_ARENA_3v3
Definition World.h:410
@ CONFIG_MIN_PLAYER_NAME
Definition World.h:251
@ CONFIG_CHATFLOOD_ADDON_MESSAGE_DELAY
Definition World.h:310
@ CONFIG_SKILL_CHANCE_GREY
Definition World.h:300
@ CONFIG_INTERVAL_MAPUPDATE
Definition World.h:240
@ CONFIG_NUMTHREADS
Definition World.h:354
@ 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:261
@ CONFIG_SKILL_CHANCE_GREEN
Definition World.h:299
@ CONFIG_CHAT_SAY_LEVEL_REQ
Definition World.h:322
@ CONFIG_WINTERGRASP_PLR_MIN
Definition World.h:381
@ CONFIG_BLACKMARKET_MAXAUCTIONS
Definition World.h:427
@ CONFIG_BG_REWARD_WINNER_HONOR_LAST
Definition World.h:399
@ CONFIG_CHARACTERS_PER_REALM
Definition World.h:257
@ CONFIG_RESPAWN_MINCHECKINTERVALMS
Definition World.h:418
@ 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:460
@ RATE_DAMAGE_FALL
Definition World.h:511
@ RATE_CREATURE_DAMAGE_NORMAL
Definition World.h:493
@ RATE_DROP_ITEM_REFERENCED_AMOUNT
Definition World.h:475
@ RATE_POWER_RUNIC_POWER_LOSS
Definition World.h:455
@ RATE_CREATURE_DAMAGE_RAREELITE
Definition World.h:495
@ RATE_POWER_RAGE_INCOME
Definition World.h:449
@ RATE_CREATURE_AGGRO
Definition World.h:507
@ RATE_POWER_RAGE_LOSS
Definition World.h:450
@ RATE_REPUTATION_LOWLEVEL_QUEST
Definition World.h:484
@ RATE_CREATURE_HP_ELITE
Definition World.h:487
@ RATE_DURABILITY_LOSS_BLOCK
Definition World.h:522
@ RATE_DROP_ITEM_RARE
Definition World.h:470
@ RATE_REPUTATION_LOWLEVEL_KILL
Definition World.h:483
@ RATE_XP_KILL
Definition World.h:477
@ RATE_INSTANCE_RESET_TIME
Definition World.h:517
@ RATE_CREATURE_HP_RARE
Definition World.h:490
@ RATE_CREATURE_DAMAGE_ELITE
Definition World.h:494
@ RATE_REST_OFFLINE_IN_WILDERNESS
Definition World.h:510
@ RATE_POWER_ENERGY
Definition World.h:452
@ RATE_CREATURE_SPELLDAMAGE_TRIVIAL
Definition World.h:505
@ RATE_MONEY_MAX_LEVEL_QUEST
Definition World.h:526
@ RATE_CREATURE_SPELLDAMAGE_NORMAL
Definition World.h:500
@ RATE_POWER_MANA
Definition World.h:448
@ RATE_DROP_ITEM_LEGENDARY
Definition World.h:472
@ RATE_DURABILITY_LOSS_PARRY
Definition World.h:520
@ RATE_DROP_ITEM_POOR
Definition World.h:467
@ RATE_REST_OFFLINE_IN_TAVERN_OR_CITY
Definition World.h:509
@ RATE_AUCTION_DEPOSIT
Definition World.h:513
@ RATE_DROP_ITEM_UNCOMMON
Definition World.h:469
@ RATE_DROP_ITEM_REFERENCED
Definition World.h:474
@ RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS
Definition World.h:485
@ RATE_REPAIRCOST
Definition World.h:481
@ RATE_CREATURE_SPELLDAMAGE_RAREELITE
Definition World.h:502
@ RATE_DROP_MONEY
Definition World.h:476
@ RATE_DURABILITY_LOSS_DAMAGE
Definition World.h:519
@ RATE_MONEY_QUEST
Definition World.h:525
@ RATE_AUCTION_CUT
Definition World.h:514
@ RATE_HEALTH
Definition World.h:447
@ RATE_MOVESPEED
Definition World.h:523
@ RATE_DURABILITY_LOSS_ON_DEATH
Definition World.h:518
@ RATE_XP_QUEST
Definition World.h:479
@ RATE_XP_BOOST
Definition World.h:524
@ RATE_DROP_ITEM_EPIC
Definition World.h:471
@ RATE_CREATURE_HP_OBSOLETE
Definition World.h:489
@ RATE_SKILL_DISCOVERY
Definition World.h:466
@ RATE_POWER_MAELSTROM
Definition World.h:459
@ RATE_DROP_ITEM_ARTIFACT
Definition World.h:473
@ RATE_CREATURE_DAMAGE_OBSOLETE
Definition World.h:496
@ RATE_CREATURE_DAMAGE_MINUSMOB
Definition World.h:499
@ RATE_XP_EXPLORE
Definition World.h:480
@ RATE_POWER_INSANITY
Definition World.h:461
@ RATE_POWER_FURY
Definition World.h:463
@ RATE_REPUTATION_GAIN
Definition World.h:482
@ RATE_REST_INGAME
Definition World.h:508
@ RATE_POWER_RUNIC_POWER_INCOME
Definition World.h:454
@ RATE_POWER_FOCUS
Definition World.h:451
@ RATE_XP_BG_KILL
Definition World.h:478
@ RATE_CREATURE_HP_NORMAL
Definition World.h:486
@ RATE_POWER_ARCANE_CHARGES
Definition World.h:462
@ RATE_CREATURE_HP_MINUSMOB
Definition World.h:492
@ RATE_HONOR
Definition World.h:515
@ RATE_POWER_HOLY_POWER
Definition World.h:458
@ RATE_POWER_LUNAR_POWER
Definition World.h:457
@ RATE_CREATURE_HP_TRIVIAL
Definition World.h:491
@ RATE_CORPSE_DECAY_LOOTED
Definition World.h:516
@ RATE_DURABILITY_LOSS_ABSORB
Definition World.h:521
@ RATE_AUCTION_TIME
Definition World.h:512
@ RATE_CREATURE_DAMAGE_RARE
Definition World.h:497
@ RATE_CREATURE_DAMAGE_TRIVIAL
Definition World.h:498
@ RATE_CREATURE_SPELLDAMAGE_ELITE
Definition World.h:501
@ RATE_POWER_ESSENCE
Definition World.h:465
@ RATE_CREATURE_SPELLDAMAGE_MINUSMOB
Definition World.h:506
@ RATE_DROP_ITEM_NORMAL
Definition World.h:468
@ RATE_POWER_SOUL_SHARDS
Definition World.h:456
@ RATE_CREATURE_HP_RAREELITE
Definition World.h:488
@ RATE_CREATURE_SPELLDAMAGE_OBSOLETE
Definition World.h:503
@ RATE_CREATURE_SPELLDAMAGE_RARE
Definition World.h:504
@ RATE_POWER_PAIN
Definition World.h:464
@ RATE_POWER_COMBO_POINTS_LOSS
Definition World.h:453
@ CONFIG_STATS_LIMITS_DODGE
Definition World.h:215
@ CONFIG_RESPAWN_DYNAMICRATE_CREATURE
Definition World.h:223
@ CONFIG_SIGHT_MONSTER
Definition World.h:208
@ CONFIG_ARENA_WIN_RATING_MODIFIER_1
Definition World.h:219
@ CONFIG_GROUP_XP_DISTANCE
Definition World.h:206
@ CONFIG_CALL_TO_ARMS_20_PCT
Definition World.h:227
@ CONFIG_MAX_VISIBILITY_DISTANCE_ARENA
Definition World.h:231
@ CONFIG_LISTEN_RANGE_YELL
Definition World.h:211
@ CONFIG_STATS_LIMITS_PARRY
Definition World.h:216
@ CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS
Definition World.h:212
@ CONFIG_ARENA_WIN_RATING_MODIFIER_2
Definition World.h:220
@ CONFIG_ARENA_LOSE_RATING_MODIFIER
Definition World.h:221
@ CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS
Definition World.h:213
@ CONFIG_LISTEN_RANGE_SAY
Definition World.h:209
@ CONFIG_MAX_VISIBILITY_DISTANCE_INSTANCE
Definition World.h:229
@ CONFIG_MAX_VISIBILITY_DISTANCE_BATTLEGROUND
Definition World.h:230
@ CONFIG_THREAT_RADIUS
Definition World.h:214
@ CONFIG_MAX_VISIBILITY_DISTANCE_CONTINENT
Definition World.h:228
@ CONFIG_MAX_RECRUIT_A_FRIEND_DISTANCE
Definition World.h:207
@ CONFIG_ARENA_MATCHMAKER_RATING_MODIFIER
Definition World.h:222
@ CONFIG_CALL_TO_ARMS_5_PCT
Definition World.h:225
@ CONFIG_RESPAWN_DYNAMICRATE_GAMEOBJECT
Definition World.h:224
@ CONFIG_CALL_TO_ARMS_10_PCT
Definition World.h:226
@ CONFIG_STATS_LIMITS_CRIT
Definition World.h:218
@ CONFIG_LISTEN_RANGE_TEXTEMOTE
Definition World.h:210
@ CONFIG_STATS_LIMITS_BLOCK
Definition World.h:217
@ 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:199
@ 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:197
@ 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_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:198
@ 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:200
@ 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_CHARACTER_CREATING_DISABLED_RACEMASK
Definition World.h:439
@ CONFIG_START_PLAYER_MONEY
Definition World.h:440
@ 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:534
CommandFinished m_commandFinished
Definition World.h:541
void * m_callbackArg
Definition World.h:538
CliCommandHolder(void *callbackArg, char const *command, Print zprint, CommandFinished commandFinished)
Definition World.cpp:3531
Print m_print
Definition World.h:540
void(*)(void *, std::string_view) Print
Definition World.h:535
char * m_command
Definition World.h:539
void(*)(void *, bool success) CommandFinished
Definition World.h:536
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::@318 Fields