Core/DungeonFinder:
- Prevent players from vote kicking in combat (basic implementation, still needs a timer) partially closes #2563
- Prevent players from teleporting to a finished dungeon using macro commands. Closes #6748
Also add a missing change for ff77610e1d thanks 2010phenix for the hint.
This commit is contained in:
@@ -1626,6 +1626,7 @@ void LFGMgr::InitBoot(Group* grp, uint64 kicker, uint64 victim, std::string reas
|
||||
{
|
||||
if (!grp)
|
||||
return;
|
||||
|
||||
uint64 gguid = grp->GetGUID();
|
||||
SetState(gguid, LFG_STATE_BOOT);
|
||||
|
||||
@@ -1635,7 +1636,6 @@ void LFGMgr::InitBoot(Group* grp, uint64 kicker, uint64 victim, std::string reas
|
||||
pBoot->reason = reason;
|
||||
pBoot->victim = victim;
|
||||
pBoot->votedNeeded = GetVotesNeeded(gguid);
|
||||
PlayerSet players;
|
||||
|
||||
// Set votes
|
||||
for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
@@ -1651,15 +1651,11 @@ void LFGMgr::InitBoot(Group* grp, uint64 kicker, uint64 victim, std::string reas
|
||||
else
|
||||
{
|
||||
pBoot->votes[guid] = LFG_ANSWER_PENDING; // Other members need to vote
|
||||
players.insert(plrg);
|
||||
plrg->GetSession()->SendLfgBootPlayer(pBoot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Notify players
|
||||
for (PlayerSet::const_iterator it = players.begin(); it != players.end(); ++it)
|
||||
(*it)->GetSession()->SendLfgBootPlayer(pBoot);
|
||||
|
||||
m_Boots[grp->GetLowGUID()] = pBoot;
|
||||
}
|
||||
|
||||
@@ -1770,6 +1766,9 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*
|
||||
uint64 gguid = grp->GetGUID();
|
||||
LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(GetDungeon(gguid));
|
||||
|
||||
if (GetState(gguid) == LFG_STATE_FINISHED_DUNGEON)
|
||||
error = LFG_TELEPORTERROR_INVALID_LOCATION;
|
||||
|
||||
if (!dungeon)
|
||||
error = LFG_TELEPORTERROR_INVALID_LOCATION;
|
||||
else if (player->GetMapId() != uint32(dungeon->map)) // Do not teleport players in dungeon to the entrance
|
||||
@@ -1817,7 +1816,7 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*
|
||||
|
||||
if (error == LFG_TELEPORTERROR_OK)
|
||||
{
|
||||
if (!player->GetMap()->IsDungeon() && !player->GetMap()->IsRaid())
|
||||
if (!player->GetMap()->IsDungeon())
|
||||
player->SetBattlegroundEntryPoint();
|
||||
|
||||
if (player->isInFlight())
|
||||
|
||||
@@ -23362,7 +23362,7 @@ Player* Player::GetNextRandomRaidMember(float radius)
|
||||
|
||||
PartyResult Player::CanUninviteFromGroup() const
|
||||
{
|
||||
const Group* grp = GetGroup();
|
||||
Group const* grp = GetGroup();
|
||||
if (!grp)
|
||||
return ERR_NOT_IN_GROUP;
|
||||
|
||||
@@ -23385,8 +23385,12 @@ PartyResult Player::CanUninviteFromGroup() const
|
||||
if (grp->isRollLootActive())
|
||||
return ERR_PARTY_LFG_BOOT_LOOT_ROLLS;
|
||||
|
||||
// TODO: Should also be sent when anyone has recently left combat, with an aprox ~5 seconds timer.
|
||||
for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
if (itr->getSource() && itr->getSource()->isInCombat())
|
||||
return ERR_PARTY_LFG_BOOT_IN_COMBAT;
|
||||
|
||||
/* Missing support for these types
|
||||
return ERR_PARTY_LFG_BOOT_IN_COMBAT; // also have a cooldown (some secs after combat finish
|
||||
return ERR_PARTY_LFG_BOOT_COOLDOWN_S;
|
||||
return ERR_PARTY_LFG_BOOT_NOT_ELIGIBLE_S;
|
||||
*/
|
||||
|
||||
@@ -343,7 +343,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket & recv_data)
|
||||
// Send next quest
|
||||
if (Quest const* nextQuest = _player->GetNextQuest(guid, quest))
|
||||
{
|
||||
if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true) && _player->CanTakeQuest(quest, true))
|
||||
if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true) && _player->CanTakeQuest(nextQuest, true))
|
||||
{
|
||||
_player->AddQuest(nextQuest, object);
|
||||
if (_player->CanCompleteQuest(nextQuest->GetQuestId()))
|
||||
|
||||
@@ -51,7 +51,7 @@ void PacketLog::LogPacket(WorldPacket const& packet, Direction direction)
|
||||
ByteBuffer data(4+4+4+1+packet.size());
|
||||
data << int32(packet.GetOpcode());
|
||||
data << int32(packet.size());
|
||||
data << int32(time(NULL));
|
||||
data << uint32(time(NULL));
|
||||
data << uint8(direction);
|
||||
|
||||
for (uint32 i = 0; i < packet.size(); i++)
|
||||
|
||||
Reference in New Issue
Block a user