feat(Core/LFG): Option to disable deserter (#19618)

* feat(Core/LFG): Option to disable deserter

* closes https://github.com/azerothcore/azerothcore-wotlk/issues/19569

* Update IWorld.h
This commit is contained in:
Kitzunu
2024-08-14 14:19:56 +02:00
committed by GitHub
parent db148bec25
commit 030716421f
4 changed files with 15 additions and 2 deletions

View File

@@ -3285,6 +3285,15 @@ LFG.KickPreventionTimer = 900
DungeonAccessRequirements.LFGLevelDBCOverride = 0
#
# DungeonFinder.CastDeserter
#
# Description: Cast Deserter to player who leave a dungeon prematurely
# Default: 1 - (Enabled, Blizzlike)
# 0 - (Disabled)
DungeonFinder.CastDeserter = 1
#
###################################################################################################

View File

@@ -246,7 +246,8 @@ namespace lfg
{
// xinef: fixed dungeon deserter
if (method != GROUP_REMOVEMETHOD_KICK_LFG && state != LFG_STATE_FINISHED_DUNGEON &&
player->HasAura(LFG_SPELL_DUNGEON_COOLDOWN) && players >= LFG_GROUP_KICK_VOTES_NEEDED)
player->HasAura(LFG_SPELL_DUNGEON_COOLDOWN) && players >= LFG_GROUP_KICK_VOTES_NEEDED &&
sWorld->getBoolConfig(CONFIG_LFG_CAST_DESERTER))
{
player->AddAura(LFG_SPELL_DUNGEON_DESERTER, player);
}

View File

@@ -139,6 +139,7 @@ enum WorldBoolConfigs
CONFIG_AUTOBROADCAST,
CONFIG_ALLOW_TICKETS,
CONFIG_DELETE_CHARACTER_TICKET_TRACE,
CONFIG_LFG_CAST_DESERTER,
CONFIG_DBC_ENFORCE_ITEM_ATTRIBUTES,
CONFIG_PRESERVE_CUSTOM_CHANNELS,
CONFIG_PDUMP_NO_PATHS,

View File

@@ -1362,7 +1362,9 @@ void World::LoadConfigSettings(bool reload)
_int_configs[CONFIG_WARDEN_CLIENT_RESPONSE_DELAY] = sConfigMgr->GetOption<int32>("Warden.ClientResponseDelay", 600);
// Dungeon finder
_int_configs[CONFIG_LFG_OPTIONSMASK] = sConfigMgr->GetOption<int32>("DungeonFinder.OptionsMask", 5);
_int_configs[CONFIG_LFG_OPTIONSMASK] = sConfigMgr->GetOption<int32>("DungeonFinder.OptionsMask", 5);
_bool_configs[CONFIG_LFG_CAST_DESERTER] = sConfigMgr->GetOption<int32>("DungeonFinder.CastDeserter", true);
// DBC_ItemAttributes
_bool_configs[CONFIG_DBC_ENFORCE_ITEM_ATTRIBUTES] = sConfigMgr->GetOption<bool>("DBC.EnforceItemAttributes", true);