void ObjectAccessor::WorldObjectChangeAccumulator::Visit(PlayerMapType &m) { for(PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter) if(iter->getSource()->HaveAtClient(&i_object)) ObjectAccessor::_buildPacket(iter->getSource(), &i_object, i_updateDatas); }
void ObjectAccessor::WorldObjectChangeAccumulator::Visit(PlayerMapType &m) { for(PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter) { BuildPacket(iter->getSource()); if (!iter->getSource()->GetSharedVisionList().empty()) { SharedVisionList::const_iterator it = iter->getSource()->GetSharedVisionList().begin(); for ( ; it != iter->getSource()->GetSharedVisionList().end(); ++it) BuildPacket(*it); } } }
void MessageDistDeliverer::Visit(PlayerMapType &m) { for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter) { Player *target = iter->getSource(); if (!target->InSamePhase(i_phaseMask)) continue; if (target->GetExactDist2dSq(i_source) > i_distSq) continue; // Send packet to all who are sharing the player's vision if (!target->GetSharedVisionList().empty()) { SharedVisionList::const_iterator i = target->GetSharedVisionList().begin(); for (; i != target->GetSharedVisionList().end(); ++i) if ((*i)->m_seer == target) SendPacket(*i); } if (target->m_seer == target) SendPacket(target); } }
void DelayedUnitRelocation::Visit(PlayerMapType &m) { for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter) { Player * player = iter->getSource(); WorldObject const *viewPoint = player->m_seer; if (!viewPoint->isNeedNotify(NOTIFY_VISIBILITY_CHANGED)) continue; if (player != viewPoint && !viewPoint->IsPositionValid()) continue; CellPair pair2(Trinity::ComputeCellPair(viewPoint->GetPositionX(), viewPoint->GetPositionY())); Cell cell2(pair2); //cell.SetNoCreate(); need load cells around viewPoint or player, that's why its commented PlayerRelocationNotifier relocate(*player); TypeContainerVisitor<PlayerRelocationNotifier, WorldTypeMapContainer > c2world_relocation(relocate); TypeContainerVisitor<PlayerRelocationNotifier, GridTypeMapContainer > c2grid_relocation(relocate); cell2.Visit(pair2, c2world_relocation, i_map, *viewPoint, i_radius); cell2.Visit(pair2, c2grid_relocation, i_map, *viewPoint, i_radius); relocate.SendToSelf(); } }
void CreatureRelocationNotifier::Visit(PlayerMapType &m) { for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter) { Player * pl = iter->getSource(); if (!pl->m_seer->isNeedNotify(NOTIFY_VISIBILITY_CHANGED)) pl->UpdateVisibilityOf(&i_creature); CreatureUnitRelocationWorker(&i_creature, pl); } }
void Deliverer::Visit(PlayerMapType &m) { for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter) { if (!i_dist || iter->getSource()->GetDistance(&i_source) <= i_dist) { // Send packet to all who are sharing the player's vision if (!iter->getSource()->GetSharedVisionList().empty()) { SharedVisionList::const_iterator it = iter->getSource()->GetSharedVisionList().begin(); for (; it != iter->getSource()->GetSharedVisionList().end(); ++it) SendPacket(*it); } VisitObject(iter->getSource()); } } }
void MessageDelivererExcept::Visit(PlayerMapType &m) { for(PlayerMapType::iterator it = m.begin(); it!= m.end(); ++it) { Player* player = it->getSource(); if(!player->InSamePhase(i_phaseMask) || player == i_skipped_receiver) continue; if (WorldSession* session = player->GetSession()) session->SendPacket(i_message); } }
void PlayerRelocationNotifier::Visit(PlayerMapType &m) { for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter) { Player* plr = iter->getSource(); vis_guids.erase(plr->GetGUID()); i_player.UpdateVisibilityOf(plr, i_data, i_visibleNow); if (plr->m_seer->isNeedNotify(NOTIFY_VISIBILITY_CHANGED)) continue; plr->UpdateVisibilityOf(&i_player); } }
void VisibleChangesNotifier::Visit(PlayerMapType &m) { for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter) { if (iter->getSource() == &i_object) continue; iter->getSource()->UpdateVisibilityOf(&i_object); if (!iter->getSource()->GetSharedVisionList().empty()) for (SharedVisionList::const_iterator i = iter->getSource()->GetSharedVisionList().begin(); i != iter->getSource()->GetSharedVisionList().end(); ++i) if ((*i)->m_seer == iter->getSource()) (*i)->UpdateVisibilityOf(&i_object); } }
void PlayerRelocationNotifier::Visit(PlayerMapType &m) { for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter) { Player* player = iter->getSource(); vis_guids.erase(player->GetGUID()); i_player.UpdateVisibilityOf(player, i_data, i_visibleNow); if (i_data.IsFull()) { WorldPacket packet; i_data.BuildPacket(&packet); i_player.GetSession()->SendPacket(&packet); i_data = UpdateData(i_player.GetMapId()); } if (player->m_seer->isNeedNotify(NOTIFY_VISIBILITY_CHANGED)) continue; player->UpdateVisibilityOf(&i_player); } }
void DynamicObjectUpdater::Visit(PlayerMapType& m) { for (PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr) VisitHelper(itr->getSource()); }