示例#1
0
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);
    }
}
示例#2
0
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);
    }
}
示例#3
0
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
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);
        }
    }
}
示例#6
0
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);
        }
    }
}
示例#7
0
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);
    }
}
示例#8
0
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);
    }
}
示例#9
0
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);
        }
    }
}
示例#10
0
void
MessageDeliverer::Visit(PlayerMapType &m)
{
    for(PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
    {
        if (i_toSelf || iter->getSource() != &i_player)
        {
            if (!i_player.InSamePhase(iter->getSource()))
                continue;

            if(WorldSession* session = iter->getSource()->GetSession())
                session->SendPacket(i_message);
        }
    }
}
示例#11
0
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);
    }
}
示例#12
0
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);
        }
    }
}
示例#13
0
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);
    }
}
示例#14
0
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);
    }
}
示例#15
0
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());
    }
}
示例#16
0
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();
    }
}
示例#17
0
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());
        }
    }
}
示例#18
0
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);
    }
}
示例#19
0
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);
        }
    }
}
示例#20
0
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);
    }
}
示例#21
0
void DynamicObjectUpdater::Visit(PlayerMapType &m)
{
    for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
        VisitHelper(itr->getSource());
}