mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Player: Don't allow to join bg/lfg when frozen by a GM
This commit is contained in:
@@ -410,6 +410,8 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const
|
||||
joinData.result = LFG_JOIN_RANDOM_COOLDOWN;
|
||||
else if (dungeons.empty())
|
||||
joinData.result = LFG_JOIN_NOT_MEET_REQS;
|
||||
else if (player->HasAura(9454)) // check Freeze debuff
|
||||
joinData.result = LFG_JOIN_NOT_MEET_REQS;
|
||||
else if (grp)
|
||||
{
|
||||
if (grp->GetMembersCount() > MAXGROUPSIZE)
|
||||
@@ -429,6 +431,8 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const
|
||||
joinData.result = LFG_JOIN_PARTY_RANDOM_COOLDOWN;
|
||||
else if (plrg->InBattleground() || plrg->InArena() || plrg->InBattlegroundQueue())
|
||||
joinData.result = LFG_JOIN_USING_BG_SYSTEM;
|
||||
else if (plrg->HasAura(9454)) // check Freeze debuff
|
||||
joinData.result = LFG_JOIN_PARTY_NOT_MEET_REQS;
|
||||
++memberCount;
|
||||
players.insert(plrg->GetGUID());
|
||||
}
|
||||
@@ -1281,6 +1285,8 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*
|
||||
error = LFG_TELEPORTERROR_IN_VEHICLE;
|
||||
else if (player->GetCharmGUID())
|
||||
error = LFG_TELEPORTERROR_CHARMING;
|
||||
else if (player->HasAura(9454)) // check Freeze debuff
|
||||
error = LFG_TELEPORTERROR_INVALID_LOCATION;
|
||||
else if (player->GetMapId() != uint32(dungeon->map)) // Do not teleport players in dungeon to the entrance
|
||||
{
|
||||
uint32 mapid = dungeon->map;
|
||||
|
||||
@@ -1857,6 +1857,9 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const*
|
||||
// check if someone in party is using dungeon system
|
||||
if (member->isUsingLfg())
|
||||
return ERR_LFG_CANT_USE_BATTLEGROUND;
|
||||
// check Freeze debuff
|
||||
if (member->HasAura(9454))
|
||||
return ERR_BATTLEGROUND_JOIN_FAILED;
|
||||
}
|
||||
|
||||
// only check for MinPlayerCount since MinPlayerCount == MaxPlayerCount for arenas...
|
||||
|
||||
@@ -178,6 +178,10 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recvData)
|
||||
return;
|
||||
}
|
||||
|
||||
// check Freeze debuff
|
||||
if (_player->HasAura(9454))
|
||||
return;
|
||||
|
||||
BattlegroundQueue& bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId);
|
||||
|
||||
GroupQueueInfo* ginfo = bgQueue.AddGroup(_player, NULL, bgTypeId, bracketEntry, 0, false, isPremade, 0, 0);
|
||||
@@ -434,6 +438,10 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData)
|
||||
WorldPacket data;
|
||||
if (action)
|
||||
{
|
||||
// check Freeze debuff
|
||||
if (_player->HasAura(9454))
|
||||
return;
|
||||
|
||||
if (!_player->IsInvitedForBattlegroundQueueType(bgQueueTypeId))
|
||||
return; // cheating?
|
||||
|
||||
|
||||
Reference in New Issue
Block a user