diff options
author | Shauren <shauren.trinity@gmail.com> | 2013-07-27 11:47:35 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2013-07-27 11:47:35 +0200 |
commit | 1be55d53118a6ca291486d08a8cd2e52d770ff1d (patch) | |
tree | 77e92839586dd200542073c4ccf65804ab77ad42 /src/server/game/Maps/PhaseMgr.cpp | |
parent | 7cdaf175385a84ec099c02c78ef7311801b611ec (diff) |
Core/PacketIO: Implemented phase notifications for group update packets
Diffstat (limited to 'src/server/game/Maps/PhaseMgr.cpp')
-rw-r--r-- | src/server/game/Maps/PhaseMgr.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/server/game/Maps/PhaseMgr.cpp b/src/server/game/Maps/PhaseMgr.cpp index 0314a9605ba..87a7bc434ff 100644 --- a/src/server/game/Maps/PhaseMgr.cpp +++ b/src/server/game/Maps/PhaseMgr.cpp @@ -17,6 +17,7 @@ #include "PhaseMgr.h" #include "Chat.h" +#include "Group.h" #include "Language.h" #include "ObjectMgr.h" #include "Player.h" @@ -36,7 +37,10 @@ void PhaseMgr::Update() return; if (_UpdateFlags & PHASE_UPDATE_FLAG_CLIENTSIDE_CHANGED) + { phaseData.SendPhaseshiftToPlayer(); + player->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_PHASE); + } if (_UpdateFlags & PHASE_UPDATE_FLAG_SERVERSIDE_CHANGED) phaseData.SendPhaseMaskToPlayer(); @@ -281,6 +285,18 @@ void PhaseData::SendPhaseshiftToPlayer() player->GetSession()->SendSetPhaseShift(phaseIds, terrainswaps); } +void PhaseData::GetActivePhases(std::set<uint32>& phases) const +{ + for (PhaseInfoContainer::const_iterator itr = spellPhaseInfo.begin(); itr != spellPhaseInfo.end(); ++itr) + if (itr->second.phaseId) + phases.insert(itr->second.phaseId); + + // Phase Definitions + for (std::list<PhaseDefinition const*>::const_iterator itr = activePhaseDefinitions.begin(); itr != activePhaseDefinitions.end(); ++itr) + if ((*itr)->phaseId) + phases.insert((*itr)->phaseId); +} + void PhaseData::AddPhaseDefinition(PhaseDefinition const* phaseDefinition) { if (phaseDefinition->IsOverwritingExistingPhases()) @@ -380,3 +396,8 @@ bool PhaseMgr::IsConditionTypeSupported(ConditionTypes conditionType) return false; } } + +void PhaseMgr::GetActivePhases(std::set<uint32>& phases) const +{ + phaseData.GetActivePhases(phases); +} |