void VisibleChangesNotifier::Visit(PlayerMapType &m) { for(PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter) { Player* player = iter->getSource(); if(player == &i_object) continue; player->UpdateVisibilityOf(player->GetViewPoint(),&i_object); } }
void CreatureRelocationNotifier::Visit(PlayerMapType &m) { for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter) { Player* player = iter->GetSource(); if (!player->m_seer->isNeedNotify(NOTIFY_VISIBILITY_CHANGED)) player->UpdateVisibilityOf(&i_creature); CreatureUnitRelocationWorker(&i_creature, player); } }
void ObjectMessageDeliverer::Visit(PlayerMapType &m) { for(PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter) { if(!iter->getSource()->InSamePhase(i_phaseMask)) continue; if(WorldSession* session = iter->getSource()->GetSession()) session->SendPacket(i_message); } }
void MaNGOS::PlayerNotifier::Visit(PlayerMapType &m) { for(PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter) { if( iter->getSource() == &i_player ) continue; iter->getSource()->UpdateVisibilityOf(&i_player); i_player.UpdateVisibilityOf(iter->getSource()); } }
void ObjectMessageDistDeliverer::Visit(PlayerMapType &m) { for(PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter) { if( !i_dist || iter->getSource()->GetDistance(&i_object) <= i_dist ) { if(WorldSession* session = iter->getSource()->GetSession()) session->SendPacket(i_message); } } }
void MessageDeliverer::Visit(PlayerMapType &m) { for(PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter) { if( i_toSelf || iter->getSource() != &i_player) { if(WorldSession* session = iter->getSource()->GetSession()) session->SendPacket(i_message); } } }
void VisibleNotifier::Visit(PlayerMapType &m) { for(PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter) { if( iter->getSource() == &i_player ) continue; iter->getSource()->UpdateVisibilityOf(&i_player); i_player.UpdateVisibilityOf(iter->getSource(),i_data,i_data_updates,i_visibleNow); i_clientGUIDs.erase(iter->getSource()->GetGUID()); } }
void MessageDistDeliverer::Visit(PlayerMapType &m) { for(PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter) { if ((i_toSelf || iter->getSource() != &i_player ) && (!i_ownTeamOnly || iter->getSource()->GetTeam() == i_player.GetTeam() ) && (!i_dist || iter->getSource()->IsWithinDist(&i_player,i_dist))) { if (WorldSession* session = iter->getSource()->GetSession()) session->SendPacket(i_message); } } }
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 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 CreatureVisibleMovementNotifier::Visit(PlayerMapType &m) { for(PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter) { if( i_creature.IsVisibleInGridForPlayer(iter->second) ) { UpdateData update_data; WorldPacket packet; i_creature.BuildCreateUpdateBlockForPlayer(&update_data, iter->second); update_data.BuildPacket(&packet); iter->second->GetSession()->SendPacket(&packet); } } }
void ObjectMessageDistDeliverer::Visit(PlayerMapType &m) { for(PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter) { if (!i_dist || iter->getSource()->IsWithinDist(&i_object,i_dist)) { if (!i_object.InSamePhase(iter->getSource())) continue; if (WorldSession* session = iter->getSource()->GetSession()) session->SendPacket(i_message); } } }
void MaNGOS::PlayerNotifier::Visit(PlayerMapType &m) { WorldObject const* viewPoint = i_player.GetViewPoint(); for(PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter) { Player* player = iter->getSource(); if( player == &i_player ) continue; player->UpdateVisibilityOf(player->GetViewPoint(),&i_player); i_player.UpdateVisibilityOf(viewPoint,player); } }
void CreatureRelocationNotifier::Visit(PlayerMapType &m) { for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter) { Player* player = iter->GetSource(); // NOTIFY_VISIBILITY_CHANGED does not guarantee that player will do it himself (because distance is also checked), but screw it, it's not that important if (!player->m_seer->isNeedNotify(NOTIFY_VISIBILITY_CHANGED)) player->UpdateVisibilityOf(&i_creature); // NOTIFY_AI_RELOCATION does not guarantee that player will do it himself (because distance is also checked), but screw it, it's not that important if (!player->m_seer->isNeedNotify(NOTIFY_AI_RELOCATION) && !i_creature.IsMoveInLineOfSightStrictlyDisabled()) CreatureUnitRelocationWorker(&i_creature, 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()->HasSharedVision()) 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 VisibleNotifier::Visit(PlayerMapType &m) { WorldObject const* viewPoint = i_player.GetViewPoint(); for(PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter) { Player* player = iter->getSource(); if( player == &i_player ) continue; player->UpdateVisibilityOf(player->GetViewPoint(),&i_player); i_player.UpdateVisibilityOf(viewPoint,player,i_data,i_data_updates,i_visibleNow); i_clientGUIDs.erase(player->GetGUID()); } }
void ObjectVisibleNotifier::Visit(PlayerMapType &m) { // ignore not respawned gameobjects if(i_object.GetTypeId() == TYPEID_GAMEOBJECT && !((GameObject&)i_object).isSpawned()) return; for(std::map<OBJECT_HANDLE, Player *>::iterator iter=m.begin(); iter != m.end(); ++iter) { UpdateData update_data; WorldPacket packet; i_object.BuildCreateUpdateBlockForPlayer(&update_data, iter->second); update_data.BuildPacket(&packet); iter->second->GetSession()->SendPacket(&packet); } }
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; PlayerRelocationNotifier relocate(*player); Cell::VisitAllObjects(viewPoint, relocate, i_radius, false); relocate.SendToSelf(); } }
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 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 || target->GetVehicle()) SendPacket(target); } }
void PlayerNotifier::Visit(PlayerMapType &m) { BuildForMySelf(); for(std::map<OBJECT_HANDLE, Player *>::iterator iter=m.begin(); iter != m.end(); ++iter) { if( iter->second == &i_player ) continue; if( i_player.isAlive() && iter->second->isAlive() || i_player.isDead() && iter->second->isDead() ) { if (iter->second->isVisibleFor(&i_player,false)) iter->second->SendUpdateToPlayer(&i_player); if (i_player.isVisibleFor(iter->second,false)) i_player.SendUpdateToPlayer(iter->second); } else { i_player.DestroyForPlayer(iter->second); iter->second->DestroyForPlayer(&i_player); } } }
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()); }