fix(Core/LFG): implement ERR_PARTY_LFG_BOOT_NOT_ELIGIBLE_S and lower … (#8243)
This commit is contained in:
@@ -25,7 +25,7 @@ namespace lfg
|
|||||||
|
|
||||||
enum LfgGroupEnum
|
enum LfgGroupEnum
|
||||||
{
|
{
|
||||||
LFG_GROUP_MAX_KICKS = 3,
|
LFG_GROUP_MAX_KICKS = 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -12127,7 +12127,7 @@ Player* Player::GetNextRandomRaidMember(float radius)
|
|||||||
return nearMembers[randTarget];
|
return nearMembers[randTarget];
|
||||||
}
|
}
|
||||||
|
|
||||||
PartyResult Player::CanUninviteFromGroup() const
|
PartyResult Player::CanUninviteFromGroup(ObjectGuid targetPlayerGUID) const
|
||||||
{
|
{
|
||||||
Group const* grp = GetGroup();
|
Group const* grp = GetGroup();
|
||||||
if (!grp)
|
if (!grp)
|
||||||
@@ -12157,9 +12157,16 @@ PartyResult Player::CanUninviteFromGroup() const
|
|||||||
if (itr->GetSource() && itr->GetSource()->IsInMap(this) && itr->GetSource()->IsInCombat())
|
if (itr->GetSource() && itr->GetSource()->IsInMap(this) && itr->GetSource()->IsInCombat())
|
||||||
return ERR_PARTY_LFG_BOOT_IN_COMBAT;
|
return ERR_PARTY_LFG_BOOT_IN_COMBAT;
|
||||||
|
|
||||||
|
if (Player* target = ObjectAccessor::FindConnectedPlayer(targetPlayerGUID))
|
||||||
|
{
|
||||||
|
if (target->HasAura(lfg::LFG_SPELL_DUNGEON_COOLDOWN))
|
||||||
|
{
|
||||||
|
return ERR_PARTY_LFG_BOOT_NOT_ELIGIBLE_S;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Missing support for these types
|
/* Missing support for these types
|
||||||
return ERR_PARTY_LFG_BOOT_COOLDOWN_S;
|
return ERR_PARTY_LFG_BOOT_COOLDOWN_S;
|
||||||
return ERR_PARTY_LFG_BOOT_NOT_ELIGIBLE_S;
|
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -2431,7 +2431,7 @@ public:
|
|||||||
[[nodiscard]] uint64 GetAuraUpdateMaskForRaid() const { return m_auraRaidUpdateMask; }
|
[[nodiscard]] uint64 GetAuraUpdateMaskForRaid() const { return m_auraRaidUpdateMask; }
|
||||||
void SetAuraUpdateMaskForRaid(uint8 slot) { m_auraRaidUpdateMask |= (uint64(1) << slot); }
|
void SetAuraUpdateMaskForRaid(uint8 slot) { m_auraRaidUpdateMask |= (uint64(1) << slot); }
|
||||||
Player* GetNextRandomRaidMember(float radius);
|
Player* GetNextRandomRaidMember(float radius);
|
||||||
[[nodiscard]] PartyResult CanUninviteFromGroup() const;
|
[[nodiscard]] PartyResult CanUninviteFromGroup(ObjectGuid targetPlayerGUID = ObjectGuid::Empty) const;
|
||||||
|
|
||||||
// Battleground Group System
|
// Battleground Group System
|
||||||
void SetBattlegroundOrBattlefieldRaid(Group* group, int8 subgroup = -1);
|
void SetBattlegroundOrBattlefieldRaid(Group* group, int8 subgroup = -1);
|
||||||
|
|||||||
@@ -331,10 +331,23 @@ void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket& recvData)
|
|||||||
// Xinef: name is properly filled in packets
|
// Xinef: name is properly filled in packets
|
||||||
sObjectMgr->GetPlayerNameByGUID(guid.GetCounter(), name);
|
sObjectMgr->GetPlayerNameByGUID(guid.GetCounter(), name);
|
||||||
|
|
||||||
PartyResult res = GetPlayer()->CanUninviteFromGroup();
|
PartyResult res = GetPlayer()->CanUninviteFromGroup(guid);
|
||||||
if (res != ERR_PARTY_RESULT_OK)
|
if (res != ERR_PARTY_RESULT_OK)
|
||||||
|
{
|
||||||
|
if (res == ERR_PARTY_LFG_BOOT_NOT_ELIGIBLE_S)
|
||||||
|
{
|
||||||
|
if (Player* kickTarget = ObjectAccessor::FindConnectedPlayer(guid))
|
||||||
|
{
|
||||||
|
if (Aura* dungeonCooldownAura = kickTarget->GetAura(lfg::LFG_SPELL_DUNGEON_COOLDOWN))
|
||||||
|
{
|
||||||
|
SendPartyResult(PARTY_OP_UNINVITE, name, res, dungeonCooldownAura->GetDuration() / 1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else
|
||||||
{
|
{
|
||||||
SendPartyResult(PARTY_OP_UNINVITE, name, res);
|
SendPartyResult(PARTY_OP_UNINVITE, name, res);
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -389,17 +402,19 @@ void WorldSession::HandleGroupUninviteOpcode(WorldPacket& recvData)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PartyResult res = GetPlayer()->CanUninviteFromGroup();
|
Group* grp = GetPlayer()->GetGroup();
|
||||||
|
if (!grp)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
PartyResult res = GetPlayer()->CanUninviteFromGroup(grp->GetMemberGUID(membername));
|
||||||
if (res != ERR_PARTY_RESULT_OK)
|
if (res != ERR_PARTY_RESULT_OK)
|
||||||
{
|
{
|
||||||
SendPartyResult(PARTY_OP_UNINVITE, "", res);
|
SendPartyResult(PARTY_OP_UNINVITE, "", res);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Group* grp = GetPlayer()->GetGroup();
|
|
||||||
if (!grp)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (ObjectGuid guid = grp->GetMemberGUID(membername))
|
if (ObjectGuid guid = grp->GetMemberGUID(membername))
|
||||||
{
|
{
|
||||||
Player::RemoveFromGroup(grp, guid, GROUP_REMOVEMETHOD_KICK, GetPlayer()->GetGUID());
|
Player::RemoveFromGroup(grp, guid, GROUP_REMOVEMETHOD_KICK, GetPlayer()->GetGUID());
|
||||||
|
|||||||
Reference in New Issue
Block a user