mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 01:08:35 +00:00
feat(Core/LFG): move the LFG max kick count & kick prevention timers … (#8683)
This commit is contained in:
@@ -17,12 +17,12 @@
|
||||
|
||||
#include "LFG.h"
|
||||
#include "LFGGroupData.h"
|
||||
#include "World.h"
|
||||
|
||||
namespace lfg
|
||||
{
|
||||
|
||||
LfgGroupData::LfgGroupData(): m_State(LFG_STATE_NONE), m_OldState(LFG_STATE_NONE),
|
||||
m_Dungeon(0), m_KicksLeft(LFG_GROUP_MAX_KICKS)
|
||||
m_Dungeon(0), m_KicksLeft(sWorld->getIntConfig(CONFIG_LFG_MAX_KICK_COUNT))
|
||||
{ }
|
||||
|
||||
LfgGroupData::~LfgGroupData()
|
||||
@@ -39,7 +39,7 @@ namespace lfg
|
||||
{
|
||||
case LFG_STATE_NONE:
|
||||
m_Dungeon = 0;
|
||||
m_KicksLeft = LFG_GROUP_MAX_KICKS;
|
||||
m_KicksLeft = sWorld->getIntConfig(CONFIG_LFG_MAX_KICK_COUNT);
|
||||
[[fallthrough]];
|
||||
case LFG_STATE_FINISHED_DUNGEON:
|
||||
case LFG_STATE_DUNGEON:
|
||||
|
||||
@@ -22,12 +22,6 @@
|
||||
|
||||
namespace lfg
|
||||
{
|
||||
|
||||
enum LfgGroupEnum
|
||||
{
|
||||
LFG_GROUP_MAX_KICKS = 2,
|
||||
};
|
||||
|
||||
/**
|
||||
Stores all lfg data needed about a group.
|
||||
*/
|
||||
|
||||
@@ -12183,9 +12183,13 @@ PartyResult Player::CanUninviteFromGroup(ObjectGuid targetPlayerGUID) const
|
||||
|
||||
if (Player* target = ObjectAccessor::FindConnectedPlayer(targetPlayerGUID))
|
||||
{
|
||||
if (target->HasAura(lfg::LFG_SPELL_DUNGEON_COOLDOWN))
|
||||
if (Aura* dungeonCooldownAura = target->GetAura(lfg::LFG_SPELL_DUNGEON_COOLDOWN))
|
||||
{
|
||||
return ERR_PARTY_LFG_BOOT_NOT_ELIGIBLE_S;
|
||||
int32 elapsedTime = dungeonCooldownAura->GetMaxDuration() - dungeonCooldownAura->GetDuration();
|
||||
if (static_cast<int32>(sWorld->getIntConfig(CONFIG_LFG_KICK_PREVENTION_TIMER)) > elapsedTime)
|
||||
{
|
||||
return ERR_PARTY_LFG_BOOT_NOT_ELIGIBLE_S;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -340,7 +340,11 @@ void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket& recvData)
|
||||
{
|
||||
if (Aura* dungeonCooldownAura = kickTarget->GetAura(lfg::LFG_SPELL_DUNGEON_COOLDOWN))
|
||||
{
|
||||
SendPartyResult(PARTY_OP_UNINVITE, name, res, dungeonCooldownAura->GetDuration() / 1000);
|
||||
int32 elapsedTime = dungeonCooldownAura->GetMaxDuration() - dungeonCooldownAura->GetDuration();
|
||||
if (static_cast<int32>(sWorld->getIntConfig(CONFIG_LFG_KICK_PREVENTION_TIMER)) > elapsedTime)
|
||||
{
|
||||
SendPartyResult(PARTY_OP_UNINVITE, name, res, (sWorld->getIntConfig(CONFIG_LFG_KICK_PREVENTION_TIMER) - elapsedTime) / 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else
|
||||
|
||||
@@ -390,6 +390,8 @@ enum WorldIntConfigs
|
||||
CONFIG_NPC_REGEN_TIME_IF_NOT_REACHABLE_IN_RAID,
|
||||
CONFIG_FFA_PVP_TIMER,
|
||||
CONFIG_LOOT_NEED_BEFORE_GREED_ILVL_RESTRICTION,
|
||||
CONFIG_LFG_MAX_KICK_COUNT,
|
||||
CONFIG_LFG_KICK_PREVENTION_TIMER,
|
||||
INT_CONFIG_VALUE_COUNT
|
||||
};
|
||||
|
||||
|
||||
@@ -1419,6 +1419,21 @@ void World::LoadConfigSettings(bool reload)
|
||||
// Specifies if IP addresses can be logged to the database
|
||||
m_bool_configs[CONFIG_ALLOW_LOGGING_IP_ADDRESSES_IN_DATABASE] = sConfigMgr->GetOption<bool>("AllowLoggingIPAddressesInDatabase", true, true);
|
||||
|
||||
// LFG group mechanics.
|
||||
m_int_configs[CONFIG_LFG_MAX_KICK_COUNT] = sConfigMgr->GetOption<int32>("LFG.MaxKickCount", 2);
|
||||
if (m_int_configs[CONFIG_LFG_MAX_KICK_COUNT] > 3)
|
||||
{
|
||||
m_int_configs[CONFIG_LFG_MAX_KICK_COUNT] = 3;
|
||||
LOG_ERROR("server.loading", "LFG.MaxKickCount can't be higher than 3.");
|
||||
}
|
||||
|
||||
m_int_configs[CONFIG_LFG_KICK_PREVENTION_TIMER] = sConfigMgr->GetOption<int32>("LFG.KickPreventionTimer", 15 * MINUTE * IN_MILLISECONDS) * IN_MILLISECONDS;
|
||||
if (m_int_configs[CONFIG_LFG_KICK_PREVENTION_TIMER] > 15 * MINUTE * IN_MILLISECONDS)
|
||||
{
|
||||
m_int_configs[CONFIG_LFG_KICK_PREVENTION_TIMER] = 15 * MINUTE * IN_MILLISECONDS;
|
||||
LOG_ERROR("server.loading", "LFG.KickPreventionTimer can't be higher than 15 minutes.");
|
||||
}
|
||||
|
||||
// call ScriptMgr if we're reloading the configuration
|
||||
sScriptMgr->OnAfterConfigLoad(reload);
|
||||
}
|
||||
|
||||
@@ -3570,6 +3570,22 @@ FFAPvPTimer = 30
|
||||
|
||||
LootNeedBeforeGreedILvlRestriction = 70
|
||||
|
||||
#
|
||||
# LFG.MaxKickCount
|
||||
# Description: Specify the maximum number of kicks allowed in LFG groups (max 3 kicks)
|
||||
# Default: 2
|
||||
# 0 - Disabled (kicks are never allowed)
|
||||
|
||||
LFG.MaxKickCount = 2
|
||||
|
||||
#
|
||||
# LFG.KickPreventionTimer
|
||||
# Description: Specify for how long players are prevented from being kicked after just joining LFG groups
|
||||
# Default: 900 secs (15 minutes)
|
||||
# 0 - Disabled
|
||||
|
||||
LFG.KickPreventionTimer = 900
|
||||
|
||||
#
|
||||
###################################################################################################
|
||||
|
||||
|
||||
Reference in New Issue
Block a user